-
Notifications
You must be signed in to change notification settings - Fork 114
Add image scope scanning option to the Linux detector #1600
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1600 +/- ##
======================================
Coverage 90.0% 90.1%
======================================
Files 437 437
Lines 37181 37285 +104
Branches 2306 2312 +6
======================================
+ Hits 33499 33606 +107
+ Misses 3210 3206 -4
- Partials 472 473 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 adds configurable image scanning scope to the Linux detector, allowing users to choose between scanning all layers (default) or only the squashed image for improved performance when intermediate layer components are not needed.
- Introduces a
LinuxScannerScopeenum withAllLayersandSquashedoptions - Adds
Linux.ImageScanScopedetector argument to configure Syft's--scopeparameter - Updates all affected interfaces, implementations, and tests to support the new parameter
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.ComponentDetection.Detectors/linux/LinuxScannerScope.cs | New enum defining the two scan scope options (AllLayers and Squashed) |
| src/Microsoft.ComponentDetection.Detectors/linux/ILinuxScanner.cs | Updated interface to add scope parameter to ScanLinuxAsync method |
| src/Microsoft.ComponentDetection.Detectors/linux/LinuxScanner.cs | Refactored command building to use scope parameter; extracts --scope flag based on enum value using switch expression |
| src/Microsoft.ComponentDetection.Detectors/linux/LinuxContainerDetector.cs | Added GetScanScope method to parse detector arguments and pass scope to scanner |
| test/Microsoft.ComponentDetection.Detectors.Tests/LinuxContainerDetectorTests.cs | Updated mock setups and added comprehensive test cases for scope parameter parsing with various inputs |
| test/Microsoft.ComponentDetection.Detectors.Tests/LinuxScannerTests.cs | Updated all test calls to include the new scope parameter (defaulting to AllLayers) |
src/Microsoft.ComponentDetection.Detectors/linux/LinuxContainerDetector.cs
Show resolved
Hide resolved
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
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
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Add the ability to configure the image scanning scope used by Syft for the Linux detector.
This allows your to pass in the argument
--DetectorArgs Linux.ImageScanScope=squashedto have the detector invoke Syft with--scope squashedinstead of the default of--scope all-layers.If components from all layers are not needed, squashed has significant performance benefits.