feat: add Grype scanner integration with dual-scanner deduplication#102
Open
Aj7Ay wants to merge 2 commits into
Open
feat: add Grype scanner integration with dual-scanner deduplication#102Aj7Ay wants to merge 2 commits into
Aj7Ay wants to merge 2 commits into
Conversation
Closes OWASP#50 - Add `install_grype()` to setup_external_tools.py (macOS/Linux/Windows) - Add `--scanner {trivy,grype,all}` CLI flag and `DOCKSEC_SCANNER` env var - Add `_parse_grype_output()` normalizing Grype JSON to DockSec's internal schema - Add `_deduplicate_vulnerabilities()` merging Trivy + Grype by CVE ID with sources tracking - Add `scan_image_grype()` method mirroring `scan_image_json()` interface - Route `run_full_scan()` and `run_image_only_scan()` by scanner mode (trivy/grype/all) - Add `_cache_key` property scoped to scanner mode to prevent cross-scanner cache hits - Add Scanner Coverage section to HTML/JSON reports with per-CVE scanner badges - Add `Sources` column to CSV reports; `scanner_coverage` object to JSON reports - Pass `scanner` param through `ComposeOrchestrator` to all service scanners - Update README with `--scanner` usage, env var, and comparison table row - Add 21 new unit tests (46 total in test_docker_scanner.py, 99 total pass)
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