Megalinter and Defect Dojo #3283
-
Has anyone tried integrating Megalinter with Defect Dojo? My team uses Defect Dojo for tracking security findings and such. Most of the findings we feed to Defect Dojo come from Snyk through their integration point. However, Defect Dojo handles a bunch of different file formats, including:
(the list is much longer -- those are just the overlap with Megalinter's repository linters and reporters) Defect Dojo also exposes an API and documents how to interact with the API manually. While searching for folks who have made this integration happen, my searches on using Megalinter with Defect Dojo were largely unhelpful, but I was able to find examples of folks who have fed Defect Dojo using
So, my first thought was to use My second thought would be to put together a plugin to provide a vector that's a little more robust than a bespoke a shell one-liner. So, questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
I don't know about Defect Dojo yet. The simplest way would be to handle this in another step of your workflow file, so, outside of Megalinter. For the linters that support SARIF, you could send these results to the service. For the rest, I'm not sure what input you need to have for that service. Is it only a pass/fail or count of problems/files/fixes or something like that? If so, it is a bit equivalent to what we call "reporters". These reporters handle how to present the result at the end of the run. |
Beta Was this translation helpful? Give feedback.
-
I was able to adapt the script I mentioned previously to upload results with very little effort. I set it to iterate across I ran Megalinter locally and used an internal DefectDojo instance. It's not accessible from the Internet, so I can't use a GitHub Action to invoke it; my next step will be to use my internal Jenkins instance and have it upload results. This is likely not a big deal to the Megalinter community or the DefectDojo community. My point in mentioning it here is if someone else gets it in their head that they want to consume findings, it's totally possible. Just make sure your linters only linting things you want them to lint or else you're going to get hundreds of findings. |
Beta Was this translation helpful? Give feedback.
-
I https://github.com/wesley-dean-flexion/upload-sarif-to-defectdojo export DD_TOKEN="${DEFECT_DOJO_AUTH_TOKEN}"
curl -s \
-o './upload_sarif_to_defectdojo.bash' \
-L 'https://raw.githubusercontent.com/wesley-dean-flexion/upload-sarif-to-defectdojo/main/upload_sarif_to_defectdojo.bash'
./upload_sarif_to_defectdojo.bash \
-p "${PRODUCT}" \
-e "${ENGAGEMENT}" \
-s "${DEFECT_DOJO_SERVER}" \
megalinter-reports/sarif/*.sarif The script can be...
Obviously, I mentioned Megalinter throughout the documentation 😉 |
Beta Was this translation helpful? Give feedback.
-
@nvuillam this is from a few months ago |
Beta Was this translation helpful? Give feedback.
I
overengineeredput together ashell scripttool to upload SARIF-formatted results to DefectDojo based on the SARIF output produced by Megalinter. I was unable to use existing tools (example) because my DefectDojo instance wasn't accessible over the Internet.https://github.com/wesley-dean-flexion/upload-sarif-to-defectdojo
The …