troubadix 25.6.0__tar.gz → 25.6.1__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.
Files changed (231) hide show
  1. {troubadix-25.6.0 → troubadix-25.6.1}/PKG-INFO +1 -1
  2. {troubadix-25.6.0 → troubadix-25.6.1}/pyproject.toml +2 -2
  3. troubadix-25.6.1/tests/helper/test_date_format.py +140 -0
  4. troubadix-25.6.1/tests/plugins/test_creation_date.py +129 -0
  5. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_cvss_format.py +3 -3
  6. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_tags_mandatory.py +6 -4
  7. troubadix-25.6.1/tests/plugins/test_severity_date.py +87 -0
  8. troubadix-25.6.1/tests/plugins/test_severity_format.py +148 -0
  9. troubadix-25.6.1/tests/plugins/test_severity_origin.py +94 -0
  10. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_vt_file_permissions.py +2 -0
  11. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/__version__.py +1 -1
  12. troubadix-25.6.1/troubadix/helper/date_format.py +93 -0
  13. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/helper/patterns.py +17 -2
  14. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/__init__.py +6 -0
  15. troubadix-25.6.1/troubadix/plugins/creation_date.py +74 -0
  16. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/cvss_format.py +4 -15
  17. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_tags_mandatory.py +6 -1
  18. troubadix-25.6.1/troubadix/plugins/severity_date.py +53 -0
  19. troubadix-25.6.1/troubadix/plugins/severity_format.py +33 -0
  20. troubadix-25.6.1/troubadix/plugins/severity_origin.py +33 -0
  21. troubadix-25.6.0/tests/plugins/test_creation_date.py +0 -258
  22. troubadix-25.6.0/troubadix/plugins/creation_date.py +0 -110
  23. {troubadix-25.6.0 → troubadix-25.6.1}/LICENSE +0 -0
  24. {troubadix-25.6.0 → troubadix-25.6.1}/README.md +0 -0
  25. {troubadix-25.6.0 → troubadix-25.6.1}/tests/__init__.py +0 -0
  26. {troubadix-25.6.0 → troubadix-25.6.1}/tests/helper/__init__.py +0 -0
  27. {troubadix-25.6.0 → troubadix-25.6.1}/tests/helper/test_linguistic_exception_handler.py +0 -0
  28. {troubadix-25.6.0 → troubadix-25.6.1}/tests/helper/test_patterns.py +0 -0
  29. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/__init__.py +0 -0
  30. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/fail.nasl +0 -0
  31. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/fail2.nasl +0 -0
  32. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test.nasl +0 -0
  33. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_badwords.py +0 -0
  34. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_copyright_text.py +0 -0
  35. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_copyright_year.py +0 -0
  36. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_cve_format.py +0 -0
  37. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_dependencies.py +0 -0
  38. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_dependency_category_order.py +0 -0
  39. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_deprecated_dependency.py +0 -0
  40. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_deprecated_functions.py +0 -0
  41. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_double_end_points.py +0 -0
  42. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_duplicate_oid.py +0 -0
  43. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_duplicated_script_tags.py +0 -0
  44. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_encoding.py +0 -0
  45. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/fail_bad_new_line.nasl +0 -0
  46. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/fail_badwords.nasl +0 -0
  47. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/fail_name_and_copyright_newline.nasl +0 -0
  48. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/fail_name_newline.nasl +0 -0
  49. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/fail_permissions.nasl +0 -0
  50. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/fail_spelling.nasl +0 -0
  51. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/fail.nasl +0 -0
  52. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/fail_badwords.nasl +0 -0
  53. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/fail_name_and_copyright_newline.nasl +0 -0
  54. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/fail_name_newline.nasl +0 -0
  55. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/fail_solution_template.nasl +0 -0
  56. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/runner/fail.nasl +0 -0
  57. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/runner/fail2.nasl +0 -0
  58. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/runner/test.nasl +0 -0
  59. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/runner/test_valid_oid.nasl +0 -0
  60. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/test.inc +0 -0
  61. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/21.04/test.nasl +0 -0
  62. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/nasl/warning.nasl +0 -0
  63. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/ok_permissions.nasl +0 -0
  64. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_files/test_oid.nasl +0 -0
  65. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_forking_nasl_functions.py +0 -0
  66. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_get_kb_on_services.py +0 -0
  67. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_grammar.py +0 -0
  68. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_http_links_in_tags.py +0 -0
  69. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_illegal_characters.py +0 -0
  70. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_log_messages.py +0 -0
  71. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_malformed_dependencies.py +0 -0
  72. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_misplaced_compare_in_if.py +0 -0
  73. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_missing_desc_exit.py +0 -0
  74. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_missing_tag_solution.py +0 -0
  75. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_multiple_re_parameters.py +0 -0
  76. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_newlines.py +0 -0
  77. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_overlong_description_lines.py +0 -0
  78. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_overlong_script_tags.py +0 -0
  79. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_prod_svc_detect_in_vulnvt.py +0 -0
  80. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_qod.py +0 -0
  81. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_reporting_consistency.py +0 -0
  82. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_add_preference_type.py +0 -0
  83. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_calls_empty_values.py +0 -0
  84. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_calls_recommended.py +0 -0
  85. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_category.py +0 -0
  86. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_copyright.py +0 -0
  87. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_family.py +0 -0
  88. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_tag_form.py +0 -0
  89. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_tag_whitespaces.py +0 -0
  90. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_version_and_last_modification_tags.py +0 -0
  91. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_xref_form.py +0 -0
  92. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_script_xref_url.py +0 -0
  93. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_security_messages.py +0 -0
  94. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_set_get_kb_calls.py +0 -0
  95. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_solution_text.py +0 -0
  96. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_solution_type.py +0 -0
  97. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_spaces_before_dots.py +0 -0
  98. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_spaces_in_filename.py +0 -0
  99. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_spelling.py +0 -0
  100. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_tabs.py +0 -0
  101. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_todo_tbd.py +0 -0
  102. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_trailing_spaces_tabs.py +0 -0
  103. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_using_display.py +0 -0
  104. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_valid_oid.py +0 -0
  105. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_valid_script_tag_names.py +0 -0
  106. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_variable_redefinition_in_foreach.py +0 -0
  107. {troubadix-25.6.0 → troubadix-25.6.1}/tests/plugins/test_vt_placement.py +0 -0
  108. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/__init__.py +0 -0
  109. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/changed_packages/__init__.py +0 -0
  110. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/changed_packages/markers/__init__.py +0 -0
  111. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/changed_packages/markers/test_added_epoch.py +0 -0
  112. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/changed_packages/markers/test_added_release.py +0 -0
  113. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/changed_packages/markers/test_added_udeb.py +0 -0
  114. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/changed_packages/markers/test_changed_update.py +0 -0
  115. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/changed_packages/markers/test_dropped_architecture.py +0 -0
  116. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/changed_packages/test_changed_packages.py +0 -0
  117. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/changed_packages/test_package.py +0 -0
  118. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/nasl/21.04/21_script.nasl +0 -0
  119. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/nasl/22.04/22_script.nasl +0 -0
  120. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/nasl/common/bar.nasl +0 -0
  121. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/nasl/common/foo.nasl +0 -0
  122. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/nasl/common/foobar.nasl +0 -0
  123. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/nasl/common/gsf/enterprise_script.nasl +0 -0
  124. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/test_changed_cves.py +0 -0
  125. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/test_changed_oid.py +0 -0
  126. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/test_dependency_graph.py +0 -0
  127. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/test_deprecate_vts.py +0 -0
  128. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/test_file_extensions.py +0 -0
  129. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/test_last_modification.py +0 -0
  130. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/test_no_solution.py +0 -0
  131. {troubadix-25.6.0 → troubadix-25.6.1}/tests/standalone_plugins/test_version_updated.py +0 -0
  132. {troubadix-25.6.0 → troubadix-25.6.1}/tests/test_argparser.py +0 -0
  133. {troubadix-25.6.0 → troubadix-25.6.1}/tests/test_helper.py +0 -0
  134. {troubadix-25.6.0 → troubadix-25.6.1}/tests/test_naslinter.py +0 -0
  135. {troubadix-25.6.0 → troubadix-25.6.1}/tests/test_reporter.py +0 -0
  136. {troubadix-25.6.0 → troubadix-25.6.1}/tests/test_results.py +0 -0
  137. {troubadix-25.6.0 → troubadix-25.6.1}/tests/test_runner.py +0 -0
  138. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/__init__.py +0 -0
  139. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/argparser.py +0 -0
  140. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/codespell/codespell.additions +0 -0
  141. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/codespell/codespell.exclude +0 -0
  142. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/codespell/codespell.ignore +0 -0
  143. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/helper/__init__.py +0 -0
  144. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/helper/helper.py +0 -0
  145. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/helper/linguistic_exception_handler.py +0 -0
  146. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugin.py +0 -0
  147. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/badwords.py +0 -0
  148. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/copyright_text.py +0 -0
  149. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/copyright_year.py +0 -0
  150. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/cve_format.py +0 -0
  151. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/dependencies.py +0 -0
  152. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/dependency_category_order.py +0 -0
  153. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/deprecated_dependency.py +0 -0
  154. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/deprecated_functions.py +0 -0
  155. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/double_end_points.py +0 -0
  156. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/duplicate_oid.py +0 -0
  157. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/duplicated_script_tags.py +0 -0
  158. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/encoding.py +0 -0
  159. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/forking_nasl_functions.py +0 -0
  160. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/get_kb_on_services.py +0 -0
  161. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/grammar.py +0 -0
  162. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/http_links_in_tags.py +0 -0
  163. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/illegal_characters.py +0 -0
  164. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/log_messages.py +0 -0
  165. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/malformed_dependencies.py +0 -0
  166. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/misplaced_compare_in_if.py +0 -0
  167. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/missing_desc_exit.py +0 -0
  168. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/missing_tag_solution.py +0 -0
  169. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/multiple_re_parameters.py +0 -0
  170. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/newlines.py +0 -0
  171. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/overlong_description_lines.py +0 -0
  172. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/overlong_script_tags.py +0 -0
  173. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/prod_svc_detect_in_vulnvt.py +0 -0
  174. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/qod.py +0 -0
  175. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/reporting_consistency.py +0 -0
  176. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_add_preference_type.py +0 -0
  177. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_calls_empty_values.py +0 -0
  178. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_calls_recommended.py +0 -0
  179. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_category.py +0 -0
  180. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_copyright.py +0 -0
  181. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_family.py +0 -0
  182. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_tag_form.py +0 -0
  183. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_tag_whitespaces.py +0 -0
  184. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_version_and_last_modification_tags.py +0 -0
  185. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_xref_form.py +0 -0
  186. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/script_xref_url.py +0 -0
  187. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/security_messages.py +0 -0
  188. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/set_get_kb_calls.py +0 -0
  189. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/solution_text.py +0 -0
  190. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/solution_type.py +0 -0
  191. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/spaces_before_dots.py +0 -0
  192. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/spaces_in_filename.py +0 -0
  193. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/spelling.py +0 -0
  194. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/tabs.py +0 -0
  195. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/todo_tbd.py +0 -0
  196. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/trailing_spaces_tabs.py +0 -0
  197. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/using_display.py +0 -0
  198. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/valid_oid.py +0 -0
  199. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/valid_script_tag_names.py +0 -0
  200. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/variable_assigned_in_if.py +0 -0
  201. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/variable_redefinition_in_foreach.py +0 -0
  202. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/vt_file_permissions.py +0 -0
  203. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/plugins/vt_placement.py +0 -0
  204. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/reporter.py +0 -0
  205. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/results.py +0 -0
  206. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/runner.py +0 -0
  207. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/__init__.py +0 -0
  208. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/allowed_rev_diff.py +0 -0
  209. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_cves.py +0 -0
  210. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_oid.py +0 -0
  211. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_packages/changed_packages.py +0 -0
  212. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_packages/marker/__init__.py +0 -0
  213. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_packages/marker/added_epoch.py +0 -0
  214. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_packages/marker/added_release.py +0 -0
  215. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_packages/marker/added_udeb.py +0 -0
  216. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_packages/marker/changed_update.py +0 -0
  217. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_packages/marker/dropped_architecture.py +0 -0
  218. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_packages/marker/marker.py +0 -0
  219. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/changed_packages/package.py +0 -0
  220. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/common.py +0 -0
  221. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/dependency_graph/__init__.py +0 -0
  222. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/dependency_graph/checks.py +0 -0
  223. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/dependency_graph/cli.py +0 -0
  224. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/dependency_graph/dependency_graph.py +0 -0
  225. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/dependency_graph/models.py +0 -0
  226. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/deprecate_vts.py +0 -0
  227. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/file_extensions.py +0 -0
  228. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/last_modification.py +0 -0
  229. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/no_solution.py +0 -0
  230. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/standalone_plugins/version_updated.py +0 -0
  231. {troubadix-25.6.0 → troubadix-25.6.1}/troubadix/troubadix.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: troubadix
