troubadix 25.1.0__py3-none-any.whl → 25.1.2__py3-none-any.whl

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/__version__.py CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  # THIS IS AN AUTOGENERATED FILE. DO NOT TOUCH!
4
4
 
5
- __version__ = "25.1.0"
5
+ __version__ = "25.1.2"
@@ -32,6 +32,14 @@ IGNORE_TAGS = [
32
32
  "script_name",
33
33
  "script_xref",
34
34
  "script_add_preference",
35
+ # nb: Various variants of URLs in comments which we can't / shouldn't
36
+ # trim down
37
+ " # http://",
38
+ " # https://",
39
+ " # - http://",
40
+ " # - https://",
41
+ " # > http://",
42
+ " # > https://",
35
43
  # nb: Special cases we should ignore (at least for now) as these are
36
44
  # commonly used like this and is only two chars "too long".
37
45
  'script_tag(name:"vuldetect", value:"Checks if a vulnerable version is '
@@ -58,6 +58,7 @@ class CheckValidOID(FileContentPlugin):
58
58
 
59
59
  security_template = "Security Advisory"
60
60
  family_template = "Local Security Checks"
61
+ windows_family_template = "Windows : Microsoft Bulletins"
61
62
  is_using_reserved = "is using an OID that is reserved for"
62
63
  invalid_oid = "is using an invalid OID"
63
64
 
@@ -81,22 +82,20 @@ class CheckValidOID(FileContentPlugin):
81
82
  )
82
83
  return
83
84
 
84
- # Vendor-specific OIDs
85
- if "1.3.6.1.4.1.25623.1.1." in oid:
86
- family_pattern = get_special_script_tag_pattern(
87
- SpecialScriptTag.FAMILY
85
+ family_pattern = get_special_script_tag_pattern(SpecialScriptTag.FAMILY)
86
+ family_match = family_pattern.search(file_content)
87
+
88
+ if family_match is None or family_match.group("value") is None:
89
+ yield LinterError(
90
+ "VT is missing a script family!",
91
+ file=nasl_file,
92
+ plugin=self.name,
88
93
  )
89
- family_match = family_pattern.search(file_content)
90
- if family_match is None or family_match.group("value") is None:
91
- yield LinterError(
92
- "VT is missing a script family!",
93
- file=nasl_file,
94
- plugin=self.name,
95
- )
96
- return
94
+ return
97
95
 
96
+ # Vendor-specific OIDs
97
+ if "1.3.6.1.4.1.25623.1.1." in oid:
98
98
  family = family_match.group("value")
99
-
100
99
  vendor_number_match = re.search(
101
100
  r"^1\.3\.6\.1\.4\.1\.25623\.1\.1\.([0-9]+)\.", oid
102
101
  )
@@ -324,6 +323,15 @@ class CheckValidOID(FileContentPlugin):
324
323
  plugin=self.name,
325
324
  )
326
325
  return
326
+ elif vendor_number == "18":
327
+ if family != f"openSUSE {family_template}":
328
+ yield LinterError(
329
+ f"script_oid() {is_using_reserved} openSUSE "
330
+ f"'{str(oid)}'",
331
+ file=nasl_file,
332
+ plugin=self.name,
333
+ )
334
+ return
327
335
 
328
336
  else:
