-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add sarif conversion to Nessus postprocess() #261
Add sarif conversion to Nessus postprocess() #261
Conversation
scanners/nessus/nessus_none.py
Outdated
@@ -12,6 +15,7 @@ | |||
from configmodel import RapidastConfigModel | |||
from scanners import RapidastScanner | |||
from scanners import State | |||
from scanners.generic.tools.convert_nessus_csv_to_sarif import convert_csv_to_sarif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should have asked for this in last PR, but could you add a basic test for this function, you might find examples in tests/scanners/generic/tools/test_convert_trivy_k8s.py
helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on this now. Reviewing the directory structure a bit more, does it make more sense to move the convert_nessus_csv_to_sarif file to something like scanners/nessus/tools instead of the generic directory where it is currently located as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests added. Went ahead and did that move, which can obviously be undone.
The linter is unhappy, but I believe it is only the Nessus CSV file formatting it takes issue with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gah that's annoying. Try adding this patch to exclude CSV files from this check:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8408bc9..878ab3e 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -4,6 +4,7 @@ repos:
hooks:
- id: trailing-whitespace
language_version: python3
+ exclude: \.csv$
- id: end-of-file-fixer
- id: debug-statements
language_version: python3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That worked! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The suggested patch should solve the linting issue
No description provided.