Skip to content
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

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

Open
raghur-orca opened this issue Aug 8, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@raghur-orca
Copy link

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:
    - docker:dind
  script:
    - echo "Dockerfile contents....."
    - cat Dockerfile

    - echo "Image Build............."
    - docker image build -t test-app:latest .
    - docker image ls
    
    - echo "Scan image with Dockle......"
    - chmod 777 dockle
    - ./dockle --version
    - ./dockle --debug test-app:latest
  1. Dockle scan fails to read the built image with an error.

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/[email protected]/extractor/docker/docker.go:73
  - failed to initialize source:
    github.com/goodwithtech/deckoder/extractor/image.NewImage
        /home/runner/go/pkg/mod/github.com/goodwithtech/[email protected]/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...):

@raghur-orca raghur-orca added the bug Something isn't working label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant