Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Update Windows script family #786

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading