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

sign vulnerability attestation before saving it to the disk #2758

Closed
developer-guy opened this issue Aug 22, 2022 · 5 comments
Closed

sign vulnerability attestation before saving it to the disk #2758

developer-guy opened this issue Aug 22, 2022 · 5 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@developer-guy
Copy link
Contributor

We (w/@Dentrax) thought there was a slight time window that the attacker could gain access to the system and changes the content of the vulnerability attestation before you sign and upload it to the registry. A similar problem has been addressed in the Syft project for SBOM attestations1. So, we should sign the vulnerability attestation before saving it to the disk.

If you like the idea, we are willing to do that, and please share your thoughts, thanks.
cc: @knqyf263 @itaysk

Footnotes

  1. https://anchore.com/sbom/creating-sbom-attestations-using-syft-and-sigstore/

@developer-guy developer-guy added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 22, 2022
@knqyf263
Copy link
Collaborator

What if we pass attestations via pipe?

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

Then, all security scanners don't have to re-implement cosign functionalities.

@developer-guy
Copy link
Contributor Author

Quoted from @znewman01:

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>

@znewman01
Copy link

But also note @developer-guy's PR to accept - to read from STDIN: sigstore/cosign#2215

That's a better long-term solution 😄

@knqyf263
Copy link
Collaborator

Looks like @developer-guy'S PR got merged. Thanks for your help.

@itaysk
Copy link
Contributor

itaysk commented Sep 29, 2022

We should probably update the docs still

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants