File tree Expand file tree Collapse file tree
cmd/osv-scanner/scan/image Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff line change 1+ FROM ubuntu:26.04@sha256:f3d28607ddd78734bb7f71f117f3c6706c666b8b76cbff7c9ff6e5718d46ff64 AS builder
2+
3+ RUN apt install --update -y curl wget
4+
5+ # Deb arch to GOARCH
6+ RUN arch="$(dpkg --print-architecture | sed -e 's/armhf/arm/g' -e 's/ppc64el/ppc64le/g')" && \
7+ curl -s https://api.github.com/repos/canonical/chisel/releases/latest \
8+ | awk "/browser_download_url/ && /chisel_v/ && /_$arch\. /" \
9+ | cut -d : -f 2,3 \
10+ | tr -d \" \
11+ | xargs wget
12+
13+ RUN sha384sum -c chisel_v*sha384
14+ RUN tar -xf chisel_v*tar.gz -C /usr/local/bin
15+ RUN mkdir /rootfs && \
16+ chisel cut --root /rootfs \
17+ base-files_base \
18+ base-files_chisel \
19+ base-files_release-info \
20+ golang_core
21+
22+ FROM scratch
23+ COPY --from=builder /rootfs/ /
You can’t perform that action at this time.
0 commit comments