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

dockerfile-verify: inline certificate verification options #2031

Closed
thepwagner opened this issue Jun 28, 2022 · 1 comment
Closed

dockerfile-verify: inline certificate verification options #2031

thepwagner opened this issue Jun 28, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@thepwagner
Copy link

thepwagner commented Jun 28, 2022

Description

In cosign dockerfile verify, verification options like --certificate and --certificate-oidc-issuer are passed as command-line arguments.
This leaves the user burdened with mapping certificate criteria to images externally, and for multi-stage builds invoking cosign verify dockerfile multiple times.

I propose allowing the options.CertVerifyOptions to be encoded within comments of the Dockerfile:

# cosign-verify: certificate-oidc-issuer="https://token.actions.githubusercontent.com" enforce-sct=true
FROM gcr.io/test/image:v1

# cosign-verify: certificate-oidc-issuer=https://token.actions.githubusercontent.com certificate-github-workflow-repository=thepwagner/my-cool-repo certificate-github-workflow-name=release.yaml
FROM gcr.io/test/image:v1

The implementation would parse any comments preceding a FROM statement and support the same options as the CLI, expressed as key-value pairs. Values specified at the command line would overwrite those derived from comments.

Naively the VerifyDockerfileCommand could invoke the embedded VerifyCommand multiple times with each unique options.CertVerifyOptions discovered. Grouping by unique options would mean users not using the comments are unaffected.

Does anyone else want this?
Does it belong in cosign, or should it be a separate tool?

Related

@thepwagner thepwagner added the enhancement New feature or request label Jun 28, 2022
@thepwagner
Copy link
Author

Just me I guess 😆

@thepwagner thepwagner closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant