-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update 12 parsers to have better metadata #11900
Conversation
DryRun Security SummaryMultiple security scanner parsers in DefectDojo were updated with new get_fields() and get_dedupe_fields() methods, fixing various syntax errors, typos, and documentation issues while addressing potential security concerns like hardcoded severity values and information disclosure risks. Expand for full summaryThe PR adds new
Code AnalysisWe ran |
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.
Approved
"epss_percentile", | ||
] | ||
|
||
def get_dedupe_fields(self) -> list[str]: |
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.
Just a question: Where is the info of get_dedupe_fields returned?
And: Is it possible to load the fields directly from settings.dist.py with the help of method get_scan_types?
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.
Just a question: Where is the info of get_dedupe_fields returned?
Right now, nowhere.
This is some early work to eventually add the ability to do checks of dedup settings against what a parser actually offers in terms of fields to dedup on.
Today, in your settings file (local_settings.py) you can do things like put line
as a dedup setting for Zap.
Now, this doesn't 'hurt' the person who does this but it also doesn't make their dedup any more accurate since Zap will never report a line number like a SAST tool would.
So, before we can do things like sanity check dedup settings and provide some sort of warning that you picked a field that isn't provided by that parser, we need functions like this do DefectDojo can 'know' that.
And: Is it possible to load the fields directly from settings.dist.py with the help of method get_scan_types?
Possibly. We need to have these in place before we decide on the best place to use them. I mentioned ☝️ what my early thinking is the project hasn't really settled on the best way to use this - could be a log message, an alert, something else. That's TBD.
Make sense?
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.
And, full disclosure, I'm the one that gave the intern this work 😏
There should me more PRs for more tools - this was their first PR in the effort.
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.
Thank you for the clarification. From my point of view this is a nice feature to give feedback about deduplication settings and I would love a general way to maintain deduplication at one place, but let's see how this initative evolves.
Description
I am a Defect Dojo intern and I wrote docstrings for the 12 parsers to describe the fields it returns and to also describe the fields used for dedupe. Parsers with docstrings added are: Burp, Aqua, Bandit, Checkmarx, Cargo_Audit, Brakeman, Zap, Semgrep, Snyk, Qualys, and Gitleaks.
Note: The Aqua parser appears to have multiple versions (v1 and v2). I am unsure with which one is in use so I wrote docstrings for both but I have the v2 docstrings commented out.