Skip to content

Commit

Permalink
Merge pull request #786 from greenbone/vta-642
Browse files Browse the repository at this point in the history
Change: Update Windows script family
  • Loading branch information
amy-gb authored Jan 23, 2025
2 parents bd5b6c1 + f343587 commit e47fa2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/plugins/test_valid_oid.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ def test_script_family__product_microsoft_ok(self):
content = (
' script_oid("1.3.6.1.4.1.25623.1.3.11571.0.5019966.494846484649555554514651545348");'
"\n"
' script_family("Windows : Microsoft Bulletins");\n'
' script_family("Windows Local Security Checks");\n'
)
fake_context = self.create_file_plugin_context(
nasl_file=path, file_content=content
Expand All @@ -823,7 +823,7 @@ def test_script_family__product_microsoft_not_ok(self):
content = (
' script_oid("1.3.6.1.4.1.25623.1.3.11571.0.5019966.494846484649555554514651545348");'
"\n"
' script_family("Windows : Microsoft");\n'
' script_family("Windows : Microsoft Bulletin ");\n'
)
fake_context = self.create_file_plugin_context(
nasl_file=path, file_content=content
Expand All @@ -845,7 +845,7 @@ def test_oid_microsoft_ok(self):
content = (
' script_oid("1.3.6.1.4.1.25623.1.3.11571.0.5019966.494846484649555554514651545348");'
"\n"
' script_family("Windows : Microsoft Bulletins");\n'
' script_family("Windows Local Security Checks");\n'
)
fake_context = self.create_file_plugin_context(
nasl_file=path, file_content=content
Expand All @@ -861,7 +861,7 @@ def test_oid_microsoft_not_ok(self):
content = (
' script_oid("1.3.6.1.4.1.25623.1.3.11571.0.494846484649555554514651545348");'
"\n"
' script_family("Windows : Microsoft Bulletins");\n'
' script_family("Windows Local Security Checks");\n'
)
fake_context = self.create_file_plugin_context(
nasl_file=path, file_content=content
Expand Down
1 change: 1 addition & 0 deletions troubadix/plugins/script_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"Web application abuses",
"Windows",
"Windows : Microsoft Bulletins",
"Windows Local Security Checks",
]


Expand Down
3 changes: 1 addition & 2 deletions troubadix/plugins/valid_oid.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def check_content(

security_template = "Security Advisory"
family_template = "Local Security Checks"
windows_family_template = "Windows : Microsoft Bulletins"
is_using_reserved = "is using an OID that is reserved for"
invalid_oid = "is using an invalid OID"

Expand Down Expand Up @@ -388,7 +387,7 @@ def check_content(

# Fixed OID-scheme for Windows OIDs
if "1.3.6.1.4.1.25623.1.3." in oid:
if family_match.group("value") != windows_family_template:
if family_match.group("value") != f"Windows {family_template}":
yield LinterError(
f"script_oid() {is_using_reserved} 'Windows' ("
f"{str(oid)})",
Expand Down

0 comments on commit e47fa2d

Please sign in to comment.