Skip to content

Commit

Permalink
Change: update windows script family
Browse files Browse the repository at this point in the history
  • Loading branch information
amy-gb committed Jan 22, 2025
1 parent bd5b6c1 commit b3c00ff
Show file tree
Hide file tree
Showing 2 changed files with 5 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
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 b3c00ff

Please sign in to comment.