troubadix 25.6.0__tar.gz → 25.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {troubadix-25.6.0 → troubadix-25.7.0}/PKG-INFO +1 -1
- {troubadix-25.6.0 → troubadix-25.7.0}/pyproject.toml +3 -2
- troubadix-25.7.0/tests/helper/test_date_format.py +140 -0
- troubadix-25.7.0/tests/plugins/test_creation_date.py +129 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_cvss_format.py +3 -3
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_tags_mandatory.py +6 -4
- troubadix-25.7.0/tests/plugins/test_severity_date.py +87 -0
- troubadix-25.7.0/tests/plugins/test_severity_format.py +148 -0
- troubadix-25.7.0/tests/plugins/test_severity_origin.py +94 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_vt_file_permissions.py +2 -0
- troubadix-25.7.0/tests/standalone_plugins/test_changed_creation_date.py +173 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/test_changed_oid.py +4 -21
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/__version__.py +1 -1
- troubadix-25.7.0/troubadix/helper/date_format.py +93 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/helper/patterns.py +17 -2
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/__init__.py +6 -0
- troubadix-25.7.0/troubadix/plugins/creation_date.py +74 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/cvss_format.py +4 -15
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_tags_mandatory.py +6 -1
- troubadix-25.7.0/troubadix/plugins/severity_date.py +53 -0
- troubadix-25.7.0/troubadix/plugins/severity_format.py +33 -0
- troubadix-25.7.0/troubadix/plugins/severity_origin.py +33 -0
- troubadix-25.7.0/troubadix/standalone_plugins/changed_creation_date.py +141 -0
- troubadix-25.7.0/troubadix/standalone_plugins/util.py +27 -0
- troubadix-25.6.0/tests/plugins/test_creation_date.py +0 -258
- troubadix-25.6.0/troubadix/plugins/creation_date.py +0 -110
- {troubadix-25.6.0 → troubadix-25.7.0}/LICENSE +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/README.md +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/helper/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/helper/test_linguistic_exception_handler.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/helper/test_patterns.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/fail.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/fail2.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_badwords.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_copyright_text.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_copyright_year.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_cve_format.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_dependencies.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_dependency_category_order.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_deprecated_dependency.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_deprecated_functions.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_double_end_points.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_duplicate_oid.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_duplicated_script_tags.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_encoding.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/fail_bad_new_line.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/fail_badwords.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/fail_name_and_copyright_newline.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/fail_name_newline.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/fail_permissions.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/fail_spelling.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/fail.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/fail_badwords.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/fail_name_and_copyright_newline.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/fail_name_newline.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/fail_solution_template.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/runner/fail.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/runner/fail2.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/runner/test.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/runner/test_valid_oid.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/test.inc +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/21.04/test.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/nasl/warning.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/ok_permissions.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_files/test_oid.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_forking_nasl_functions.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_get_kb_on_services.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_grammar.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_http_links_in_tags.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_illegal_characters.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_log_messages.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_malformed_dependencies.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_misplaced_compare_in_if.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_missing_desc_exit.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_missing_tag_solution.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_multiple_re_parameters.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_newlines.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_overlong_description_lines.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_overlong_script_tags.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_prod_svc_detect_in_vulnvt.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_qod.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_reporting_consistency.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_add_preference_type.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_calls_empty_values.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_calls_recommended.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_category.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_copyright.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_family.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_tag_form.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_tag_whitespaces.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_version_and_last_modification_tags.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_xref_form.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_script_xref_url.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_security_messages.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_set_get_kb_calls.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_solution_text.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_solution_type.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_spaces_before_dots.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_spaces_in_filename.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_spelling.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_tabs.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_todo_tbd.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_trailing_spaces_tabs.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_using_display.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_valid_oid.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_valid_script_tag_names.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_variable_redefinition_in_foreach.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/plugins/test_vt_placement.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/changed_packages/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/changed_packages/markers/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/changed_packages/markers/test_added_epoch.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/changed_packages/markers/test_added_release.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/changed_packages/markers/test_added_udeb.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/changed_packages/markers/test_changed_update.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/changed_packages/markers/test_dropped_architecture.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/changed_packages/test_changed_packages.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/changed_packages/test_package.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/nasl/21.04/21_script.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/nasl/22.04/22_script.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/nasl/common/bar.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/nasl/common/foo.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/nasl/common/foobar.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/nasl/common/gsf/enterprise_script.nasl +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/test_changed_cves.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/test_dependency_graph.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/test_deprecate_vts.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/test_file_extensions.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/test_last_modification.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/test_no_solution.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/standalone_plugins/test_version_updated.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/test_argparser.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/test_helper.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/test_naslinter.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/test_reporter.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/test_results.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/tests/test_runner.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/argparser.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/codespell/codespell.additions +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/codespell/codespell.exclude +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/codespell/codespell.ignore +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/helper/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/helper/helper.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/helper/linguistic_exception_handler.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugin.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/badwords.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/copyright_text.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/copyright_year.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/cve_format.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/dependencies.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/dependency_category_order.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/deprecated_dependency.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/deprecated_functions.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/double_end_points.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/duplicate_oid.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/duplicated_script_tags.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/encoding.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/forking_nasl_functions.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/get_kb_on_services.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/grammar.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/http_links_in_tags.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/illegal_characters.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/log_messages.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/malformed_dependencies.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/misplaced_compare_in_if.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/missing_desc_exit.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/missing_tag_solution.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/multiple_re_parameters.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/newlines.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/overlong_description_lines.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/overlong_script_tags.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/prod_svc_detect_in_vulnvt.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/qod.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/reporting_consistency.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_add_preference_type.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_calls_empty_values.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_calls_recommended.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_category.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_copyright.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_family.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_tag_form.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_tag_whitespaces.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_version_and_last_modification_tags.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_xref_form.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/script_xref_url.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/security_messages.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/set_get_kb_calls.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/solution_text.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/solution_type.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/spaces_before_dots.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/spaces_in_filename.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/spelling.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/tabs.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/todo_tbd.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/trailing_spaces_tabs.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/using_display.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/valid_oid.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/valid_script_tag_names.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/variable_assigned_in_if.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/variable_redefinition_in_foreach.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/vt_file_permissions.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/plugins/vt_placement.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/reporter.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/results.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/runner.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/allowed_rev_diff.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_cves.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_oid.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_packages/changed_packages.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_packages/marker/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_packages/marker/added_epoch.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_packages/marker/added_release.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_packages/marker/added_udeb.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_packages/marker/changed_update.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_packages/marker/dropped_architecture.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_packages/marker/marker.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/changed_packages/package.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/common.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/dependency_graph/__init__.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/dependency_graph/checks.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/dependency_graph/cli.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/dependency_graph/dependency_graph.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/dependency_graph/models.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/deprecate_vts.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/file_extensions.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/last_modification.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/no_solution.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/standalone_plugins/version_updated.py +0 -0
- {troubadix-25.6.0 → troubadix-25.7.0}/troubadix/troubadix.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "troubadix"
|
|
3
|
-
version = "25.
|
|
3
|
+
version = "25.7.0"
|
|
4
4
|
description = "A linting and QA check tool for NASL files"
|
|
5
5
|
authors = ["Greenbone <info@greenbone.net>"]
|
|
6
6
|
license = "GPL-3.0-or-later"
|
|
@@ -37,7 +37,7 @@ networkx = "^3.4.2"
|
|
|
37
37
|
[tool.poetry.group.dev.dependencies]
|
|
38
38
|
autohooks = ">=21.7.0"
|
|
39
39
|
autohooks-plugin-black = ">=21.12.0"
|
|
40
|
-
ruff = ">=0.5.6,<0.
|
|
40
|
+
ruff = ">=0.5.6,<0.13.0"
|
|
41
41
|
autohooks-plugin-ruff = ">=24.1,<26.0"
|
|
42
42
|
|
|
43
43
|
[tool.black]
|
|
@@ -73,6 +73,7 @@ version-module-file = "troubadix/__version__.py"
|
|
|
73
73
|
|
|
74
74
|
[tool.poetry.scripts]
|
|
75
75
|
troubadix = 'troubadix.troubadix:main'
|
|
76
|
+
troubadix-changed-creation-date = 'troubadix.standalone_plugins.changed_creation_date:main'
|
|
76
77
|
troubadix-changed-oid = 'troubadix.standalone_plugins.changed_oid:main'
|
|
77
78
|
troubadix-last-modification = 'troubadix.standalone_plugins.last_modification:main'
|
|
78
79
|
troubadix-version-updated = 'troubadix.standalone_plugins.version_updated:main'
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 Greenbone AG
|
|
3
|
+
|
|
4
|
+
from unittest import TestCase
|
|
5
|
+
|
|
6
|
+
from troubadix.helper.date_format import check_date
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class CheckCreationDateTestCase(TestCase):
|
|
10
|
+
|
|
11
|
+
def test_ok(self):
|
|
12
|
+
results = list(
|
|
13
|
+
check_date(
|
|
14
|
+
"2013-05-14 11:24:55 +0200 (Tue, 14 May 2013)",
|
|
15
|
+
"test_date",
|
|
16
|
+
"test_file",
|
|
17
|
+
"test_plugin",
|
|
18
|
+
)
|
|
19
|
+
)
|
|
20
|
+
self.assertEqual(results, [])
|
|
21
|
+
|
|
22
|
+
def test_missing(self):
|
|
23
|
+
results = list(
|
|
24
|
+
check_date(
|
|
25
|
+
None,
|
|
26
|
+
"test_date",
|
|
27
|
+
"test_file",
|
|
28
|
+
"test_plugin",
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
self.assertEqual(len(results), 1)
|
|
32
|
+
self.assertEqual(
|
|
33
|
+
"No test_date has been found.",
|
|
34
|
+
results[0].message,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
def test_wrong_weekday(self):
|
|
38
|
+
results = list(
|
|
39
|
+
check_date(
|
|
40
|
+
"2013-05-14 11:24:55 +0200 (Mon, 14 May 2013)",
|
|
41
|
+
"test_date",
|
|
42
|
+
"test_file",
|
|
43
|
+
"test_plugin",
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
self.assertEqual(len(results), 1)
|
|
47
|
+
self.assertEqual(
|
|
48
|
+
"Wrong day of week. Please change it from 'Mon' to 'Tue'.",
|
|
49
|
+
results[0].message,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
def test_no_timezone(self):
|
|
53
|
+
results = list(
|
|
54
|
+
check_date(
|
|
55
|
+
"2013-05-14 11:24:55 (Tue, 14 May 2013)",
|
|
56
|
+
"test_date",
|
|
57
|
+
"test_file",
|
|
58
|
+
"test_plugin",
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
self.assertEqual(len(results), 1)
|
|
62
|
+
self.assertEqual(
|
|
63
|
+
"Missing or incorrectly formatted test_date.",
|
|
64
|
+
results[0].message,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
def test_different_dates(self):
|
|
68
|
+
results = list(
|
|
69
|
+
check_date(
|
|
70
|
+
"2013-05-14 11:24:55 +0200 (Wed, 15 May 2013)",
|
|
71
|
+
"test_date",
|
|
72
|
+
"test_file",
|
|
73
|
+
"test_plugin",
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
self.assertEqual(len(results), 1)
|
|
77
|
+
self.assertEqual(
|
|
78
|
+
"The test_date consists of two different dates.",
|
|
79
|
+
results[0].message,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
def test_wrong_length(self):
|
|
83
|
+
results = list(
|
|
84
|
+
check_date(
|
|
85
|
+
"2013-05-14 11:24:55 +0200 (Wed, 15 May 2013) ",
|
|
86
|
+
"test_date",
|
|
87
|
+
"test_file",
|
|
88
|
+
"test_plugin",
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
self.assertEqual(len(results), 1)
|
|
92
|
+
self.assertEqual(
|
|
93
|
+
"The test_date consists of two different dates.",
|
|
94
|
+
results[0].message,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
def test_malformed_second(self):
|
|
98
|
+
results = list(
|
|
99
|
+
check_date(
|
|
100
|
+
"2013-05-14 11:24:55s +0200 (Tue, 14 May 2013)",
|
|
101
|
+
"test_date",
|
|
102
|
+
"test_file",
|
|
103
|
+
"test_plugin",
|
|
104
|
+
)
|
|
105
|
+
)
|
|
106
|
+
self.assertEqual(len(results), 1)
|
|
107
|
+
self.assertEqual(
|
|
108
|
+
"Missing or incorrectly formatted test_date.",
|
|
109
|
+
results[0].message,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
def test_malformed_hour(self):
|
|
113
|
+
results = list(
|
|
114
|
+
check_date(
|
|
115
|
+
"2013-05-14 111:24:55 +0200 (Tue, 14 May 2013)",
|
|
116
|
+
"test_date",
|
|
117
|
+
"test_file",
|
|
118
|
+
"test_plugin",
|
|
119
|
+
)
|
|
120
|
+
)
|
|
121
|
+
self.assertEqual(len(results), 1)
|
|
122
|
+
self.assertEqual(
|
|
123
|
+
"Missing or incorrectly formatted test_date.",
|
|
124
|
+
results[0].message,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
def test_malformed_day(self):
|
|
128
|
+
results = list(
|
|
129
|
+
check_date(
|
|
130
|
+
"2013-05-14d 11:24:55 +0200 (Tue, 14 May 2013)",
|
|
131
|
+
"test_date",
|
|
132
|
+
"test_file",
|
|
133
|
+
"test_plugin",
|
|
134
|
+
)
|
|
135
|
+
)
|
|
136
|
+
self.assertEqual(len(results), 1)
|
|
137
|
+
self.assertEqual(
|
|
138
|
+
"Missing or incorrectly formatted test_date.",
|
|
139
|
+
results[0].message,
|
|
140
|
+
)
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Copyright (C) 2021 Greenbone AG
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
4
|
+
#
|
|
5
|
+
# This program is free software: you can redistribute it and/or modify
|
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
# (at your option) any later version.
|
|
9
|
+
#
|
|
10
|
+
# This program is distributed in the hope that it will be useful,
|
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
# GNU General Public License for more details.
|
|
14
|
+
#
|
|
15
|
+
# You should have received a copy of the GNU General Public License
|
|
16
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
from troubadix.plugin import LinterError
|
|
21
|
+
from troubadix.plugins.creation_date import CheckCreationDate
|
|
22
|
+
|
|
23
|
+
from . import PluginTestCase
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class CheckCreationDateTestCase(PluginTestCase):
|
|
27
|
+
|
|
28
|
+
def test_ok(self):
|
|
29
|
+
path = Path("some/file.nasl")
|
|
30
|
+
content = (
|
|
31
|
+
' script_tag(name:"creation_date", value:"2013-05-14 11:24:55 '
|
|
32
|
+
'+0200 (Tue, 14 May 2013)");\n'
|
|
33
|
+
)
|
|
34
|
+
fake_context = self.create_file_plugin_context(
|
|
35
|
+
nasl_file=path, file_content=content
|
|
36
|
+
)
|
|
37
|
+
plugin = CheckCreationDate(fake_context)
|
|
38
|
+
|
|
39
|
+
results = list(plugin.run())
|
|
40
|
+
self.assertEqual(len(results), 0)
|
|
41
|
+
|
|
42
|
+
def test_exclude_inc_file(self):
|
|
43
|
+
path = Path("some/file.inc")
|
|
44
|
+
fake_context = self.create_file_plugin_context(nasl_file=path)
|
|
45
|
+
plugin = CheckCreationDate(fake_context)
|
|
46
|
+
|
|
47
|
+
results = list(plugin.run())
|
|
48
|
+
|
|
49
|
+
self.assertEqual(len(results), 0)
|
|
50
|
+
|
|
51
|
+
def test_missing_creation_date(self):
|
|
52
|
+
path = Path("some/file.nasl")
|
|
53
|
+
content = (
|
|
54
|
+
' script_tag(name:"cvss_base", value:"7.5");\n'
|
|
55
|
+
' script_tag(name:"cvss_base_vector", '
|
|
56
|
+
'value:"AV:N/AC:L/Au:N/C:P/I:P/A:P");\n'
|
|
57
|
+
)
|
|
58
|
+
fake_context = self.create_file_plugin_context(
|
|
59
|
+
nasl_file=path, file_content=content
|
|
60
|
+
)
|
|
61
|
+
plugin = CheckCreationDate(fake_context)
|
|
62
|
+
|
|
63
|
+
results = list(plugin.run())
|
|
64
|
+
|
|
65
|
+
self.assertEqual(len(results), 1)
|
|
66
|
+
|
|
67
|
+
self.assertIsInstance(results[0], LinterError)
|
|
68
|
+
self.assertEqual(
|
|
69
|
+
"No creation_date has been found.",
|
|
70
|
+
results[0].message,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
def test_missing_last_modification_date(self):
|
|
74
|
+
path = Path("some/file.nasl")
|
|
75
|
+
content = (
|
|
76
|
+
' script_tag(name:"creation_date", value:"2013-05-14 11:24:55 '
|
|
77
|
+
'+0200 (Tue, 14 May 2013)");\n'
|
|
78
|
+
' script_tag(name:"cvss_base", value:"7.5");\n'
|
|
79
|
+
' script_tag(name:"cvss_base_vector", '
|
|
80
|
+
'value:"AV:N/AC:L/Au:N/C:P/I:P/A:P");\n'
|
|
81
|
+
)
|
|
82
|
+
fake_context = self.create_file_plugin_context(
|
|
83
|
+
nasl_file=path, file_content=content
|
|
84
|
+
)
|
|
85
|
+
plugin = CheckCreationDate(fake_context)
|
|
86
|
+
|
|
87
|
+
results = list(plugin.run())
|
|
88
|
+
|
|
89
|
+
self.assertEqual(results, [])
|
|
90
|
+
|
|
91
|
+
def test_creation_date_greater_than_last_modification(self):
|
|
92
|
+
path = Path("some/file.nasl")
|
|
93
|
+
content = (
|
|
94
|
+
' script_tag(name:"creation_date", value:"2025-01-01 00:00:01 '
|
|
95
|
+
'+0200 (Wed, 01 Jan 2025)");\n'
|
|
96
|
+
' script_tag(name:"last_modification", value:"2025-01-01 00:00:00 '
|
|
97
|
+
'+0200 (Wed, 01 Jan 2025)");\n'
|
|
98
|
+
)
|
|
99
|
+
fake_context = self.create_file_plugin_context(
|
|
100
|
+
nasl_file=path, file_content=content
|
|
101
|
+
)
|
|
102
|
+
plugin = CheckCreationDate(fake_context)
|
|
103
|
+
|
|
104
|
+
results = list(plugin.run())
|
|
105
|
+
|
|
106
|
+
self.assertEqual(len(results), 1)
|
|
107
|
+
|
|
108
|
+
self.assertIsInstance(results[0], LinterError)
|
|
109
|
+
self.assertEqual(
|
|
110
|
+
"The creation_date must not be greater than last_modification date.",
|
|
111
|
+
results[0].message,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
def test_creation_date_equal_last_modification(self):
|
|
115
|
+
path = Path("some/file.nasl")
|
|
116
|
+
content = (
|
|
117
|
+
' script_tag(name:"creation_date", value:"2025-01-01 00:00:00 '
|
|
118
|
+
'+0200 (Wed, 01 Jan 2025)");\n'
|
|
119
|
+
' script_tag(name:"last_modification", value:"2025-01-01 00:00:00 '
|
|
120
|
+
'+0200 (Wed, 01 Jan 2025)");\n'
|
|
121
|
+
)
|
|
122
|
+
fake_context = self.create_file_plugin_context(
|
|
123
|
+
nasl_file=path, file_content=content
|
|
124
|
+
)
|
|
125
|
+
plugin = CheckCreationDate(fake_context)
|
|
126
|
+
|
|
127
|
+
results = list(plugin.run())
|
|
128
|
+
|
|
129
|
+
self.assertEqual(len(results), 0)
|
|
@@ -66,7 +66,7 @@ class CheckCVSSFormatTestCase(PluginTestCase):
|
|
|
66
66
|
self.assertEqual(len(results), 1)
|
|
67
67
|
self.assertIsInstance(results[0], LinterError)
|
|
68
68
|
self.assertEqual(
|
|
69
|
-
"VT has
|
|
69
|
+
"VT has a missing or invalid cvss_base value.",
|
|
70
70
|
results[0].message,
|
|
71
71
|
)
|
|
72
72
|
|
|
@@ -86,7 +86,7 @@ class CheckCVSSFormatTestCase(PluginTestCase):
|
|
|
86
86
|
self.assertEqual(len(results), 1)
|
|
87
87
|
self.assertIsInstance(results[0], LinterError)
|
|
88
88
|
self.assertEqual(
|
|
89
|
-
"VT has
|
|
89
|
+
"VT has a missing or invalid cvss_base value.",
|
|
90
90
|
results[0].message,
|
|
91
91
|
)
|
|
92
92
|
|
|
@@ -145,6 +145,6 @@ class CheckCVSSFormatTestCase(PluginTestCase):
|
|
|
145
145
|
self.assertEqual(len(results), 1)
|
|
146
146
|
|
|
147
147
|
self.assertEqual(
|
|
148
|
-
"VT has a missing cvss_base value.",
|
|
148
|
+
"VT has a missing or invalid cvss_base value.",
|
|
149
149
|
results[0].message,
|
|
150
150
|
)
|
|
@@ -27,12 +27,14 @@ class CheckScriptTagsMandatoryTestCase(PluginTestCase):
|
|
|
27
27
|
|
|
28
28
|
def test_ok(self):
|
|
29
29
|
content = (
|
|
30
|
-
|
|
30
|
+
' script_name("foo");\n'
|
|
31
31
|
" script_version(1234-56-78T90:98:76+5432);\n"
|
|
32
32
|
" script_category(ACT_INIT);\n"
|
|
33
33
|
" script_family(FAMILY);\n"
|
|
34
34
|
' script_copyright("COPYRIGHT");\n'
|
|
35
35
|
' script_tag(name:"summary", value:"foo");\n'
|
|
36
|
+
' script_tag(name:"cvss_base", value:"10.0");\n'
|
|
37
|
+
' script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:C/I:C/A:C");\n'
|
|
36
38
|
)
|
|
37
39
|
fake_context = self.create_file_plugin_context(
|
|
38
40
|
nasl_file=self.path, file_content=content
|
|
@@ -61,7 +63,7 @@ class CheckScriptTagsMandatoryTestCase(PluginTestCase):
|
|
|
61
63
|
|
|
62
64
|
results = list(plugin.run())
|
|
63
65
|
|
|
64
|
-
self.assertEqual(len(results),
|
|
66
|
+
self.assertEqual(len(results), 8)
|
|
65
67
|
self.assertIsInstance(results[0], LinterError)
|
|
66
68
|
|
|
67
69
|
def test_missing_tags(self):
|
|
@@ -79,7 +81,7 @@ class CheckScriptTagsMandatoryTestCase(PluginTestCase):
|
|
|
79
81
|
|
|
80
82
|
results = list(plugin.run())
|
|
81
83
|
|
|
82
|
-
self.assertEqual(len(results),
|
|
84
|
+
self.assertEqual(len(results), 3)
|
|
83
85
|
self.assertIsInstance(results[0], LinterError)
|
|
84
86
|
|
|
85
87
|
def test_missing_calls(self):
|
|
@@ -91,5 +93,5 @@ class CheckScriptTagsMandatoryTestCase(PluginTestCase):
|
|
|
91
93
|
|
|
92
94
|
results = list(plugin.run())
|
|
93
95
|
|
|
94
|
-
self.assertEqual(len(results),
|
|
96
|
+
self.assertEqual(len(results), 7)
|
|
95
97
|
self.assertIsInstance(results[0], LinterError)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 Greenbone AG
|
|
3
|
+
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from troubadix.plugin import LinterError
|
|
7
|
+
from troubadix.plugins.severity_date import CheckSeverityDate
|
|
8
|
+
|
|
9
|
+
from . import PluginTestCase
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CheckSeverityDateTestCase(PluginTestCase):
|
|
13
|
+
|
|
14
|
+
def test_severity_date_ok(self):
|
|
15
|
+
path = Path("some/file.nasl")
|
|
16
|
+
content = (
|
|
17
|
+
' script_tag(name:"severity_date", value:"2013-05-14 11:24:55 '
|
|
18
|
+
'+0200 (Tue, 14 May 2013)");\n'
|
|
19
|
+
)
|
|
20
|
+
fake_context = self.create_file_plugin_context(
|
|
21
|
+
nasl_file=path, file_content=content
|
|
22
|
+
)
|
|
23
|
+
plugin = CheckSeverityDate(fake_context)
|
|
24
|
+
|
|
25
|
+
results = list(plugin.run())
|
|
26
|
+
self.assertEqual(len(results), 0)
|
|
27
|
+
|
|
28
|
+
def test_exclude_inc_file(self):
|
|
29
|
+
path = Path("some/file.inc")
|
|
30
|
+
fake_context = self.create_file_plugin_context(nasl_file=path)
|
|
31
|
+
plugin = CheckSeverityDate(fake_context)
|
|
32
|
+
|
|
33
|
+
results = list(plugin.run())
|
|
34
|
+
|
|
35
|
+
self.assertEqual(len(results), 0)
|
|
36
|
+
|
|
37
|
+
def test_missing_severity_date(self):
|
|
38
|
+
path = Path("some/file.nasl")
|
|
39
|
+
content = ""
|
|
40
|
+
fake_context = self.create_file_plugin_context(
|
|
41
|
+
nasl_file=path, file_content=content
|
|
42
|
+
)
|
|
43
|
+
plugin = CheckSeverityDate(fake_context)
|
|
44
|
+
|
|
45
|
+
results = list(plugin.run())
|
|
46
|
+
|
|
47
|
+
self.assertEqual(len(results), 0)
|
|
48
|
+
|
|
49
|
+
def test_severity_date_greater_than_last_modification(self):
|
|
50
|
+
path = Path("some/file.nasl")
|
|
51
|
+
content = (
|
|
52
|
+
' script_tag(name:"severity_date", value:"2025-01-01 00:00:01 '
|
|
53
|
+
'+0200 (Wed, 01 Jan 2025)");\n'
|
|
54
|
+
' script_tag(name:"last_modification", value:"2025-01-01 00:00:00 '
|
|
55
|
+
'+0200 (Wed, 01 Jan 2025)");\n'
|
|
56
|
+
)
|
|
57
|
+
fake_context = self.create_file_plugin_context(
|
|
58
|
+
nasl_file=path, file_content=content
|
|
59
|
+
)
|
|
60
|
+
plugin = CheckSeverityDate(fake_context)
|
|
61
|
+
|
|
62
|
+
results = list(plugin.run())
|
|
63
|
+
|
|
64
|
+
self.assertEqual(len(results), 1)
|
|
65
|
+
|
|
66
|
+
self.assertIsInstance(results[0], LinterError)
|
|
67
|
+
self.assertEqual(
|
|
68
|
+
"The severity_date must not be greater than last_modification date.",
|
|
69
|
+
results[0].message,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
def test_severity_date_equal_last_modification(self):
|
|
73
|
+
path = Path("some/file.nasl")
|
|
74
|
+
content = (
|
|
75
|
+
' script_tag(name:"severity_date", value:"2025-01-01 00:00:00 '
|
|
76
|
+
'+0200 (Wed, 01 Jan 2025)");\n'
|
|
77
|
+
' script_tag(name:"last_modification", value:"2025-01-01 00:00:00 '
|
|
78
|
+
'+0200 (Wed, 01 Jan 2025)");\n'
|
|
79
|
+
)
|
|
80
|
+
fake_context = self.create_file_plugin_context(
|
|
81
|
+
nasl_file=path, file_content=content
|
|
82
|
+
)
|
|
83
|
+
plugin = CheckSeverityDate(fake_context)
|
|
84
|
+
|
|
85
|
+
results = list(plugin.run())
|
|
86
|
+
|
|
87
|
+
self.assertEqual(len(results), 0)
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
# SPDX-FileCopyrightText: 2025 Greenbone AG
|
|
3
|
+
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from troubadix.plugin import LinterError
|
|
7
|
+
from troubadix.plugins.severity_format import CheckSeverityFormat
|
|
8
|
+
|
|
9
|
+
from . import PluginTestCase
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CheckSeverityFormatTestCase(PluginTestCase):
|
|
13
|
+
|
|
14
|
+
def test_cvss_3_0_vector_ok(self):
|
|
15
|
+
path = Path("some/file.nasl")
|
|
16
|
+
content = (
|
|
17
|
+
' script_tag(name:"severity_vector", '
|
|
18
|
+
'value:"CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H");\n'
|
|
19
|
+
)
|
|
20
|
+
fake_context = self.create_file_plugin_context(
|
|
21
|
+
nasl_file=path, file_content=content
|
|
22
|
+
)
|
|
23
|
+
plugin = CheckSeverityFormat(fake_context)
|
|
24
|
+
|
|
25
|
+
results = list(plugin.run())
|
|
26
|
+
|
|
27
|
+
self.assertEqual(results, [])
|
|
28
|
+
|
|
29
|
+
def test_invalid_cvss_3_0_vector(self):
|
|
30
|
+
path = Path("some/file.nasl")
|
|
31
|
+
content = (
|
|
32
|
+
' script_tag(name:"severity_vector", '
|
|
33
|
+
'value:"CVSS:3.0/AV:N/AC:N/PR:L/UI:R/S:H/C:H/I:H/A:H");\n'
|
|
34
|
+
)
|
|
35
|
+
fake_context = self.create_file_plugin_context(
|
|
36
|
+
nasl_file=path, file_content=content
|
|
37
|
+
)
|
|
38
|
+
plugin = CheckSeverityFormat(fake_context)
|
|
39
|
+
|
|
40
|
+
results = list(plugin.run())
|
|
41
|
+
|
|
42
|
+
self.assertEqual(len(results), 1)
|
|
43
|
+
self.assertIsInstance(results[0], LinterError)
|
|
44
|
+
self.assertEqual(
|
|
45
|
+
"VT has an invalid severity_vector value.",
|
|
46
|
+
results[0].message,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
def test_cvss_3_1_vector_ok(self):
|
|
50
|
+
path = Path("some/file.nasl")
|
|
51
|
+
content = (
|
|
52
|
+
' script_tag(name:"severity_vector", '
|
|
53
|
+
'value:"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H");\n'
|
|
54
|
+
)
|
|
55
|
+
fake_context = self.create_file_plugin_context(
|
|
56
|
+
nasl_file=path, file_content=content
|
|
57
|
+
)
|
|
58
|
+
plugin = CheckSeverityFormat(fake_context)
|
|
59
|
+
|
|
60
|
+
results = list(plugin.run())
|
|
61
|
+
|
|
62
|
+
self.assertEqual(results, [])
|
|
63
|
+
|
|
64
|
+
def test_invalid_cvss_3_1_vector(self):
|
|
65
|
+
path = Path("some/file.nasl")
|
|
66
|
+
content = (
|
|
67
|
+
' script_tag(name:"severity_vector", '
|
|
68
|
+
'value:"CVSS:3.1/AV:N/AC:N/PR:L/UI:R/S:H/C:H/I:H/A:H");\n'
|
|
69
|
+
)
|
|
70
|
+
fake_context = self.create_file_plugin_context(
|
|
71
|
+
nasl_file=path, file_content=content
|
|
72
|
+
)
|
|
73
|
+
plugin = CheckSeverityFormat(fake_context)
|
|
74
|
+
|
|
75
|
+
results = list(plugin.run())
|
|
76
|
+
|
|
77
|
+
self.assertEqual(len(results), 1)
|
|
78
|
+
self.assertIsInstance(results[0], LinterError)
|
|
79
|
+
self.assertEqual(
|
|
80
|
+
"VT has an invalid severity_vector value.",
|
|
81
|
+
results[0].message,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
def test_cvss_4_0_vector_ok(self):
|
|
85
|
+
path = Path("some/file.nasl")
|
|
86
|
+
content = (
|
|
87
|
+
' script_tag(name:"severity_vector", '
|
|
88
|
+
'value:"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A'
|
|
89
|
+
'/VC:H/VI:H/VA:H/SC:L/SI:L/SA:N");\n'
|
|
90
|
+
)
|
|
91
|
+
fake_context = self.create_file_plugin_context(
|
|
92
|
+
nasl_file=path, file_content=content
|
|
93
|
+
)
|
|
94
|
+
plugin = CheckSeverityFormat(fake_context)
|
|
95
|
+
|
|
96
|
+
results = list(plugin.run())
|
|
97
|
+
|
|
98
|
+
self.assertEqual(results, [])
|
|
99
|
+
|
|
100
|
+
def test_invalid_cvss_4_0_vector(self):
|
|
101
|
+
path = Path("some/file.nasl")
|
|
102
|
+
content = (
|
|
103
|
+
' script_tag(name:"severity_vector", '
|
|
104
|
+
'value:"CVSS:4.0/AV:N/AC:N/AT:N/PR:L/UI:N'
|
|
105
|
+
'/VC:H/VI:H/VA:H/SC:L/SI:L/SA:N");\n'
|
|
106
|
+
)
|
|
107
|
+
fake_context = self.create_file_plugin_context(
|
|
108
|
+
nasl_file=path, file_content=content
|
|
109
|
+
)
|
|
110
|
+
plugin = CheckSeverityFormat(fake_context)
|
|
111
|
+
|
|
112
|
+
results = list(plugin.run())
|
|
113
|
+
|
|
114
|
+
self.assertEqual(len(results), 1)
|
|
115
|
+
self.assertIsInstance(results[0], LinterError)
|
|
116
|
+
self.assertEqual(
|
|
117
|
+
"VT has an invalid severity_vector value.",
|
|
118
|
+
results[0].message,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
def test_missing_severity_vector(self):
|
|
122
|
+
path = Path("some/file.nasl")
|
|
123
|
+
content = ""
|
|
124
|
+
fake_context = self.create_file_plugin_context(
|
|
125
|
+
nasl_file=path, file_content=content
|
|
126
|
+
)
|
|
127
|
+
plugin = CheckSeverityFormat(fake_context)
|
|
128
|
+
|
|
129
|
+
results = list(plugin.run())
|
|
130
|
+
|
|
131
|
+
self.assertEqual(results, [])
|
|
132
|
+
|
|
133
|
+
def test_empty_severity_vector(self):
|
|
134
|
+
path = Path("some/file.nasl")
|
|
135
|
+
content = ' script_tag(name:"severity_vector", value:"");\n'
|
|
136
|
+
fake_context = self.create_file_plugin_context(
|
|
137
|
+
nasl_file=path, file_content=content
|
|
138
|
+
)
|
|
139
|
+
plugin = CheckSeverityFormat(fake_context)
|
|
140
|
+
|
|
141
|
+
results = list(plugin.run())
|
|
142
|
+
|
|
143
|
+
self.assertEqual(len(results), 1)
|
|
144
|
+
self.assertIsInstance(results[0], LinterError)
|
|
145
|
+
self.assertEqual(
|
|
146
|
+
"VT has an invalid severity_vector value.",
|
|
147
|
+
results[0].message,
|
|
148
|
+
)
|