329
337
  yield LinterError(
@@ -338,8 +346,8 @@ class CheckValidOID(FileContentPlugin):
338
346
 
339
347
  # product-specific OIDs
340
348
  if "1.3.6.1.4.1.25623.1.2." in oid:
341
- name_patter = get_special_script_tag_pattern(SpecialScriptTag.NAME)
342
- name_match = name_patter.search(file_content)
349
+ name_pattern = get_special_script_tag_pattern(SpecialScriptTag.NAME)
350
+ name_match = name_pattern.search(file_content)
343
351
  if not name_match or not name_match.group("value"):
344
352
  yield LinterError(
345
353
  "VT is missing a script name!",
@@ -378,6 +386,32 @@ class CheckValidOID(FileContentPlugin):
378
386
 
379
387
  return
380
388
 
389
+ # Fixed OID-scheme for Windows OIDs
390
+ if "1.3.6.1.4.1.25623.1.3." in oid:
391
+ if family_match.group("value") != windows_family_template:
392
+ yield LinterError(
393
+ f"script_oid() {is_using_reserved} 'Windows' ("
394
+ f"{str(oid)})",
395
+ file=nasl_file,
396
+ plugin=self.name,
397
+ )
398
+ return
399
+
400
+ windows_oid_match = re.search(
401
+ r"^1\.3\.6\.1\.4\.1\.25623\.1\.3\.\d+\.\d+\.\d+\.\d+",
402
+ oid,
403
+ )
404
+ if not windows_oid_match:
405
+ yield LinterError(
406
+ f"script_oid() {invalid_oid} '{str(oid)}' "
407
+ "(Windows pattern: 1.3.6.1.4.1.25623.1.3."
408
+ "[product_id].[platform_id].[kb_article_id].[fixed_build_number])",
409
+ file=nasl_file,
410
+ plugin=self.name,
411
+ )
412
+ return
413
+ return
414
+
381
415
  oid_digit_match = re.search(
382
416
  r"^1\.3\.6\.1\.4\.1\.25623\.1\.0\.([0-9]+)", oid
383
417
  )
@@ -81,7 +81,7 @@ def _finalize_content(content: str) -> str:
81
81
  content_to_keep = content.split("exit(0);")[0]
82
82
  return content_to_keep + (
83
83
  'script_tag(name:"deprecated", value:TRUE);'
84
- "\n\nexit(0);\n}\n\nexit(66);\n"
84
+ "\n\n exit(0);\n}\n\nexit(66);\n"
85
85
  )
86
86
 
87
87
 
@@ -1,8 +1,7 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: troubadix
3
- Version: 25.1.0
3
+ Version: 25.1.2
4
4
  Summary: A linting and QA check tool for NASL files
5
- Home-page: https://github.com/greenbone/troubadix
6
5
  License: GPL-3.0-or-later
7
6
  Author: Greenbone
8
7
  Author-email: info@greenbone.net
@@ -22,9 +21,10 @@ Requires-Dist: chardet (>=4,<6)
22
21
  Requires-Dist: charset-normalizer (>=3.2.0,<4.0.0)
23
22
  Requires-Dist: codespell (>=2.0.0,<3.0.0)
24
23
  Requires-Dist: gitpython (>=3.1.31,<4.0.0)
25
- Requires-Dist: pontos (>=22.7,<25.0)
24
+ Requires-Dist: pontos (>=22.7,<26.0)
26
25
  Requires-Dist: python-magic (>=0.4.25,<0.5.0)
27
26
  Requires-Dist: validators (>=0.34.0,<0.35.0)
27
+ Project-URL: Homepage, https://github.com/greenbone/troubadix
28
28
  Project-URL: Repository, https://github.com/greenbone/troubadix
29
29
  Description-Content-Type: text/markdown
30
30
 
@@ -1,5 +1,5 @@
1
1
  troubadix/__init__.py,sha256=K7sIXXDrC7YRb7BvIpdQ6ZfG_QkT0qUH_wAlHROVRfM,716
2
- troubadix/__version__.py,sha256=PTCuktvqFn_OwS3R-mZjoqzJ98AVAHDE3wA7jrDJ98s,103
2
+ troubadix/__version__.py,sha256=b9icRZhD9n_klOTCA2Qs3aV1DBh96Z_ep6dI2tY8PBE,103
3
3
  troubadix/argparser.py,sha256=YAo8cGJt0k2GMICXrDj3Z124GrM8oRwgNm2Bn3J_gYI,7001
4
4
  troubadix/codespell/codespell.additions,sha256=NAYnQF79kdk4YhU_h8fpjAVVkqBm778aPHPPP7FEkZY,504
5
5
  troubadix/codespell/codespell.exclude,sha256=W38XK8hoWWgLDCCJ7USj0YPhqzW68UN7va7bGA2n5eg,145449
@@ -36,7 +36,7 @@ troubadix/plugins/missing_desc_exit.py,sha256=GAd4FXhjX1ZEkb4hz3HqqDQVSxfuXVtuKK
36
36
  troubadix/plugins/missing_tag_solution.py,sha256=iO7_6Us3w12AVPuiGK3AUU3S62K1lcZvcGK_-fvvQtk,2828
37
37
  troubadix/plugins/multiple_re_parameters.py,sha256=9NugrcdHBmX2UO9mOuWiqxbIX1sXniZ2AhSW2pguSBE,1422
38
38
  troubadix/plugins/newlines.py,sha256=aEQOzkzd3rl9DjEi7q0EOB1M8h41WXr0O5Qf4jMFEvM,2788
39
- troubadix/plugins/overlong_description_lines.py,sha256=dF7UQ7tphkWuiXeLj4-y0zi86RumkwCCPCn2My1SIDo,3130
39
+ troubadix/plugins/overlong_description_lines.py,sha256=qBGlZpZn-WToJQhBpPMkHLvHjXpPtasvKS3PrtqtBOc,3345
40
40
  troubadix/plugins/overlong_script_tags.py,sha256=LKJQxX9s2fkExkM0MOIqYZGOKbEe9eth7DEcxFo3A8k,2356
41
41
  troubadix/plugins/prod_svc_detect_in_vulnvt.py,sha256=AnHF5jPNz4wEr-etZ2fkJNqqMH2he-9ofOdzWJyPeK4,4292
42
42
  troubadix/plugins/qod.py,sha256=OMEjZR3fbimLX4F3LsMZZn4IZi32j4soMYp1uQFv5Sc,4164
@@ -64,7 +64,7 @@ troubadix/plugins/tabs.py,sha256=7zXaTZe4cZoZvrLyqntVfTeNN_W3D8dfQl67QevXxtc,131
64
64
  troubadix/plugins/todo_tbd.py,sha256=MN5fFwBhPmt3JDQ2Hx20B8yUy1vz7LIZC3rDIOzfW9M,1758
65
65
  troubadix/plugins/trailing_spaces_tabs.py,sha256=nMly8ZsmGprxHvwCDclKBDRB0eq6JEkjERYKvtStkY4,1873
66
66
  troubadix/plugins/using_display.py,sha256=Hd-eysbXlkQb4M-ywzSd784k3aBSiG_sO6Ou0JdbyJA,4046
67
- troubadix/plugins/valid_oid.py,sha256=vKU6EA8bIepFpE3iqbEVFge3Hi2NKMo1e5NKPdAAqx8,16629
67
+ troubadix/plugins/valid_oid.py,sha256=uW7dmU2iEEh9_X_GzhalevrL1BK6bwZHn-MiiXLQWwA,17998
68
68
  troubadix/plugins/valid_script_tag_names.py,sha256=6uMJsBdV-Zx-k1F2_MWmQPHXNo1u0ifuosbftbg-27E,3447
69
69
  troubadix/plugins/variable_assigned_in_if.py,sha256=NNz8iuzyQ4rSM6My4WYC1s5TABQqgs7us15PkDA-VV0,3285
70
70
  troubadix/plugins/variable_redefinition_in_foreach.py,sha256=SfaA70TkpD9dsvNbhwJEA3eLAHWvj4YwksN-qeBMowg,2470
@@ -87,14 +87,14 @@ troubadix/standalone_plugins/changed_packages/marker/dropped_architecture.py,sha
87
87
  troubadix/standalone_plugins/changed_packages/marker/marker.py,sha256=7uZXR2Ds_8soB_2wugCkOSz_3hoX03KMh2NAW0G5Dzg,1278
88
88
  troubadix/standalone_plugins/changed_packages/package.py,sha256=Pcr2tcwiPTzD3jB0iteqA7-TajL-dl5Onh1dvC_H9xk,2743
89
89
  troubadix/standalone_plugins/common.py,sha256=PkScV-lisNY4WyrzwjV3dK1DF26hJv5JXTcREblJ0v0,1028
90
- troubadix/standalone_plugins/deprecate_vts.py,sha256=WjhJb9YkUp_5TScE9wKI856tfi7ZZ6mBQQdrE-BqQE0,7889
90
+ troubadix/standalone_plugins/deprecate_vts.py,sha256=iRYHA1_Uf1zRs0ExwNfo7Z6Jt6eSP4WBKwM6s2GyqeQ,7891
91
91
  troubadix/standalone_plugins/file_extensions.py,sha256=QLQt02WIc4SWLDTKKnG8q2g-atC7Mgus-opuXf_SX1A,2630
92
92
  troubadix/standalone_plugins/last_modification.py,sha256=oYzQq7xV3YzSvi6ZtuHuupXsJwBtO93tKfbwaIeqiJI,4616
93
93
  troubadix/standalone_plugins/no_solution.py,sha256=81r20kP8otRob2NTaCea-sgVRIM6ARvhddFdibsG6Ao,8877
94
94
  troubadix/standalone_plugins/version_updated.py,sha256=RlzVuXgFOvcjrRTOhiTYlmzV4vvcn7ntCz0lDTjePMU,4316
95
95
  troubadix/troubadix.py,sha256=foA7Loi67cCKieN3ea4s3QOfOWOkgwQVR1H-pNXtXn0,6041
96
- troubadix-25.1.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
97
- troubadix-25.1.0.dist-info/METADATA,sha256=CEPP_4BwEn8y7qGtqyd4rZrWuSZWp5bo7Fz20lM48Ds,4416
98
- troubadix-25.1.0.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
99
- troubadix-25.1.0.dist-info/entry_points.txt,sha256=LplOk4nzKrS4B8Jz0SPkQLPlIDesdraCO8Vp_eoycpc,737
100
- troubadix-25.1.0.dist-info/RECORD,,
96
+ troubadix-25.1.2.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
97
+ troubadix-25.1.2.dist-info/METADATA,sha256=Erh1zWb-N3T_kyJyytFxjtWVL5HYcr-R6t7854XByJk,4428
98
+ troubadix-25.1.2.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
99
+ troubadix-25.1.2.dist-info/entry_points.txt,sha256=LplOk4nzKrS4B8Jz0SPkQLPlIDesdraCO8Vp_eoycpc,737
100
+ troubadix-25.1.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.0
2
+ Generator: poetry-core 2.0.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any