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 Images with its Manifest Digest #262

Open
raghur-orca opened this issue Aug 8, 2024 · 0 comments
Open

Dockle Error while scanning Images with its Manifest Digest #262

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

Comments

@raghur-orca
Copy link

raghur-orca commented Aug 8, 2024

Description

  1. If i scan an image with its Manifest Digest, say alpine without pulling it locally - we don't see an issue in scanning it with Dockle.
# dockle --debug alpine@sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78
WARN	- CIS-DI-0001: Create a user for the container
	* Last user should not be root
INFO	- CIS-DI-0005: Enable Content trust for Docker
	* export DOCKER_CONTENT_TRUST=1 before docker pull/build
INFO	- CIS-DI-0006: Add HEALTHCHECK instruction to the container image
	* not found HEALTHCHECK statement
  1. However, If we pull the same image with its Manifest Digest to the local environment - Dockle unable to scan the image with its Digest.
# docker image pull alpine@sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78
docker.io/library/alpine@sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78: Pulling from library/alpine
c6a83fedfae6: Already exists
Digest: sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78
Status: Downloaded newer image for alpine@sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78
docker.io/library/alpine@sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78

# docker image ls alpine
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
alpine       <none>    324bc02ae123   2 weeks ago   7.8MB

# dockle alpine@sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78
2024-08-08T05:10:15.556Z	FATAL	unable to initialize a image struct: failed to initialize source: failed to initialize: Manifest does not match provided manifest digest sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78

# dockle 324bc02ae123
2024-08-08T05:10:23.543Z	FATAL	unable to initialize a image struct: failed to initialize source: reading manifest latest in docker.io/library/324bc02ae123: requested access to the resource is denied

What did you expect to happen?
Scan the image with its Manifest Digest just like how Dockle scans the images placed in the remote registry/repo.

What happened instead?
2024-08-08T05:10:15.556Z FATAL unable to initialize a image struct: failed to initialize source: failed to initialize: Manifest does not match provided manifest digest sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78

Output of run with -debug:

# dockle --debug alpine@sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78
2024-08-08T05:31:28.280Z	DEBUG	There is no .dockleignore file
2024-08-08T05:31:28.280Z	DEBUG	Skipped update confirmation
2024-08-08T05:31:28.280Z	DEBUG	Start assessments...
2024-08-08T05:31:28.340Z	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
  - failed to initialize:
    github.com/goodwithtech/deckoder/extractor/image.newSource
        /home/runner/go/pkg/mod/github.com/goodwithtech/[email protected]/extractor/image/image.go:118
  - Manifest does not match provided manifest digest sha256:eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78

Output of dockle -v:

# dockle --version
dockle version 0.4.14

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

  1. Used alpine latest image hosted in Dockerhub for this replication - https://hub.docker.com/layers/library/alpine/latest/images/sha256-eddacbc7e24bf8799a4ed3cdcfa50d4b88a323695ad80f317b6629883b2c2a78?context=explore
@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