feat: add Grype scanner integration with dual-scanner deduplication#102
Open
Aj7Ay wants to merge 1 commit into
Open
feat: add Grype scanner integration with dual-scanner deduplication#102Aj7Ay wants to merge 1 commit into
Aj7Ay wants to merge 1 commit into
Conversation
| """Test run_full_scan routes correctly for scanner='grype'.""" | ||
| from docksec.docker_scanner import DockerSecurityScanner | ||
|
|
||
| grype_json = json.dumps({ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #102 +/- ##
=======================================
Coverage ? 63.73%
=======================================
Files ? 19
Lines ? 3441
Branches ? 0
=======================================
Hits ? 2193
Misses ? 1248
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
Hello @Aj7Ay thank you for your contributions however your PR seems a bit outdated due to recent changes in the tool. Can you please rebase and update your PR accordingly? Thank you! |
Add support for Anchore Grype as an alternative/complementary vulnerability scanner alongside Trivy. Users can choose via --scanner trivy|grype|all (CLI flag or DOCKSEC_SCANNER env var). - cli.py: add --scanner flag with env var fallback - docker_scanner.py: add scan_image_grype(), _parse_grype_output(), _deduplicate_vulnerabilities() for CVE-level merge - compose_scanner.py: forward scanner param to per-service scanners - setup_external_tools.py: add install_grype() for automated setup - report_generator.py: scanner coverage stats, badges, Scanner column - report_template.html: scanner badge CSS and coverage grid section - README.md: document Grype in prerequisites, commands, and features - tests: add Grype parsing, dedup, and init tests; fix existing tests
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.
Closes #50
--scanner {trivy,grype,all}--scanner allruns both scanners and deduplicates results by CVE ID — CVEs confirmed byboth scanners are marked as highest-priority findings
DOCKSEC_SCANNERenvironment variable for CI/CD default configuration (no code changesneeded)
--scannerthrough to each service scanconfirmed-by-both counts
Sourcescolumn to CSV reportsChanges
docksec/setup_external_tools.pyinstall_grype()for macOS/Linux/Windowsdocksec/docker_scanner.pyscan_image_grype(),_parse_grype_output(),_deduplicate_vulnerabilities(), scanner routing, scanner-scoped cache keysdocksec/cli.py--scannerflag +DOCKSEC_SCANNERenv var fallbackdocksec/compose_scanner.pyscannerparam to eachDockerSecurityScannerdocksec/report_generator.pydocksec/templates/report_template.html{{SCANNER_COVERAGE_SECTION}}placeholdertests/test_docker_scanner.pytests/test_report_generator.pyREADME.md