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

Needed to use artifact media type as consumes_mime_types of capabilities #2

Open
heww opened this issue Mar 10, 2020 · 0 comments
Open
Labels

Comments

@heww
Copy link
Collaborator

heww commented Mar 10, 2020

We are working on the OCI support in Harbor 2.0 and we will improve the user experience of artifact scanning in this release.

In Harbor 2.0, the vulnerabilities info of the artifact will display in the portal only when the artifact can be scanned by the scanner, and only scannable artifact can click the Scan button in the portal.

Harbor will use the consumes_mime_types of capabilities from scanner metadata to decide whether the artifact supported by the scanner.

Currently, the consumes_mime_types returns by the scanner always be application/vnd.oci.image.manifest.v1+json and application/vnd.docker.distribution.manifest.v2+json. These mime tyeps are the manifest media type of the artifact, and they mean that the scanner support docker image and oci image.

According to the OCI spec the manifest media type of the artifact always application/vnd.oci.image.manifest.v1+json and application/vnd.oci.image.index.v1+json. application/vnd.docker.distribution.manifest.v2+json and application/vnd.docker.distribution.manifest.list.v2+json are also supported for the backwards and forwards compatible.

The result is that the scanner supports to scan all OCI artifacts includes helm chart, regular file and others. This is not true for the scanner. Now in Harbor 2.0 we use a black list to deal this problem, when the type of the artifact in the list, we assert that the artifact is not scannable. It works but what can we do when the scanner support to scan helm chart?

In Harbor 2.0 the manifest media type for helm charts, docker image are application/vnd.oci.image.manifest.v1+json and application/vnd.docker.distribution.manifest.v2+json, but their media type are different. The media type of the helm chart is application/vnd.cncf.helm.config.v1+json and the media type of the docker image is application/vnd.docker.container.image.v1+json. So I suggest to use the artifact media type as consumes_mime_types of capabilities for the scanner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants