goodwithtech / dockle

Container Image Linter for Security, Helping build the Best-Practice Docker Image, Easy to start
https://containers.goodwith.tech/
Apache License 2.0
2.75k stars 138 forks source link

Dockle Error while scanning an Image built on a Gitlab SaaS Runner #263

Open raghur-orca opened 1 month ago

raghur-orca commented 1 month ago

Description

  1. Am making use of Gitlab SaaS Runner to build an image and then scan it with Dockle binary.
  2. The Runner's environment that am making use of for this pipeline is docker image with dind service.
  3. Here's my Gitlab workflow YAML file:
    
    # cat .gitlab-ci.yaml
    stages:
    - build-scan-image

build-scan-image: stage: build-scan-image image: docker:latest services:

What did you expect to happen? Parse the image and identify the mis-configurations.

What happened instead?

2024-08-08T05:17:38.236Z    FATAL   unable to initialize a image struct: failed to initialize source: reading manifest latest in docker.io/library/test-app: requested access to the resource is denied

Output of run with -debug:

$ ./dockle --debug test-app:latest
2024-08-08T05:59:50.695Z    DEBUG   There is no .dockleignore file
2024-08-08T05:59:50.695Z    DEBUG   Skipped update confirmation
2024-08-08T05:59:50.695Z    DEBUG   Start assessments...
2024-08-08T05:59:51.043Z    FATAL   unable to initialize a image struct:
    github.com/goodwithtech/deckoder/extractor/docker.newDockerExtractor
        /home/runner/go/pkg/mod/github.com/goodwithtech/deckoder@v0.0.5/extractor/docker/docker.go:73
  - failed to initialize source:
    github.com/goodwithtech/deckoder/extractor/image.NewImage
        /home/runner/go/pkg/mod/github.com/goodwithtech/deckoder@v0.0.5/extractor/image/image.go:86
  - reading manifest latest in docker.io/library/test-app: requested access to the resource is denied

Output of dockle -v:

dockle version 0.4.14

Additional details (base image name, container registry info...):