Reimporting SCB Findings from OWASP DefectDojo after persisting them#330
Merged
Reimporting SCB Findings from OWASP DefectDojo after persisting them#330
Conversation
…rsistenceProvider
⚠️ Had to manually change the finishedAt timestamp of the ScanStatus Class, this was still generating the deprecated joda DateTime classes, which do not build correctly with the corrent Kubernetes client-java anymore
…gs to SCB Findings
# Conflicts: # hooks/persistence-defectdojo/src/main/java/io/securecodebox/persistence/strategies/Strategy.java # hooks/persistence-defectdojo/src/main/java/io/securecodebox/persistence/strategies/VersionedEngagementsStrategy.java
a8ec0c8 to
d84dbb0
Compare
rfelber
reviewed
Mar 19, 2021
...nce-defectdojo/src/main/java/io/securecodebox/persistence/DefectDojoPersistenceProvider.java
Outdated
Show resolved
Hide resolved
d91fefe to
704499a
Compare
rfelber
approved these changes
Mar 25, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the DefectDojo Hook from a
ReadOnly Hookto aReadAndWrite Hook.After uploading the
raw resultfindings of different SCB scanner to OWASP DefectDojo this extension is responsible for importing the uploaded findings back to the secureCodeBox. This lets us import the false positive / duplicate status from DefectDojo attributes to the scans findings in further hooks, e.g. slack notification or later on elasticSearch persistence.The imported findings from DefectDojo are mapped back to the secureCodeBox finding format and overwrite the original secureCodeBox findings from the parser. Here's a example mapped finding:
{ "id": "fdc841ef-ef22-45e8-8ecd-c6f246312eb0", "name": "Content Security Policy (CSP) Header Not Set", "location": "http://juice-shop:3000", "description": "Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware. CSP provides a set of standard HTTP headers that allow website owners to declare approved sources of content that browsers should be allowed to load on that page — covered types are JavaScript, CSS, HTML frames, fonts, images and embeddable objects such as Java applets, ActiveX, audio and video files.\n\nReference: https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Introducing_Content_Security_Policyhttps://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.htmlhttp://www.w3.org/TR/CSP/http://w3c.github.io/webappsec/specs/content-security-policy/csp-specification.dev.htmlhttp://www.html5rocks.com/en/tutorials/security/content-security-policy/http://caniuse.com/#feat=contentsecuritypolicyhttp://content-security-policy.com/\n\nURL: http://juice-shop:3000/ftp/\nMethod: GET\n\nURL: http://juice-shop:3000/ftp\nMethod: GET\n\nURL: http://juice-shop:3000/ftp/coupons_2013.md.bak\nMethod: GET\n\nURL: http://juice-shop:3000/ftp/suspicious_errors.yml\nMethod: GET\n\nURL: http://juice-shop:3000/ftp/encrypt.pyc\nMethod: GET\n\nURL: http://juice-shop:3000/ftp/eastere.gg\nMethod: GET\n\nURL: http://juice-shop:3000/\nMethod: GET\n\nURL: http://juice-shop:3000/ftp/package.json.bak\nMethod: GET\n\nURL: http://juice-shop:3000/ftp/quarantine\nMethod: GET\n\nURL: http://juice-shop:3000\nMethod: GET\n\nURL: http://juice-shop:3000/sitemap.xml\nMethod: GET\n", "category": "DefectDojo Imported Finding", "severity": "Medium", "attributes": { "defectdojo.org/finding-id": 10414, "defectdojo.org/finding-url": "https://defectdojo.example.com/finding/10414", "defectdojo.org/test-id": 588, "falsePositive": false, "defectdojo.org/test-url": "https://defectdojo.example.com/test/588", "duplicate": true }, "osi_layer": null }I updated the Kubernetes Client version and regenerated the autogenerated Classes for the CRD's which causes probably 98% of this PR diff, you can skip passed them (everything under
io.securecodebox.modelsin commit a9e519b).