Skip to content

Commit 57b8b78

Browse files
feat: import chisel in scalibrplugin (#2772)
## Description This PR imports the `os/chisel` extractor from the [osv-scalibr](https://github.com/google/osv-scalibr) in the `scalibrplugin/presets.go` to enable the scanning of container images built with [Chisel](https://github.com/canonical/chisel). The description of `Ubuntu chiseled packages` is added to `docs/supported_languages_and_lockfiles.md`, which corresponds to the changes of this PR. This PR expects no breaking changes nor regressive UX to be introduced to the OSV-Scanner. ## Related pull requests google/osv-scalibr#764 google/osv-scalibr#2018 P.S. I've run `make refresh-all REBUILD_IMAGES=true` to update the snapshots. FYI: @cjdcordeiro --------- Co-authored-by: Rex P <rexpan@google.com> Co-authored-by: Rex P <106129829+another-rex@users.noreply.github.com>
1 parent 1f0bd83 commit 57b8b78

15 files changed

Lines changed: 1971 additions & 83 deletions

cmd/osv-scanner/scan/image/__snapshots__/command_test.snap

Lines changed: 362 additions & 7 deletions
Large diffs are not rendered by default.

cmd/osv-scanner/scan/image/command_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,14 @@ func TestCommand_OCIImage(t *testing.T) {
363363
},
364364
Exit: 1,
365365
},
366+
{
367+
Name: "scanning_insecure_chiseled_ubuntu_image",
368+
Args: []string{
369+
"", "image",
370+
"--archive", "./testdata/test-chisel.tar",
371+
},
372+
Exit: 1,
373+
},
366374
}
367375
for _, tt := range tests {
368376
t.Run(tt.Name, func(t *testing.T) {
@@ -499,6 +507,20 @@ func TestCommand_OCIImage_JSONFormat(t *testing.T) {
499507
testutility.AnyDiffID,
500508
},
501509
},
510+
{
511+
Name: "scanning_insecure_chiseled_ubuntu_image",
512+
Args: []string{
513+
"", "image", "--format=json",
514+
"--archive", "./testdata/test-chisel.tar",
515+
},
516+
Exit: 1,
517+
ReplaceRules: []testutility.JSONReplaceRule{
518+
testutility.GroupsAsArrayLen,
519+
testutility.OnlyIDVulnsRule,
520+
testutility.OnlyFirstBaseImage,
521+
testutility.AnyDiffID,
522+
},
523+
},
502524
}
503525
for _, tt := range tests {
504526
t.Run(tt.Name, func(t *testing.T) {

0 commit comments

Comments
 (0)