Skip to content

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

Merged
merged 6 commits into from
Apr 22, 2025
Merged

Conversation

tembleking
Copy link
Member

No description provided.

@tembleking tembleking self-assigned this Apr 22, 2025
@tembleking tembleking requested a review from Copilot April 22, 2025 12:48
airadier
airadier previously approved these changes Apr 22, 2025
@tembleking tembleking requested a review from a team April 22, 2025 12:48
Copy link

@Copilot Copilot AI left a 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

Comment on lines 37 to 42
let layers = layers_for_result(report.result.as_ref().unwrap());

ImageScanResult {
vulnerabilities,
is_compliant,
layers: layers.unwrap_or_default(),
Copy link
Preview

Copilot AI Apr 22, 2025

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.

Suggested change
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.

@tembleking tembleking merged commit 90a4e26 into master Apr 22, 2025
4 checks passed
@tembleking tembleking deleted the feat-add-layered-analysis branch April 22, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants