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

read attestation from stdin in attest cmd #2215

Closed
developer-guy opened this issue Sep 1, 2022 · 1 comment · Fixed by #2269
Closed

read attestation from stdin in attest cmd #2215

developer-guy opened this issue Sep 1, 2022 · 1 comment · Fixed by #2269
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@developer-guy
Copy link
Member

Description

We(w/@Dentrax)'ve opened an issue in the Trivy project related to the signing attestation before saving it to the disk.1 A similar work has also been done in the Syft project.2 Thanks to @knqyf263, he came up with an interesting idea, if we pass attestations via a pipe in attest cmd, then all security scanners don't have to re-implement cosign functionalities. So, the UX would be like the following:

trivy image -f cosin-vuln <IMAGE> | COSIGN_EXPERIMENTAL=1 cosign attest --type vuln --predicate - <IMAGE>

This makes a lot of sense to me, so I've raised an issue in Cosign to discuss further; if you like the idea, I'm willing to work on it, thanks.

Footnotes

  1. https://github.com/aquasecurity/trivy/issues/2758

  2. https://github.com/anchore/syft/pull/785

@developer-guy developer-guy added the enhancement New feature or request label Sep 1, 2022
@znewman01 znewman01 added the good first issue Good for newcomers label Sep 2, 2022
@znewman01
Copy link
Contributor

FWIW you can do this today in bash or zsh (though not sh) with process substitution:

COSIGN_EXPERIMENTAL=1 cosign attest \
    --type vuln \
    --predicate <(trivy image -f cosin-vuln <IMAGE>) \
    <IMAGE>

That said, I still think accepting - is convenient and a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants