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.
// 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 \]$/mset 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.
set system login user netops uid 2001set system login user netops class super-userset system login user remote-noc uid 2002set system login user remote-noc class noc-readonlyWhy: There is no authentication-order line, so only local passwords are used.
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:
| Config | Rule result | Overall result |
|---|---|---|
| Passing config | pass | PASS |
| Failing config 1 | fail | FAIL |
| Failing config 2 | fail | FAIL |
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.
// 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\$/mset 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).
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:
| Config | Rule result | Overall result |
|---|---|---|
| Passing config | pass | PASS |
| Failing config | fail | FAIL |
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.
Related reference
- Juniper Junos policy templates: every rule in
junos-aaa.policy, its references and known limitations. - Policy Definitions: the definition file format and every method.
- Policy Assignments: run a definition against your devices.
- Policy Compliance Results: read the pass and fail results.