diff --git a/.github/workflows/rule-test.yml b/.github/workflows/rule-test.yml new file mode 100644 index 00000000..4d1f3ecb --- /dev/null +++ b/.github/workflows/rule-test.yml @@ -0,0 +1,14 @@ +name: CI +on: + push: + +jobs: + container-test-job: + runs-on: ubuntu-latest + container: + image: netpicker/crt + options: --cpus 1 + steps: + - uses: actions/checkout@v3 + - name: Run yaml tests + run: test-rules -p runner.yaml_rules -vvvl --rootdir $PWD $PWD diff --git a/CVE/Cisco_XR/CVE-2023-44487.py b/CVE/Cisco_XR/CVE-2023-44487.py index ec29fea9..de1901a8 100755 --- a/CVE/Cisco_XR/CVE-2023-44487.py +++ b/CVE/Cisco_XR/CVE-2023-44487.py @@ -10,6 +10,6 @@ def rule_cve_2023_44487(configuration, commands, device): import re pattern = r"Version\s([0-9.]+)" match = re.search(pattern, str(commands.version)) - s_version = match.group(1) + s_version = match.group(1) if match else '0.0.0' version = tuple(map(int, s_version.split('.'))) assert version > (7, 11, 2) diff --git a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_113_enable_aaa_authentication_enable_default.yml b/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_113_enable_aaa_authentication_enable_default.yml deleted file mode 100755 index 590534b9..00000000 --- a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_113_enable_aaa_authentication_enable_default.yml +++ /dev/null @@ -1,25 +0,0 @@ -defaults: - devices: - - platform: cisco_xe - -tests: - rule_113_enable_aaa_authentication_enable_default: - - devices: - - platform: cisco_ios - - platform: cisco_xe - outcome: OK - - - outcome: TESTS_FAILED - configuration: | - hostname not-interesting - aaa authentication - - outcome: OK - configuration: | - aaa authentication enable - - - outcome: NO_TESTS_COLLECTED - devices: - - platform: juniper_junos - - outcome: OK - devices: - - platform: cisco_ios diff --git a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_114_set_login_authentication_for_line_vty.yml b/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_114_set_login_authentication_for_line_vty.yml deleted file mode 100755 index 231d9a7f..00000000 --- a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_114_set_login_authentication_for_line_vty.yml +++ /dev/null @@ -1,20 +0,0 @@ -defaults: - devices: - - ipaddress: 192.168.1.1 - platform: cisco_xe - tenant: default - -tests: - rule_114_set_login_authentication_for_line_vty: - - outcome: OK - commands: - show running-config | sec line con: login authentication default - - outcome: OK - commands: - show running-config | sec line vty: login authentication aaa_list_name - - outcome: TESTS_FAILED - commands: - show running-config | sec line con: authentication - - outcome: TESTS_FAILED - commands: - show running-config | sec line vty: login diff --git a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_115_set_login_authentication_for_ip_http.yml b/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_115_set_login_authentication_for_ip_http.yml deleted file mode 100755 index 34688aea..00000000 --- a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_115_set_login_authentication_for_ip_http.yml +++ /dev/null @@ -1,21 +0,0 @@ -defaults: - devices: - - platform: cisco_xe - -tests: - rule_115_set_login_authentication_for_ip_http: - - outcome: TESTS_FAILED - configuration: | - hostname not-interesting - no aaa new-model - - outcome: OK - configuration: | - aaa new-model - - outcome: OK - configuration: | - no aab new-model - - - outcome: NO_TESTS_COLLECTED - devices: - - platform: juniperOS - ipaddress: 19 diff --git a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_116_set_aaa_accounting_to_log_all_privileged_use_commands.yml b/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_116_set_aaa_accounting_to_log_all_privileged_use_commands.yml deleted file mode 100755 index 2fa4ed47..00000000 --- a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_116_set_aaa_accounting_to_log_all_privileged_use_commands.yml +++ /dev/null @@ -1,21 +0,0 @@ -defaults: - devices: - - platform: cisco_xe - -tests: - rule_116_set_aaa_accounting_to_log_all_privileged_use_commands: - - outcome: TESTS_FAILED - configuration: | - hostname not-interesting - no aaa new-model - - outcome: OK - configuration: | - aaa new-model - - outcome: OK - configuration: | - no aab new-model - - - outcome: NO_TESTS_COLLECTED - devices: - - platform: juniperOS - ipaddress: 19 diff --git a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_117_set_aaa_accounting_connection.yml b/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_117_set_aaa_accounting_connection.yml deleted file mode 100755 index 561183c4..00000000 --- a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_117_set_aaa_accounting_connection.yml +++ /dev/null @@ -1,21 +0,0 @@ -defaults: - devices: - - platform: cisco_xe - -tests: - rule_117_set_aaa_accounting_connection: - - outcome: TESTS_FAILED - configuration: | - hostname not-interesting - no aaa new-model - - outcome: OK - configuration: | - aaa new-model - - outcome: OK - configuration: | - no aab new-model - - - outcome: NO_TESTS_COLLECTED - devices: - - platform: juniperOS - ipaddress: 19 diff --git a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_118_set_aaa_accounting_exec.yml b/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_118_set_aaa_accounting_exec.yml deleted file mode 100755 index aa8b79cd..00000000 --- a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_118_set_aaa_accounting_exec.yml +++ /dev/null @@ -1,21 +0,0 @@ -defaults: - devices: - - platform: cisco_xe - -tests: - rule_118_set_aaa_accounting_exec: - - outcome: TESTS_FAILED - configuration: | - hostname not-interesting - no aaa new-model - - outcome: OK - configuration: | - aaa new-model - - outcome: OK - configuration: | - no aab new-model - - - outcome: NO_TESTS_COLLECTED - devices: - - platform: juniperOS - ipaddress: 19 diff --git a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_119_set_aaa_accounting_network.yml b/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_119_set_aaa_accounting_network.yml deleted file mode 100755 index 7a359913..00000000 --- a/tests/CIS/cisco_ios/11_local_authentication_authorization_and_accounting_rules/rule_119_set_aaa_accounting_network.yml +++ /dev/null @@ -1,21 +0,0 @@ -defaults: - devices: - - platform: cisco_xe - -tests: - rule_119_set_aaa_accounting_network: - - outcome: TESTS_FAILED - configuration: | - hostname not-interesting - no aaa new-model - - outcome: OK - configuration: | - aaa new-model - - outcome: OK - configuration: | - no aab new-model - - - outcome: NO_TESTS_COLLECTED - devices: - - platform: juniperOS - ipaddress: 19