Skip to content
Guides & References

Junos services

Worked examples for Juniper Junos services: no finger, FTP, rlogin, rsh or rexec, and ICMP redirects turned off.

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

Junos services

Rules that turn off services a router or switch does not need. Every service that is on is something that can be attacked. They come from the junos-services policy template.

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

Each of the 4 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.

All the rules come from junos-services.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
No legacy services must_not_match_regex 8.0.2
ICMP redirects off must_match_single_string 8.0.0

No legacy services

Finger, FTP, rlogin, rsh and rexec are old services that send data in clear text or leak information. This rule fails if any of them is turned on under set system services.

Definition
// No legacy service is enabled (fails on set system services finger, ftp, rlogin, rsh or rexec)
#[must_not_match_regex]
/^set system services (finger|ftp|rexec|rlogin|rsh)( |$)/m
passPassing config: Hardened EX2300 sample (Junos 23.2, synthetic)
set system services ssh root-login deny
set system services ssh protocol-version v2
set system services netconf ssh

Why: Only SSH and NETCONF over SSH are on.

failFailing config: Unhardened EX2300 sample (Junos 15.1, synthetic)
set system services ssh protocol-version [ v1 v2 ]
set system services netconf ssh
set system services ftp
set system services telnet

Why: FTP is on.

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 CM-7
HIPAA (45 CFR) 164.312(c)(1)
ISO/IEC 27001:2022 Annex A A.8.9

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.


ICMP redirects off

An ICMP redirect tells a host to use a different gateway. An attacker can fake one to send traffic through their own machine. This rule needs the exact line set system no-redirects.

Definition
// ICMP redirects are disabled (set system no-redirects)
#[must_match_single_string]
set system no-redirects
passPassing config: Hardened EX2300 sample (Junos 23.2, synthetic)
set system host-name br-gwy-sw01
set system domain-name example.net
set system time-zone UTC
set system no-redirects

Why: Redirects are turned off.

failFailing config: Unhardened EX2300 sample (Junos 15.1, synthetic)
set system host-name br-gwy-sw02
set system domain-name example.net
set system time-zone Europe/Dublin

Why: There is no no-redirects line, so the device sends redirects.

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
ISO/IEC 27001:2022 Annex A A.8.20

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


Type to search.