-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add layered analysis support #7
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
Conversation
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.
Pull Request Overview
This PR introduces layered analysis support for container image scanning, enabling per-layer vulnerability reporting and enhanced diagnostics for Dockerfiles.
- Implements conversion from SysdigImageScannerReport to a new image scan result structure with per-layer details.
- Updates diagnostic functions and tests to account for individual layer vulnerabilities.
- Adds a new Dockerfile parser and updates docs and versioning to reflect these changes.
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/infra/sysdig_image_scanner_result.rs | Adds conversion logic to include layer-based vulnerability information |
src/infra/sysdig_image_scanner.rs | Simplifies scan_image using the new conversion, removing deprecated logic |
src/infra/dockerfile_ast_parser.rs | Introduces a new Dockerfile parser to support detailed layered analysis |
src/infra/docker_image_builder.rs | Cleans up commented-out logging code and uses a build_info variable for image IDs |
src/app/image_scanner.rs | Updates ImageScanResult and related types to support a vector of vulnerabilities |
src/app/commands.rs | Updates diagnostic reporting to include layered vulnerability details |
docs/features/ and README.md | Updates documentation to include layered analysis support |
Cargo.toml | Bumps version from 0.4.1 to 0.5.0 |
Files not reviewed (1)
- tests/fixtures/Dockerfile: Language not supported
let layers = layers_for_result(report.result.as_ref().unwrap()); | ||
|
||
ImageScanResult { | ||
vulnerabilities, | ||
is_compliant, | ||
layers: layers.unwrap_or_default(), |
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.
Using unwrap() here may lead to a panic if report.result is None. Consider handling the None case explicitly.
let layers = layers_for_result(report.result.as_ref().unwrap()); | |
ImageScanResult { | |
vulnerabilities, | |
is_compliant, | |
layers: layers.unwrap_or_default(), | |
let layers = report | |
.result | |
.as_ref() | |
.and_then(|result| layers_for_result(result)) | |
.unwrap_or_default(); | |
ImageScanResult { | |
vulnerabilities, | |
is_compliant, | |
layers, |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
No description provided.