3
- Version: 25.6.0
3
+ Version: 25.6.1
4
4
  Summary: A linting and QA check tool for NASL files
5
5
  License: GPL-3.0-or-later
6
6
  Author: Greenbone
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "troubadix"
3
- version = "25.6.0"
3
+ version = "25.6.1"
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.12.0"
40
+ ruff = ">=0.5.6,<0.13.0"
41
41
  autohooks-plugin-ruff = ">=24.1,<26.0"
42
42
 
43
43
  [tool.black]
@@ -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 an invalid cvss_base value.",
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 an invalid cvss_base value.",
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
- " script_name('foo');\n"
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), 6)
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), 1)
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), 5)
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
+ )
@@ -0,0 +1,94 @@
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_origin import CheckSeverityOrigin
8
+
9
+ from . import PluginTestCase
10
+
11
+
12
+ class CheckSeverityOriginTestCase(PluginTestCase):
13
+
14
+ def test_severity_origin_nvd(self):
15
+ path = Path("some/file.nasl")
16
+ content = ' script_tag(name:"severity_origin", value:"NVD");\n'
17
+ fake_context = self.create_file_plugin_context(
18
+ nasl_file=path, file_content=content
19
+ )
20
+ plugin = CheckSeverityOrigin(fake_context)
21
+
22
+ results = list(plugin.run())
23
+
24
+ self.assertEqual(len(results), 0)
25
+
26
+ def test_severity_origin_vendor(self):
27
+ path = Path("some/file.nasl")
28
+ content = ' script_tag(name:"severity_origin", value:"Vendor");\n'
29
+ fake_context = self.create_file_plugin_context(
30
+ nasl_file=path, file_content=content
31
+ )
32
+ plugin = CheckSeverityOrigin(fake_context)
33
+
34
+ results = list(plugin.run())
35
+
36
+ self.assertEqual(len(results), 0)
37
+
38
+ def test_severity_origin_third_party(self):
39
+ path = Path("some/file.nasl")
40
+ content = ' script_tag(name:"severity_origin", value:"Third Party");\n'
41
+ fake_context = self.create_file_plugin_context(
42
+ nasl_file=path, file_content=content
43
+ )
44
+ plugin = CheckSeverityOrigin(fake_context)
45
+
46
+ results = list(plugin.run())
47
+
48
+ self.assertEqual(len(results), 0)
49
+
50
+ def test_severity_origin_greenbone(self):
51
+ path = Path("some/file.nasl")
52
+ content = ' script_tag(name:"severity_origin", value:"Greenbone");\n'
53
+ fake_context = self.create_file_plugin_context(
54
+ nasl_file=path, file_content=content
55
+ )
56
+ plugin = CheckSeverityOrigin(fake_context)
57
+
58
+ results = list(plugin.run())
59
+
60
+ self.assertEqual(len(results), 0)
61
+
62
+ def test_severity_origin_other(self):
63
+ path = Path("some/file.nasl")
64
+ content = ' script_tag(name:"severity_origin", value:"Other");\n'
65
+ fake_context = self.create_file_plugin_context(
66
+ nasl_file=path, file_content=content
67
+ )
68
+ plugin = CheckSeverityOrigin(fake_context)
69
+
70
+ results = list(plugin.run())
71
+
72
+ self.assertEqual(len(results), 1)
73
+ self.assertIsInstance(results[0], LinterError)
74
+ self.assertEqual(
75
+ "VT has an invalid severity_origin value.",
76
+ results[0].message,
77
+ )
78
+
79
+ def test_severity_origin_empty(self):
80
+ path = Path("some/file.nasl")
81
+ content = ' script_tag(name:"severity_origin", value:"");\n'
82
+ fake_context = self.create_file_plugin_context(
83
+ nasl_file=path, file_content=content
84
+ )
85
+ plugin = CheckSeverityOrigin(fake_context)
86
+
87
+ results = list(plugin.run())
88
+
89
+ self.assertEqual(len(results), 1)
90
+ self.assertIsInstance(results[0], LinterError)
91
+ self.assertEqual(
92
+ "VT has an invalid severity_origin value.",
93
+ results[0].message,
94
+ )