Skip to content

Commit 5ff9dd2

Browse files
Junos (#74)
* removing ruleset files * adding 3_interface rules and refs * Revert "adding 3_interface rules and refs" This reverts commit 6ec630d. * added 3_interfaces rules and refs again * added 4_protocols tests * restrctured 3_interfaces folder * added 6_services * 5_snmp * 1 general recommendations --------- Co-authored-by: mailsanjayhere <mailsanjayhere@gmail.com>
1 parent 35423ba commit 5ff9dd2

16 files changed

+254
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from comfy.compliance import medium
2+
3+
4+
@medium(
5+
name='rule_1_1_ensure_device_is_running_current_junos_software',
6+
platform=['juniper'],
7+
commands=dict(chk_cmd='')
8+
)
9+
def rule_1_1_ensure_device_is_running_current_junos_software(commands, ref):
10+
assert '' in commands.chk_cmd, ref
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.rule_1_1_ensure_device_is_running_current_junos_software
2+
3+
Reference: DATA
4+
ORIES
5+
S&cat=SIRT_1&detail=content
6+
7+
Remediation: Software patching procedures may vary between different platforms or organizations and
8+
can be accomplished using the CLI, the JWeb GUI, centrally through Junos Space or other
9+
management platforms.
10+
To update a standalone JUNOS Device through the CLI, first upload the desired software
11+
image (downloaded from Juniper or your Support Partner) to the JUNOS Device in the
12+
/var/tmp/ folder.
13+
In most cases an upgrade is performed with the following command, issued from
14+
Operational Mode:
15+
user@host> request system software add /var/tmp/<image name>
16+
Where <image name> is the filename of the JUNOS image provided by Juniper.
17+
NOTE - Updating JUNOS Software with this command will result in a reboot of the system
18+
and loss of service.
19+
In platforms deployed with redundant Routing Engines, as Virtual Chassis or as HA
20+
Clusters, an In-Service Software Updates (or ISSU) may be supported. An ISSU update
21+
updates and reboots each node or RE separately, failing services on to the other node/RE
22+
prior to the reboot.
23+
To perform an ISSU Update, on most platforms, issue the following command from
24+
Operational Mode:
25+
user@host> request system software in-service-upgrade /var/tmp/<image name>
26+
27+
28+
29+
NOTE - The specific procedure and prerequisites for ISSU varies by platform and deployment
30+
type. If some prerequisites (such as NSR or GRES) are not correctly configured a loss of
31+
service may still occur.
32+
Please refer to the documentation for your platform and network enviroment before
33+
attempting to update software.
34+
35+
.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from comfy.compliance import medium
2+
3+
4+
@medium(
5+
name='rule_1_2_ensure_end_of_life_junos_devices_are_not_used',
6+
platform=['juniper'],
7+
commands=dict(chk_cmd='')
8+
)
9+
def rule_1_2_ensure_end_of_life_junos_devices_are_not_used(commands, ref):
10+
assert '' in commands.chk_cmd, ref
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.rule_1_2_ensure_end_of_life_junos_devices_are_not_used
2+
3+
Reference:
4+
Remediation: Administrators should plan to retire all JUNOS Devices before they reach EOS/EOSE
5+
6+
.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from comfy.compliance import medium
2+
3+
4+
@medium(
5+
name='rule_1_3_ensure_device_is_physically_secured',
6+
platform=['juniper'],
7+
commands=dict(chk_cmd='')
8+
)
9+
def rule_1_3_ensure_device_is_physically_secured(commands, ref):
10+
assert '' in commands.chk_cmd, ref
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.rule_1_3_ensure_device_is_physically_secured
2+
3+
Reference: Requirement 9
4+
Security Agency (NSA)
5+
6+
Remediation: While preventing all physical access is nearly impossible in some deployment scenarios,
7+
such as for a Service Provider supplying Customer Premises Equipment (CPE), in most
8+
cases the following minimum steps should be considered:
9+
10+
The JUNOS Device should be deployed in a secure, locked room.
11+
12+
Access logs should be maintained for the room, either electronically through use of
13+
access cards or through a manual process for access to the key.
14+
15+
Access to the room should be limited to only those personnel absolutely required.
16+
17+
Use of CCTV to monitor sensitive areas and comms rooms.
18+
19+
The room should ideally be equipped with Uninterruptible Power Supply (UPS) and
20+
cooling facilities as well as be free from Electromagnetic Interference sources. Loss
21+
of power (either malicious or accidental) or cooling can result in a loss of service.
22+
23+
24+
25+
These methods should be a bare minimum and other physical security options considered
26+
when protecting a JUNOS Device which processes or transits sensitive data, such as
27+
Encryption Keys, Credit Card or Personally Identifiable Information which may be in scope
28+
for regulatory/industry compliance standards such as PCI DSS, GDPR or HIPAA.
29+
In these situation Secure Hosting or Co-Location Facilities may be required and options
30+
considered for Physical Security should include:
31+
32+
24/7 Security Guards and Monitoring
33+
34+
Biometric and/or Multi Factor access control
35+
36+
Private Caged areas for secure equipment
37+
38+
Additional alarm and monitoring systems to detect equipment being removed from
39+
racks
40+
41+
.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from comfy.compliance import medium
2+
3+
4+
@medium(
5+
name='rule_1_4_ensure_configuration_is_backed_up_on_a_regular_schedule',
6+
platform=['juniper'],
7+
commands=dict(chk_cmd='')
8+
)
9+
def rule_1_4_ensure_configuration_is_backed_up_on_a_regular_schedule(commands, ref):
10+
assert '' in commands.chk_cmd, ref
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.rule_1_4_ensure_configuration_is_backed_up_on_a_regular_schedule
2+
3+
Reference: Security Agency (NSA)
4+
5+
6+
7+
8+
Remediation: A discussion of all possible backup methods is beyond the scope of this Benchmark.
9+
Consider the Archival section of this Benchmark for one method of obtaining remote
10+
backups whenever your configuration is changed.
11+
CVS tools such as RANCID provide an alternative method to backup and manage
12+
configuration files from a central location as well as keeping track of changes over time.
13+
Also consider a method of maintaining offline copies of your backup data, such as tape
14+
storage. This provides a vital tool in Disaster Recovery and is also extremely helpful when
15+
recovering from a successful attack, as you can be certain that the attacker was unable to
16+
alter the offline version.
17+
18+
.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from comfy.compliance import medium
2+
3+
4+
@medium(
5+
name='rule_1_5_ensure_backup_data_is_stored_and_transferred_securely',
6+
platform=['juniper'],
7+
commands=dict(chk_cmd='')
8+
)
9+
def rule_1_5_ensure_backup_data_is_stored_and_transferred_securely(commands, ref):
10+
assert '' in commands.chk_cmd, ref
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.rule_1_5_ensure_backup_data_is_stored_and_transferred_securely
2+
3+
Reference: Security Agency (NSA)
4+
5+
Remediation: A discussion of securing your backup services is beyond the scope of this Benchmark, but at
6+
a minimum you should consider the following:
7+
8+
Never transfer configuration files using plain text protocols such as Telnet or FTP.
9+
Use SSH or SCP instead.
10+
11+
Restrict access to backups to the least number of administrative users possible.
12+
13+
Store offline backups in a physically secure, fire resistant, air tight safe.
14+
15+
Log access and changes to backups.
16+
17+
Secure any server that stores backups using the appropriate Center for Internet
18+
Security Benchmark.
19+
20+
Disable all unused services on the backup server.
21+
22+
.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from comfy.compliance import medium
2+
3+
4+
@medium(
5+
name='rule_1_6_ensure_maximum_ram_is_installed',
6+
platform=['juniper'],
7+
commands=dict(chk_cmd='')
8+
)
9+
def rule_1_6_ensure_maximum_ram_is_installed(commands, ref):
10+
assert '' in commands.chk_cmd, ref
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.rule_1_6_ensure_maximum_ram_is_installed
2+
3+
Reference: Security Agency (NSA)
4+
5+
Remediation: Installing the most RAM available for your system will both help to mitigate these attacks
6+
and boost performance of your routers. In most cases RAM upgrades are extremely cost
7+
effective way to increase router performance and survivability.
8+
9+
.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from comfy.compliance import medium
2+
3+
4+
@medium(
5+
name='rule_1_7_ensure_logging_data_is_monitored',
6+
platform=['juniper'],
7+
commands=dict(chk_cmd='')
8+
)
9+
def rule_1_7_ensure_logging_data_is_monitored(commands, ref):
10+
assert '' in commands.chk_cmd, ref
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.rule_1_7_ensure_logging_data_is_monitored
2+
3+
Reference:
4+
Remediation:
5+
.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from comfy.compliance import medium
2+
3+
4+
@medium(
5+
name='rule_1_8_ensure_retired_junos_devices_are_disposed_of_securely',
6+
platform=['juniper'],
7+
commands=dict(chk_cmd='')
8+
)
9+
def rule_1_8_ensure_retired_junos_devices_are_disposed_of_securely(commands, ref):
10+
assert '' in commands.chk_cmd, ref
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.rule_1_8_ensure_retired_junos_devices_are_disposed_of_securely
2+
3+
Reference: -summary/request-system-zeroize.html
4+
5+
Remediation: To ensure that sensitive data is not lost when disposing of or redeploying retired JUNOS
6+
Devices, it is essential that the system be fully zeroized. This process returns the system to
7+
its original factory default state, with no root password set and all configuration, backups,
8+
user specified options, encryption keys, etc deleted.
9+
To zeroize a JUNOS Device, log in as a user with the maintenance permission or as root and
10+
issue the following command from Operational Mode:
11+
root@host>request system zeroize media
12+
13+
14+
15+
The media option used above also undertakes a process to securely "scrub" onboard
16+
memory and persistent media (such as flash, HDDs or SSDs) using a method equivalent to
17+
"clearing" as specified in NIST SP800-88. Using the media option will take significantly
18+
more time, as it repeatedly overwrites every area of storage with random data, but is
19+
strongly recommended for all devices where the option is supported.
20+
An increasing number of JUNOS Devices, such as the PTX5000 Series and some MX Series
21+
routers, utilize a Disaggregated JUNOS Operating System which hosts JUNOS as a Virtual
22+
Machine abstracting it from the physical Routing Engine hardware. In some instances the
23+
request system zeroize command will zeroize the Guest JUNOS VM only, and not the
24+
underlying Host OS. For these platforms the following command should be used from
25+
Operational Mode:
26+
root@host>request vmhost zeroize
27+
This command will clear both the JUNOS VM and the Host OS.
28+
When some devices, such as EX or QFX Series, are deployed in Clusters, HA or Virtual
29+
Chassis environments the request system zeroize media command may be ignored or
30+
may operate on only the local node, so will need to be issued individually on each device
31+
being disposed of.
32+
Ensure you check the current documentation for the request system zeroize command
33+
for your platform to ensure that all options are correctly specified and perform the
34+
operation as intended.
35+
Where possible, devices which are being "returned to base" from a deployment using third
36+
parties for transport should be zeroized before shipping.
37+
38+
.

0 commit comments

Comments
 (0)