Skip to content
Guides & References

Junos AAA and local accounts

Worked examples for Juniper Junos AAA and local accounts: log in through RADIUS or TACACS+ first, fall back to local passwords, and no MD5 password hashes.

Policy LibraryUpdated
Platform
juniper-junos
Minimum version
rConfig 8.0.2
Editions
Pro, Vector, Enterprise
On this page

Junos AAA and local accounts

Rules for who can log in and how their passwords are stored. They come from the junos-aaa policy template.

Every example on this page was checked with rConfig Pro's policy engine on

Each of the 5 configs below was run through rConfig Pro’s evaluator with the rule above it, and gave the result shown. The configs are sanitised excerpts of the sample configs that come with the template. A card marked changed has one line edited to show a failure.

All the rules come from junos-aaa.policy in the policy templates (v1.5.0). Import the whole file with Import Templates (see importing a policy template), or copy one rule into your own definition. The Juniper Junos templates page lists the file’s known limitations. Run the rules against show configuration | display set.

Rule Method Since
Central login first, local last must_match_regex 8.0.0
No MD5 password hashes must_not_match_regex 8.0.2

Central login first, local last

Logins should go to a RADIUS or TACACS+ server first, so you can remove a user in one place. The local password is kept at the end, for when the servers cannot be reached. This rule checks the order in set system authentication-order.

Definition
// The authentication order starts with RADIUS or TACACS+ and ends with local password fallback (set system authentication-order)
#[must_match_regex]
/^set system authentication-order \[ (radius|tacplus) (.* )?password \]$/m
passPassing config: Hardened EX2300 sample (Junos 23.2, synthetic)
set system authentication-order [ tacplus password ]
set system tacplus-server 192.0.2.30 secret "$9$EXAMPLEONLYFAKEKEY0001"
set system tacplus-server 192.0.2.31 secret "$9$EXAMPLEONLYFAKEKEY0002"

Why: TACACS+ first, then the local password.

failFailing config: Unhardened EX2300 sample (Junos 15.1, synthetic)
set system login user netops uid 2001
set system login user netops class super-user
set system login user remote-noc uid 2002
set system login user remote-noc class noc-readonly

Why: There is no authentication-order line, so only local passwords are used.

failFailing config: Hardened EX2300 sample (Junos 23.2, synthetic), changed: password before tacplus
set system authentication-order [ password tacplus ]
set system tacplus-server 192.0.2.30 secret "$9$EXAMPLEONLYFAKEKEY0001"
set system tacplus-server 192.0.2.31 secret "$9$EXAMPLEONLYFAKEKEY0002"

Why: The local password is tried first, so TACACS+ is only a fallback.

Expected result in rConfig, with this rule as the only rule in a definition:

ConfigRule resultOverall result
Passing configpassPASS
Failing config 1failFAIL
Failing config 2failFAIL

Framework mapping. The rule provides evidence towards these controls. It does not certify anything.

Framework Reference
NIST SP 800-53 AC-2
NIST CSF 1.1 PR.AC-1
HIPAA (45 CFR) 164.312(a)(1)
ISO/IEC 27001:2022 Annex A A.8.5

Tested with: sample excerpts from Junos 15.1 (synthetic) and Junos 23.2 (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.


No MD5 password hashes

A password hash that starts with $1$ is MD5, which is fast to crack. This rule fails if the root password or any local user’s password uses it.

Definition
// No root or local user password uses an MD5 hash (fails on encrypted-password "$1$...")
#[must_not_match_regex]
/^set system (root-authentication|login user \S+ authentication) encrypted-password "?\$1\$/m
passPassing config: Hardened EX2300 sample (Junos 23.2, synthetic)
set system root-authentication encrypted-password "$6$EXAMPLE$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH0001"
set system login user netops authentication encrypted-password "$6$EXAMPLE$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH0002"

Why: Both hashes start with $6$ (SHA-512).

failFailing config: Unhardened EX2300 sample (Junos 15.1, synthetic)
set system root-authentication encrypted-password "$1$Ex4mpLe0$NotARealHashValue0000/"
set system login user netops authentication encrypted-password "$6$EXAMPLE$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH0002"

Why: The root password hash starts with $1$ (MD5).

Expected result in rConfig, with this rule as the only rule in a definition:

ConfigRule resultOverall result
Passing configpassPASS
Failing configfailFAIL

Framework mapping. The rule provides evidence towards these controls. It does not certify anything.

Framework Reference
NIST SP 800-53 IA-5
ISO/IEC 27001:2022 Annex A A.5.17

Tested with: sample excerpts from Junos 15.1 (synthetic) and Junos 23.2 (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.


Type to search.