Skip to content

Commit c925b0c

Browse files
netpickerimi
authored andcommitted
Use dot notation for commands (#119)
1 parent c0d0157 commit c925b0c

21 files changed

+23
-23
lines changed

CIS/cisco_ios/13_banner_rules/rule_134_set_the_banner_text_for_webauth_banner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
commands={'chk_cmd': 'show ip admission auth-proxy-banner http'}
88
)
99
def rule_134_set_the_banner_text_for_webauth_banner(commands, ref):
10-
banner_text = commands['chk_cmd']
10+
banner_text = commands.chk_cmd
1111
assert 'Unauthorized access is prohibited' in banner_text, ref + " - Missing or incorrect banner text."

CIS/cisco_ios/15_snmp_rules/rule_1510_require_aes_128_as_minimum_for_snmp_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def rule_1510_require_aes_128_as_minimum_for_snmp_server(configuration, commands
2222
AssertionError: If any SNMPv3 user is not configured with AES 128 encryption.
2323
"""
2424

25-
snmp_users_output = commands['show_snmp_user'].splitlines()
25+
snmp_users_output = commands.show_snmp_user.splitlines()
2626
snmp_v3_users_aes128 = [line for line in snmp_users_output if 'AES 128' in line or 'AES128' in line]
2727

2828
# Verify that there is at least one SNMPv3 user configured with AES 128

CIS/cisco_ios/15_snmp_rules/rule_159_set_priv_for_each_snmp_server_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
commands={'show_snmp_group': 'show snmp group'}
88
)
99
def rule_159_set_priv_for_each_snmp_server_group(configuration, commands, device, devices):
10-
snmp_groups_output = commands['show_snmp_group'].splitlines()
10+
snmp_groups_output = commands.show_snmp_group.splitlines()
1111
snmp_v3_priv_groups = [
1212
line for line in snmp_groups_output
1313
if 'v3' in line and 'auth' in line and 'priv' in line

CIS/cisco_ios/16_login_enhancements/rule_163_configuring_kerberos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def rule_163_configuring_kerberos(configuration, commands, device, devices):
2323
AssertionError: If Kerberos is not configured correctly or credentials are not set properly.
2424
"""
2525

26-
kerberos_cred_output = commands['show_kerberos_cred']
27-
config_lines = commands['show_running_config'].splitlines()
26+
kerberos_cred_output = commands.show_kerberos_cred
27+
config_lines = commands.show_running_config.splitlines()
2828

2929
# Check if Kerberos is enabled
3030
assert 'kerberos' in config_lines, "Kerberos is not enabled on this device."

CIS/cisco_ios/16_login_enhancements/rule_164_configure_web_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def rule_164_configure_web_interface(configuration, commands, device, devices):
2323
AssertionError: If configurations are not set correctly.
2424
"""
2525

26-
ip_admission_output = commands['show_ip_admission']
27-
config_lines = commands['show_running_config'].splitlines()
26+
ip_admission_output = commands.show_ip_admission
27+
config_lines = commands.show_running_config.splitlines()
2828

2929
# Check SISF-Based Device Tracking is enabled
3030
assert 'device-tracking' in config_lines, \

CIS/cisco_ios/32_border_router_filtering/rule_321_set_ip_access_list_extended_to_forbid_private_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def rule_321_set_ip_access_list_extended_to_forbid_private_source_addresses_from
2424
other specified ranges.
2525
"""
2626

27-
access_list_output = commands['show_ip_access_list'].splitlines()
27+
access_list_output = commands.show_ip_access_list.splitlines()
2828
required_deny_entries = [
2929
'deny ip 127.0.0.0 0.255.255.255 any log',
3030
'deny ip 10.0.0.0 0.255.255.255 any log',

CIS/cisco_ios/331_require_eigrp_auth_if_used/rule_3311_set_key_chain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
)
99
def rule_3331_set_key_chain(commands, ref):
1010
# Extracting the key chain configuration from the command output
11-
key_chain_config = commands['key_chain_config']
11+
key_chain_config = commands.key_chain_config
1212

1313
# Verifying that a key chain is configured for EIGRP
1414
assert 'key chain' in key_chain_config, ref

CIS/cisco_ios/331_require_eigrp_auth_if_used/rule_3312_set_key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
)
99
def rule_3332_set_key(commands, ref):
1010
# Extracting the key chain configuration from the command output
11-
key_chain_config = commands['key_chain_config']
11+
key_chain_config = commands.key_chain_config
1212

1313
# Verifying that the key is properly set within a key chain
1414
assert 'key' in key_chain_config, ref

CIS/cisco_ios/331_require_eigrp_auth_if_used/rule_3313_set_key_string.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
)
99
def rule_3313_set_key_string(commands, ref):
1010
# Extracting the key chain configuration from the command output
11-
key_chain_detail = commands['key_chain_detail']
11+
key_chain_detail = commands.key_chain_detail
1212

1313
# Verifying that the 'key-string' is configured within the key chain
1414
assert 'key-string' in key_chain_detail, ref

CIS/cisco_ios/331_require_eigrp_auth_if_used/rule_3314_set_address_family_ipv4_autonomous_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
)
99
def rule_3314_set_address_family_ipv4_autonomous_system(commands, ref):
1010
# Extracting the EIGRP address family configuration from the command output
11-
eigrp_config = commands['eigrp_config']
11+
eigrp_config = commands.eigrp_config
1212

1313
# Verifying that the 'address-family ipv4 autonomous-system' is configured for EIGRP
1414
assert 'address-family ipv4 autonomous-system' in eigrp_config, ref

0 commit comments

Comments
 (0)