troubadix 24.10.0__tar.gz → 24.10.2__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-24.10.0 → troubadix-24.10.2}/PKG-INFO +3 -2
- {troubadix-24.10.0 → troubadix-24.10.2}/pyproject.toml +3 -3
- troubadix-24.10.2/tests/plugins/test_script_xref_url.py +206 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/test_deprecate_vts.py +28 -22
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/__version__.py +1 -1
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_xref_url.py +64 -4
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/deprecate_vts.py +40 -29
- troubadix-24.10.0/tests/plugins/test_script_xref_url.py +0 -87
- {troubadix-24.10.0 → troubadix-24.10.2}/LICENSE +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/README.md +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/helper/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/helper/test_linguistic_exception_handler.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/helper/test_patterns.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/fail.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/fail2.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_badwords.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_copyright_text.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_copyright_year.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_creation_date.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_cve_format.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_cvss_format.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_dependencies.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_dependency_category_order.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_deprecated_dependency.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_deprecated_functions.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_double_end_points.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_duplicate_oid.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_duplicated_script_tags.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_encoding.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/fail_bad_new_line.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/fail_badwords.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/fail_name_and_copyright_newline.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/fail_name_newline.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/fail_permissions.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/fail_spelling.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/fail.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/fail_badwords.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/fail_name_and_copyright_newline.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/fail_name_newline.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/fail_solution_template.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/runner/fail.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/runner/fail2.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/runner/test.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/runner/test_valid_oid.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/test.inc +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/21.04/test.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/nasl/warning.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/ok_permissions.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_files/test_oid.nasl +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_forking_nasl_functions.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_get_kb_on_services.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_grammar.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_http_links_in_tags.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_illegal_characters.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_log_messages.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_malformed_dependencies.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_misplaced_compare_in_if.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_missing_desc_exit.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_missing_tag_solution.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_multiple_re_parameters.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_newlines.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_overlong_description_lines.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_overlong_script_tags.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_prod_svc_detect_in_vulnvt.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_qod.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_reporting_consistency.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_add_preference_type.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_calls_empty_values.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_calls_recommended.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_category.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_copyright.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_family.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_tag_form.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_tag_whitespaces.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_tags_mandatory.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_version_and_last_modification_tags.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_script_xref_form.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_security_messages.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_set_get_kb_calls.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_solution_text.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_solution_type.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_spaces_before_dots.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_spaces_in_filename.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_spelling.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_tabs.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_todo_tbd.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_trailing_spaces_tabs.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_using_display.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_valid_oid.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_valid_script_tag_names.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_variable_redefinition_in_foreach.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_vt_file_permissions.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/plugins/test_vt_placement.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/changed_packages/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/changed_packages/markers/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/changed_packages/markers/test_added_epoch.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/changed_packages/markers/test_added_release.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/changed_packages/markers/test_added_udeb.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/changed_packages/markers/test_changed_update.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/changed_packages/markers/test_dropped_architecture.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/changed_packages/test_changed_packages.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/changed_packages/test_package.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/test_changed_cves.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/test_changed_oid.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/test_file_extensions.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/test_last_modification.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/test_no_solution.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/standalone_plugins/test_version_updated.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/test_argparser.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/test_helper.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/test_naslinter.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/test_reporter.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/test_results.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/tests/test_runner.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/argparser.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/codespell/codespell.additions +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/codespell/codespell.exclude +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/codespell/codespell.ignore +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/helper/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/helper/helper.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/helper/linguistic_exception_handler.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/helper/patterns.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugin.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/badwords.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/copyright_text.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/copyright_year.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/creation_date.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/cve_format.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/cvss_format.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/dependencies.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/dependency_category_order.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/deprecated_dependency.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/deprecated_functions.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/double_end_points.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/duplicate_oid.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/duplicated_script_tags.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/encoding.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/forking_nasl_functions.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/get_kb_on_services.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/grammar.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/http_links_in_tags.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/illegal_characters.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/log_messages.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/malformed_dependencies.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/misplaced_compare_in_if.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/missing_desc_exit.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/missing_tag_solution.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/multiple_re_parameters.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/newlines.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/overlong_description_lines.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/overlong_script_tags.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/prod_svc_detect_in_vulnvt.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/qod.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/reporting_consistency.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_add_preference_type.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_calls_empty_values.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_calls_recommended.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_category.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_copyright.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_family.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_tag_form.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_tag_whitespaces.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_tags_mandatory.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_version_and_last_modification_tags.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/script_xref_form.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/security_messages.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/set_get_kb_calls.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/solution_text.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/solution_type.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/spaces_before_dots.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/spaces_in_filename.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/spelling.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/tabs.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/todo_tbd.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/trailing_spaces_tabs.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/using_display.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/valid_oid.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/valid_script_tag_names.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/variable_assigned_in_if.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/variable_redefinition_in_foreach.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/vt_file_permissions.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/plugins/vt_placement.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/reporter.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/results.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/runner.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/allowed_rev_diff.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_cves.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_oid.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_packages/changed_packages.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_packages/marker/__init__.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_packages/marker/added_epoch.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_packages/marker/added_release.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_packages/marker/added_udeb.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_packages/marker/changed_update.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_packages/marker/dropped_architecture.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_packages/marker/marker.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/changed_packages/package.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/common.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/file_extensions.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/last_modification.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/no_solution.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/standalone_plugins/version_updated.py +0 -0
- {troubadix-24.10.0 → troubadix-24.10.2}/troubadix/troubadix.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: troubadix
|
|
3
|
-
Version: 24.10.
|
|
3
|
+
Version: 24.10.2
|
|
4
4
|
Summary: A linting and QA check tool for NASL files
|
|
5
5
|
Home-page: https://github.com/greenbone/troubadix
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
21
|
Requires-Dist: chardet (>=4,<6)
|
|
21
22
|
Requires-Dist: charset-normalizer (>=3.2.0,<4.0.0)
|
|
@@ -23,7 +24,7 @@ Requires-Dist: codespell (>=2.0.0,<3.0.0)
|
|
|
23
24
|
Requires-Dist: gitpython (>=3.1.31,<4.0.0)
|
|
24
25
|
Requires-Dist: pontos (>=22.7,<25.0)
|
|
25
26
|
Requires-Dist: python-magic (>=0.4.25,<0.5.0)
|
|
26
|
-
Requires-Dist: validators (
|
|
27
|
+
Requires-Dist: validators (>=0.34.0,<0.35.0)
|
|
27
28
|
Project-URL: Repository, https://github.com/greenbone/troubadix
|
|
28
29
|
Description-Content-Type: text/markdown
|
|
29
30
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "troubadix"
|
|
3
|
-
version = "24.10.
|
|
3
|
+
version = "24.10.2"
|
|
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"
|
|
@@ -29,14 +29,14 @@ pontos = ">=22.7,<25.0"
|
|
|
29
29
|
codespell = "^2.0.0"
|
|
30
30
|
python-magic = "^0.4.25"
|
|
31
31
|
chardet = ">=4,<6"
|
|
32
|
-
validators = "0.
|
|
32
|
+
validators = "^0.34.0"
|
|
33
33
|
gitpython = "^3.1.31"
|
|
34
34
|
charset-normalizer = "^3.2.0"
|
|
35
35
|
|
|
36
36
|
[tool.poetry.group.dev.dependencies]
|
|
37
37
|
autohooks = ">=21.7.0"
|
|
38
38
|
autohooks-plugin-black = ">=21.12.0"
|
|
39
|
-
ruff = ">=0.5.6,<0.
|
|
39
|
+
ruff = ">=0.5.6,<0.8.0"
|
|
40
40
|
autohooks-plugin-ruff = "^24.1.0"
|
|
41
41
|
|
|
42
42
|
[tool.black]
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Copyright (C) 2022 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 tests.plugins import PluginTestCase
|
|
21
|
+
from troubadix.plugin import LinterError
|
|
22
|
+
from troubadix.plugins.script_xref_url import CheckScriptXrefUrl
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class CheckScriptXrefUrlTestCase(PluginTestCase):
|
|
26
|
+
path = Path("some/file.nasl")
|
|
27
|
+
|
|
28
|
+
def test_ok(self):
|
|
29
|
+
content = (
|
|
30
|
+
' script_xref(name:"URL", value:"http://www.example.com");\n'
|
|
31
|
+
# pylint: disable=line-too-long
|
|
32
|
+
# Various cases from https://github.com/python-validators/validators/issues/296
|
|
33
|
+
' script_xref(name:"URL", value:"https://launchpad.support.sap.com/#/notes/2718993");\n'
|
|
34
|
+
' script_xref(name:"URL", value:"https://forums.livezilla.net/index.php?/topic/10983-fg-vd-19-086-livezilla-server-is-vulnerable-to-sql-injection-ii/");\n'
|
|
35
|
+
' script_xref(name:"URL", value:"http://www.brocade.com/en/backend-content/pdf-page.html?/content/dam/common/documents/content-types/security-bulletin/brocade-security-advisory-2016-168.pdf");\n'
|
|
36
|
+
' script_xref(name:"URL", value:"https://groups.google.com/forum/?fromgroups#!topic/rubyonrails-security/8SA-M3as7A8");\n'
|
|
37
|
+
' script_xref(name:"URL", value:"https://forum.bitdefender.com/index.php?/topic/75470-doubleagent/");\n'
|
|
38
|
+
' script_xref(name:"URL", value:"https://www.smartftp.com/forums/index.php?/topic/16425-smartftp-client-40-change-log/");\n'
|
|
39
|
+
' script_xref(name:"URL", value:"https://exchange.xforce.ibmcloud.com/#/vulnerabilities/100912");\n'
|
|
40
|
+
' script_xref(name:"URL", value:"https://support.microsoft.com/en-us/lifecycle#gp/Microsoft-Internet-Explorer");\n'
|
|
41
|
+
' script_xref(name:"URL", value:"https://www.watchguard.com/support/release-notes/fireware/12/en-US/EN_ReleaseNotes_Fireware_12_5_9/index.html#Fireware/en-US/resolved_issues.html");\n'
|
|
42
|
+
' script_xref(name:"URL", value:"https://code.wireshark.org/review/#/c/25660/");\n'
|
|
43
|
+
' script_xref(name:"URL", value:"https://groups.google.com/forum/#!topic/kubernetes-announce/yBrFf5nmvfI");\n'
|
|
44
|
+
' script_xref(name:"URL", value:"https://issues.sonatype.org/plugins/servlet/mobile#issue/NEXUS-16870");\n'
|
|
45
|
+
' script_xref(name:"URL", value:"http://forums.livezilla.net/index.php?/topic/163-livezilla-changelog/");\n'
|
|
46
|
+
' script_xref(name:"URL", value:"https://www.watchguard.com/support/release-notes/fireware/11/en-US/EN_ReleaseNotes_Fireware_11_12_1/index.html#Fireware/en-US/resolved_issues.html%3FTocPath%3D_____13");\n'
|
|
47
|
+
' script_xref(name:"URL", value:"https://review.typo3.org/#/c/37013");\n'
|
|
48
|
+
' script_xref(name:"URL", value:"https://forums.malwarebytes.org/index.php?/topic/158251-malwarebytes-anti-exploit-hall-of-fame/");\n'
|
|
49
|
+
' script_xref(name:"URL", value:"http://speedtouch.sourceforge.io/index.php?/news.en.html");\n'
|
|
50
|
+
' script_xref(name:"URL", value:"https://support.k7computing.com/index.php?/Knowledgebase/Article/View/173/41/advisory-issued-on-6th-november-2017");\n'
|
|
51
|
+
' script_xref(name:"URL", value:"http://support.novell.com/cgi-bin/search/searchtid.cgi?/10077872.htm");\n'
|
|
52
|
+
' script_xref(name:"URL", value:"https://blog.fuzzing-project.org/54-Update-on-MatrixSSL-miscalculation-CVE-2016-8671,-incomplete-fix-for-CVE-2016-6887.html");\n'
|
|
53
|
+
' script_xref(name:"URL", value:"http://www.scaprepo.com/view.jsp?id=oval:org.secpod.oval:def:701638");\n'
|
|
54
|
+
' script_xref(name:"URL", value:"https://blog.fuzzing-project.org/46-Various-invalid-memory-reads-in-ImageMagick-WPG,-DDS,-DCM.html");\n'
|
|
55
|
+
' script_xref(name:"URL", value:"http://forum.wampserver.com/read.php?2,153491");\n'
|
|
56
|
+
' script_xref(name:"URL", value:"https://secure1.securityspace.com/smysecure/catid.html?in=FreeBSD-SA-10:04.jail.asc");\n'
|
|
57
|
+
' script_xref(name:"URL", value:"http://www.corelan.be:8800/index.php/forum/security-advisories/corelan-10-004-turboftp-server-1-00-712-dos/");\n'
|
|
58
|
+
' script_xref(name:"URL", value:"http://core.yehg.net/lab/pr0js/advisories/dll_hijacking/[flash_player]_10.1.x_insecure_dll_hijacking_(dwmapi.dll)");\n'
|
|
59
|
+
' script_xref(name:"URL", value:"http://mail-archives.apache.org/mod_mbox/perl-advocacy/200904.mbox/<ad28918e0904011458h273a71d4x408f1ed286c9dfbc@mail.gmail.com>");\n'
|
|
60
|
+
' script_xref(name:"URL", value:"https://confluence.atlassian.com/security/security-bulletin-may-21-2024-1387867145.html");\n'
|
|
61
|
+
# pylint: enable=line-too-long
|
|
62
|
+
)
|
|
63
|
+
fake_context = self.create_file_plugin_context(
|
|
64
|
+
nasl_file=self.path, file_content=content
|
|
65
|
+
)
|
|
66
|
+
plugin = CheckScriptXrefUrl(fake_context)
|
|
67
|
+
|
|
68
|
+
results = list(plugin.run())
|
|
69
|
+
|
|
70
|
+
self.assertEqual(len(results), 0)
|
|
71
|
+
|
|
72
|
+
def test_exclude_inc_file(self):
|
|
73
|
+
path = Path("some/file.inc")
|
|
74
|
+
fake_context = self.create_file_plugin_context(nasl_file=path)
|
|
75
|
+
plugin = CheckScriptXrefUrl(fake_context)
|
|
76
|
+
|
|
77
|
+
results = list(plugin.run())
|
|
78
|
+
|
|
79
|
+
self.assertEqual(len(results), 0)
|
|
80
|
+
|
|
81
|
+
def test_generic_invalid_url(self):
|
|
82
|
+
content = ' script_xref(name:"URL", value:"www.example.com");\n'
|
|
83
|
+
fake_context = self.create_file_plugin_context(
|
|
84
|
+
nasl_file=self.path, file_content=content
|
|
85
|
+
)
|
|
86
|
+
plugin = CheckScriptXrefUrl(fake_context)
|
|
87
|
+
|
|
88
|
+
results = list(plugin.run())
|
|
89
|
+
|
|
90
|
+
self.assertEqual(len(results), 1)
|
|
91
|
+
self.assertIsInstance(results[0], LinterError)
|
|
92
|
+
self.assertEqual(
|
|
93
|
+
'script_xref(name:"URL", value:"www.example.com");: Invalid URL'
|
|
94
|
+
" value",
|
|
95
|
+
results[0].message,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
def test_invalid_url_trailing_angle_bracket(self):
|
|
99
|
+
content = ' script_xref(name:"URL", value:"https://docs.docker.com/engine/release-notes/24.0/#2407>");\n'
|
|
100
|
+
fake_context = self.create_file_plugin_context(
|
|
101
|
+
nasl_file=self.path, file_content=content
|
|
102
|
+
)
|
|
103
|
+
plugin = CheckScriptXrefUrl(fake_context)
|
|
104
|
+
|
|
105
|
+
results = list(plugin.run())
|
|
106
|
+
|
|
107
|
+
self.assertEqual(len(results), 1)
|
|
108
|
+
self.assertIsInstance(results[0], LinterError)
|
|
109
|
+
self.assertEqual(
|
|
110
|
+
'script_xref(name:"URL", value:"https://docs.docker.com/engine/'
|
|
111
|
+
'release-notes/24.0/#2407>");: Invalid URL'
|
|
112
|
+
" value (trailing '>')",
|
|
113
|
+
results[0].message,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def test_invalid_url_trailing_comma(self):
|
|
117
|
+
content = ' script_xref(name:"URL", value:"https://dev.mysql.com/doc/refman/5.7/en/mysql-stmt-fetch.html,");\n'
|
|
118
|
+
fake_context = self.create_file_plugin_context(
|
|
119
|
+
nasl_file=self.path, file_content=content
|
|
120
|
+
)
|
|
121
|
+
plugin = CheckScriptXrefUrl(fake_context)
|
|
122
|
+
|
|
123
|
+
results = list(plugin.run())
|
|
124
|
+
|
|
125
|
+
self.assertEqual(len(results), 1)
|
|
126
|
+
self.assertIsInstance(results[0], LinterError)
|
|
127
|
+
self.assertEqual(
|
|
128
|
+
'script_xref(name:"URL", value:"https://dev.mysql.com/doc/refman/5.7/en/'
|
|
129
|
+
'mysql-stmt-fetch.html,");: Invalid URL'
|
|
130
|
+
" value (trailing ',')",
|
|
131
|
+
results[0].message,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
def test_invalid_url_trailing_punctuation_mark(self):
|
|
135
|
+
content = ' script_xref(name:"URL", value:"http://isec.pl/vulnerabilities/isec-0017-binfmt_elf.txt:");\n'
|
|
136
|
+
fake_context = self.create_file_plugin_context(
|
|
137
|
+
nasl_file=self.path, file_content=content
|
|
138
|
+
)
|
|
139
|
+
plugin = CheckScriptXrefUrl(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
|
+
'script_xref(name:"URL", value:"http://isec.pl/vulnerabilities/'
|
|
147
|
+
'isec-0017-binfmt_elf.txt:");: Invalid URL'
|
|
148
|
+
" value (trailing ':')",
|
|
149
|
+
results[0].message,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
def test_invalid_url_trailing_square_bracket(self):
|
|
153
|
+
content = (
|
|
154
|
+
' script_xref(name:"URL", value:"https://example.com/foo/bar]");\n'
|
|
155
|
+
)
|
|
156
|
+
fake_context = self.create_file_plugin_context(
|
|
157
|
+
nasl_file=self.path, file_content=content
|
|
158
|
+
)
|
|
159
|
+
plugin = CheckScriptXrefUrl(fake_context)
|
|
160
|
+
|
|
161
|
+
results = list(plugin.run())
|
|
162
|
+
|
|
163
|
+
self.assertEqual(len(results), 1)
|
|
164
|
+
self.assertIsInstance(results[0], LinterError)
|
|
165
|
+
self.assertEqual(
|
|
166
|
+
'script_xref(name:"URL", value:"https://example.com/foo/bar]");: Invalid URL'
|
|
167
|
+
" value (trailing ']')",
|
|
168
|
+
results[0].message,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
def test_invalid_url_trailing_round_bracket(self):
|
|
172
|
+
content = (
|
|
173
|
+
' script_xref(name:"URL", value:"https://example.com/foo/bar)");\n'
|
|
174
|
+
)
|
|
175
|
+
fake_context = self.create_file_plugin_context(
|
|
176
|
+
nasl_file=self.path, file_content=content
|
|
177
|
+
)
|
|
178
|
+
plugin = CheckScriptXrefUrl(fake_context)
|
|
179
|
+
|
|
180
|
+
results = list(plugin.run())
|
|
181
|
+
|
|
182
|
+
self.assertEqual(len(results), 1)
|
|
183
|
+
self.assertIsInstance(results[0], LinterError)
|
|
184
|
+
self.assertEqual(
|
|
185
|
+
'script_xref(name:"URL", value:"https://example.com/foo/bar)");: Invalid URL'
|
|
186
|
+
" value (trailing ')')",
|
|
187
|
+
results[0].message,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
def test_invalid_url_wrong_ending(self):
|
|
191
|
+
content = ' script_xref(name:"URL", value:"https://confluence.atlassian.com/security/security-bulletin-may-21-2024-1387867145.htmll");\n'
|
|
192
|
+
fake_context = self.create_file_plugin_context(
|
|
193
|
+
nasl_file=self.path, file_content=content
|
|
194
|
+
)
|
|
195
|
+
plugin = CheckScriptXrefUrl(fake_context)
|
|
196
|
+
|
|
197
|
+
results = list(plugin.run())
|
|
198
|
+
|
|
199
|
+
self.assertEqual(len(results), 1)
|
|
200
|
+
self.assertIsInstance(results[0], LinterError)
|
|
201
|
+
self.assertEqual(
|
|
202
|
+
'script_xref(name:"URL", value:"https://confluence.atlassian.com/security/'
|
|
203
|
+
'security-bulletin-may-21-2024-1387867145.htmll");: Invalid URL'
|
|
204
|
+
" value (wrong file extension)",
|
|
205
|
+
results[0].message,
|
|
206
|
+
)
|
|
@@ -11,9 +11,9 @@ from troubadix.standalone_plugins.deprecate_vts import (
|
|
|
11
11
|
_finalize_content,
|
|
12
12
|
_get_summary,
|
|
13
13
|
deprecate,
|
|
14
|
-
filter_files,
|
|
15
14
|
get_files_from_path,
|
|
16
15
|
parse_args,
|
|
16
|
+
parse_files,
|
|
17
17
|
update_summary,
|
|
18
18
|
)
|
|
19
19
|
|
|
@@ -26,7 +26,7 @@ class ParseArgsTestCase(unittest.TestCase):
|
|
|
26
26
|
|
|
27
27
|
args = parse_args(
|
|
28
28
|
[
|
|
29
|
-
"--
|
|
29
|
+
"--file",
|
|
30
30
|
testfile,
|
|
31
31
|
"--output-path",
|
|
32
32
|
output_path,
|
|
@@ -34,7 +34,7 @@ class ParseArgsTestCase(unittest.TestCase):
|
|
|
34
34
|
reason,
|
|
35
35
|
]
|
|
36
36
|
)
|
|
37
|
-
self.assertEqual(args.
|
|
37
|
+
self.assertEqual(args.file, [Path(testfile)])
|
|
38
38
|
self.assertEqual(args.output_path, Path(output_path))
|
|
39
39
|
self.assertEqual(args.deprecation_reason, reason)
|
|
40
40
|
|
|
@@ -47,7 +47,7 @@ class ParseArgsTestCase(unittest.TestCase):
|
|
|
47
47
|
with self.assertRaises(SystemExit):
|
|
48
48
|
parse_args(
|
|
49
49
|
[
|
|
50
|
-
"--
|
|
50
|
+
"--file",
|
|
51
51
|
testfile,
|
|
52
52
|
"--output-path",
|
|
53
53
|
output_path,
|
|
@@ -87,6 +87,28 @@ class ParseArgsTestCase(unittest.TestCase):
|
|
|
87
87
|
]
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
+
def test_parse_from_file(self):
|
|
91
|
+
output_path = "attic/"
|
|
92
|
+
with TemporaryDirectory() as tempdir:
|
|
93
|
+
from_file = tempdir / "from_file.txt"
|
|
94
|
+
testfile1 = tempdir / "testfile1.nasl"
|
|
95
|
+
testfile2 = tempdir / "testfile2.nasl"
|
|
96
|
+
|
|
97
|
+
from_file.write_text(f"{testfile1}\n{testfile2}\n", encoding="utf8")
|
|
98
|
+
|
|
99
|
+
args = parse_args(
|
|
100
|
+
[
|
|
101
|
+
"--from-file",
|
|
102
|
+
str(from_file),
|
|
103
|
+
"--output-path",
|
|
104
|
+
output_path,
|
|
105
|
+
"-r",
|
|
106
|
+
"NOTUS",
|
|
107
|
+
]
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
self.assertEqual(args.from_file, from_file)
|
|
111
|
+
|
|
90
112
|
|
|
91
113
|
NASL_CONTENT = (
|
|
92
114
|
'...if(description)\n{\n script_oid("1.3.6.1.4.1.25623.1.0.910673");'
|
|
@@ -190,16 +212,12 @@ class DeprecateVTsTestCase(unittest.TestCase):
|
|
|
190
212
|
|
|
191
213
|
self.assertEqual(result, expected)
|
|
192
214
|
|
|
193
|
-
def
|
|
215
|
+
def test_parse_files(self):
|
|
194
216
|
with TemporaryDirectory() as in_dir:
|
|
195
217
|
testfile1 = in_dir / "gb_rhsa_2021_8383_8383.nasl"
|
|
196
218
|
testfile1.write_text(NASL_CONTENT, encoding="utf8")
|
|
197
|
-
testfile2 = in_dir / "gb_rhsa_2020_8383_8383.nasl"
|
|
198
|
-
testfile2.write_text(NASL_CONTENT, encoding="utf8")
|
|
199
219
|
|
|
200
|
-
result =
|
|
201
|
-
files=[testfile1, testfile2], filename_prefix="gb_rhsa_2021"
|
|
202
|
-
)
|
|
220
|
+
result = parse_files(files=[testfile1])
|
|
203
221
|
expected = [
|
|
204
222
|
DeprecatedFile(
|
|
205
223
|
name="gb_rhsa_2021_8383_8383.nasl",
|
|
@@ -209,15 +227,3 @@ class DeprecateVTsTestCase(unittest.TestCase):
|
|
|
209
227
|
]
|
|
210
228
|
|
|
211
229
|
self.assertEqual(result, expected)
|
|
212
|
-
|
|
213
|
-
def test_filter_files_out(self):
|
|
214
|
-
with TemporaryDirectory() as in_dir:
|
|
215
|
-
testfile1 = in_dir / "gb_rhsa_2021_8383_8383.nasl"
|
|
216
|
-
testfile1.write_text(NASL_CONTENT, encoding="utf8")
|
|
217
|
-
|
|
218
|
-
result = filter_files(
|
|
219
|
-
files=[testfile1], filename_prefix="gb_rhsa_2020"
|
|
220
|
-
)
|
|
221
|
-
expected = []
|
|
222
|
-
|
|
223
|
-
self.assertEqual(result, expected)
|
|
@@ -41,6 +41,10 @@ ALLOWED_URLS = [
|
|
|
41
41
|
"http://mail-archives.apache.org/mod_mbox/perl-advocacy/2"
|
|
42
42
|
"00904.mbox/<ad28918e0904011458h273a71d4x408f1ed286c9dfbc@mail.gmail.com>",
|
|
43
43
|
"http://yehg.net/lab/pr0js/advisories/[mybb1.6]_cross_site_scripting",
|
|
44
|
+
"http://www.live555.com/liveMedia/public/changelog.txt#[2021.08.04]",
|
|
45
|
+
"http://www.live555.com/liveMedia/public/changelog.txt#[2021.08.06]",
|
|
46
|
+
"http://www.live555.com/liveMedia/public/changelog.txt#[2021.08.09]",
|
|
47
|
+
"http://www.live555.com/liveMedia/public/changelog.txt#[2021.08.13]",
|
|
44
48
|
]
|
|
45
49
|
|
|
46
50
|
|
|
@@ -63,11 +67,67 @@ class CheckScriptXrefUrl(FileContentPlugin):
|
|
|
63
67
|
)
|
|
64
68
|
for match in matches:
|
|
65
69
|
if match:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
url_value = match.group("value")
|
|
71
|
+
if url_value in ALLOWED_URLS:
|
|
72
|
+
continue
|
|
73
|
+
|
|
74
|
+
full_xref = match.group(0)
|
|
75
|
+
|
|
76
|
+
# First a few possible malformed URLs introduced by e.g. some automatic
|
|
77
|
+
# extraction or by copy'n'paste
|
|
78
|
+
if url_value.endswith(">") and "<" not in url_value:
|
|
79
|
+
yield LinterError(
|
|
80
|
+
f"{full_xref}: Invalid URL value (trailing '>')",
|
|
81
|
+
file=nasl_file,
|
|
82
|
+
plugin=self.name,
|
|
83
|
+
)
|
|
84
|
+
continue
|
|
85
|
+
|
|
86
|
+
if url_value.endswith(","):
|
|
87
|
+
yield LinterError(
|
|
88
|
+
f"{full_xref}: Invalid URL value (trailing ',')",
|
|
89
|
+
file=nasl_file,
|
|
90
|
+
plugin=self.name,
|
|
91
|
+
)
|
|
92
|
+
continue
|
|
93
|
+
|
|
94
|
+
if url_value.endswith(":"):
|
|
95
|
+
yield LinterError(
|
|
96
|
+
f"{full_xref}: Invalid URL value (trailing ':')",
|
|
97
|
+
file=nasl_file,
|
|
98
|
+
plugin=self.name,
|
|
99
|
+
)
|
|
100
|
+
continue
|
|
101
|
+
|
|
102
|
+
if url_value.endswith("]") and "[" not in url_value:
|
|
103
|
+
yield LinterError(
|
|
104
|
+
f"{full_xref}: Invalid URL value (trailing ']')",
|
|
105
|
+
file=nasl_file,
|
|
106
|
+
plugin=self.name,
|
|
107
|
+
)
|
|
108
|
+
continue
|
|
109
|
+
|
|
110
|
+
if url_value.endswith(")") and "(" not in url_value:
|
|
111
|
+
yield LinterError(
|
|
112
|
+
f"{full_xref}: Invalid URL value (trailing ')')",
|
|
113
|
+
file=nasl_file,
|
|
114
|
+
plugin=self.name,
|
|
115
|
+
)
|
|
116
|
+
continue
|
|
117
|
+
|
|
118
|
+
if url_value.endswith(".htmll"):
|
|
119
|
+
yield LinterError(
|
|
120
|
+
f"{full_xref}: Invalid URL value (wrong file extension)",
|
|
121
|
+
file=nasl_file,
|
|
122
|
+
plugin=self.name,
|
|
123
|
+
)
|
|
124
|
+
continue
|
|
125
|
+
|
|
126
|
+
# Additional standard check via the validators package
|
|
127
|
+
if not url(url_value, strict_query=False):
|
|
69
128
|
yield LinterError(
|
|
70
|
-
f"{
|
|
129
|
+
f"{full_xref}: Invalid URL value",
|
|
71
130
|
file=nasl_file,
|
|
72
131
|
plugin=self.name,
|
|
73
132
|
)
|
|
133
|
+
continue
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
# SPDX-FileCopyrightText: 2024 Greenbone AG
|
|
3
3
|
|
|
4
4
|
import re
|
|
5
|
-
from argparse import ArgumentParser, Namespace
|
|
5
|
+
from argparse import ArgumentParser, ArgumentTypeError, Namespace
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
from enum import Enum
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from typing import Iterable, Optional
|
|
10
10
|
|
|
11
|
+
from pontos.terminal.terminal import ConsoleTerminal
|
|
12
|
+
|
|
11
13
|
from troubadix.argparser import directory_type, file_type
|
|
12
14
|
from troubadix.helper.patterns import (
|
|
13
15
|
ScriptTag,
|
|
@@ -15,6 +17,7 @@ from troubadix.helper.patterns import (
|
|
|
15
17
|
get_script_tag_pattern,
|
|
16
18
|
get_special_script_tag_pattern,
|
|
17
19
|
)
|
|
20
|
+
from troubadix.troubadix import from_file
|
|
18
21
|
|
|
19
22
|
|
|
20
23
|
class Deprecations(Enum):
|
|
@@ -34,6 +37,15 @@ class DeprecatedFile:
|
|
|
34
37
|
KB_ITEMS_PATTERN = re.compile(r"set_kb_item\(.+\);")
|
|
35
38
|
|
|
36
39
|
|
|
40
|
+
def existing_file_type(string: str) -> Path:
|
|
41
|
+
file_path = Path(string)
|
|
42
|
+
if not file_path.exists():
|
|
43
|
+
raise ArgumentTypeError(f'File "{string}" does not exist.')
|
|
44
|
+
if not file_path.is_file():
|
|
45
|
+
raise ArgumentTypeError(f'"{string}" is not a file.')
|
|
46
|
+
return file_path
|
|
47
|
+
|
|
48
|
+
|
|
37
49
|
def update_summary(file: DeprecatedFile, deprecation_reason: str) -> str:
|
|
38
50
|
"""Update the summary of the nasl script by adding the information
|
|
39
51
|
that the script has been deprecated, and if possible, the oid of
|
|
@@ -83,26 +95,18 @@ def get_files_from_path(dir_path: Path = None) -> list:
|
|
|
83
95
|
return [file for file in dir_path.glob("**/*")]
|
|
84
96
|
|
|
85
97
|
|
|
86
|
-
def
|
|
87
|
-
|
|
88
|
-
) -> list[DeprecatedFile]:
|
|
89
|
-
"""Filter the files based on a provided prefix and convert them into
|
|
98
|
+
def parse_files(files: list) -> list[DeprecatedFile]:
|
|
99
|
+
"""Convert filepaths into
|
|
90
100
|
DeprecatedFile objects
|
|
91
101
|
|
|
92
102
|
Args:
|
|
93
103
|
files: a list of files to deprecate, should be .nasl VTs
|
|
94
|
-
filename_prefix: an optional prefix to filter only specific files
|
|
95
104
|
|
|
96
105
|
Returns:
|
|
97
106
|
List of DeprecatedFile objects
|
|
98
107
|
|
|
99
108
|
"""
|
|
100
109
|
to_deprecate = []
|
|
101
|
-
if filename_prefix:
|
|
102
|
-
filename_filter = re.compile(rf"{filename_prefix}")
|
|
103
|
-
files[:] = [
|
|
104
|
-
file for file in files if re.match(filename_filter, file.name)
|
|
105
|
-
]
|
|
106
110
|
|
|
107
111
|
for file in files:
|
|
108
112
|
with file.open("r", encoding="latin-1") as fh:
|
|
@@ -193,16 +197,6 @@ def parse_args(args: Iterable[str] = None) -> Namespace:
|
|
|
193
197
|
required=True,
|
|
194
198
|
help="Path where the deprecated files should be written to.",
|
|
195
199
|
)
|
|
196
|
-
parser.add_argument(
|
|
197
|
-
"-p",
|
|
198
|
-
"--filename-prefix",
|
|
199
|
-
metavar="<filename_prefix>",
|
|
200
|
-
nargs="?",
|
|
201
|
-
default=None,
|
|
202
|
-
type=str,
|
|
203
|
-
help="The prefix of the files you would like to deprecate,"
|
|
204
|
-
"for example 'gb_rhsa_2021' to filter on the year",
|
|
205
|
-
)
|
|
206
200
|
parser.add_argument(
|
|
207
201
|
"-r",
|
|
208
202
|
"--deprecation-reason",
|
|
@@ -214,16 +208,17 @@ def parse_args(args: Iterable[str] = None) -> Namespace:
|
|
|
214
208
|
"been merged with another still active VT, 'duplicate': The VT has"
|
|
215
209
|
"a still active duplicate, 'defunct': The VT is no longer "
|
|
216
210
|
"functional.",
|
|
211
|
+
required=True,
|
|
217
212
|
)
|
|
218
213
|
group = parser.add_mutually_exclusive_group(required=True)
|
|
219
214
|
group.add_argument(
|
|
220
215
|
"-f",
|
|
221
|
-
"--
|
|
222
|
-
metavar="<
|
|
216
|
+
"--file",
|
|
217
|
+
metavar="<file>",
|
|
223
218
|
nargs="+",
|
|
224
219
|
default=None,
|
|
225
220
|
type=file_type,
|
|
226
|
-
help="
|
|
221
|
+
help="File to deprecate",
|
|
227
222
|
)
|
|
228
223
|
group.add_argument(
|
|
229
224
|
"-i",
|
|
@@ -231,20 +226,36 @@ def parse_args(args: Iterable[str] = None) -> Namespace:
|
|
|
231
226
|
metavar="<input_path>",
|
|
232
227
|
default=None,
|
|
233
228
|
type=directory_type,
|
|
234
|
-
help="Path to
|
|
229
|
+
help="Path to a directory where all files should be deprecated.",
|
|
230
|
+
)
|
|
231
|
+
group.add_argument(
|
|
232
|
+
"--from-file",
|
|
233
|
+
metavar="<from_file>",
|
|
234
|
+
default=None,
|
|
235
|
+
type=existing_file_type,
|
|
236
|
+
help=(
|
|
237
|
+
"Path to a single file that contains a list of files "
|
|
238
|
+
"to be deprecated, separated by new lines."
|
|
239
|
+
),
|
|
235
240
|
)
|
|
236
241
|
return parser.parse_args(args)
|
|
237
242
|
|
|
238
243
|
|
|
239
244
|
def main():
|
|
240
245
|
args = parse_args()
|
|
246
|
+
terminal = ConsoleTerminal()
|
|
241
247
|
input_path = args.input_path if args.input_path else None
|
|
242
|
-
|
|
248
|
+
files = []
|
|
243
249
|
|
|
244
|
-
|
|
245
|
-
|
|
250
|
+
if input_path:
|
|
251
|
+
files = get_files_from_path(input_path)
|
|
252
|
+
elif args.from_file:
|
|
253
|
+
files = from_file(include_file=args.from_file, term=terminal)
|
|
254
|
+
elif args.file:
|
|
255
|
+
files = args.file
|
|
246
256
|
|
|
247
|
-
|
|
257
|
+
to_be_deprecated = parse_files(files)
|
|
258
|
+
deprecate(args.output_path, to_be_deprecated, args.deprecation_reason)
|
|
248
259
|
|
|
249
260
|
|
|
250
261
|
if __name__ == "__main__":
|