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

Add experimental TLOG model to cosign #44

Merged
merged 8 commits into from
Mar 5, 2021
Merged

Conversation

priyawadhwa
Copy link
Contributor

@priyawadhwa priyawadhwa commented Mar 3, 2021

We turn on sending logs to the tlog by appending TLOG=1 to cosign sign and cosign verify.
I also had to add a --public-key flag to cosign sign to get this to work.

In practice this looks like:

$ TLOG=1 ./cosign sign -key cosign.key --public-key cosign.pub -a signedBy=priya2 gcr.io/priya-wadhwa/test
Enter password for private key: 
Pushing signature to: gcr.io/priya-wadhwa/test:sha256-1d7b639619bdca2d008eca2d5293e3c43ff84cbee597ff76de3b7a7de3e84956.cosign
Sucessfully appended to transparency log

$ TLOG=1 ./cosign verify -key cosign.pub -a signedBy=priya2 gcr.io/priya-wadhwa/test
{"Critical":{"Identity":{"docker-reference":""},"Image":{"Docker-manifest-digest":"1d7b639619bdca2d008eca2d5293e3c43ff84cbee597ff76de3b7a7de3e84956"},"Type":"cosign container signature"},"Optional":{"signedBy":"priya2"}}
Verified signature, payload and public key exist in transparency log

Copied most of the code for verify from rekor's verify.go

Starts to fix #34, still need to:

  • integration test
  • Add TLOG info to README
  • add in state.json feature

Priya Wadhwa added 4 commits March 3, 2021 15:49
Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
@dlorenc
Copy link
Member

dlorenc commented Mar 4, 2021

Amazing! I'll take a more detailed look tomorrow :)

@priyawadhwa
Copy link
Contributor Author

Yah I'm not totally sure about it 😅 & I think it probably still needs an integration test!

@dlorenc
Copy link
Member

dlorenc commented Mar 4, 2021

Yah I'm not totally sure about it 😅 & I think it probably still needs an integration test!

Yeah I was thinking about this - it should be straightforward to stand up a local rekor using the compose setup from over here: https://github.com/sigstore/rekor/blob/main/docker-compose.yml

Seems like you'd need an actual that grabs the rekor repo and starts up the local rekor with compose. We have a script here: https://github.com/sigstore/rekor/blob/main/tests/e2e-test.sh and here: https://github.com/sigstore/rekor/blob/main/.github/workflows/main.yml

cmd/cli/sign.go Outdated Show resolved Hide resolved
pkg/cosign/tlog/upload.go Outdated Show resolved Hide resolved
Priya Wadhwa added 3 commits March 4, 2021 11:33
…nv var to match rekor project

Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
Sets up a local rekor server via the provided docker-compose.yaml file in the rekor repo.
I tested to make sure this test fails if the local server isn't running, which is the case.

Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
@priyawadhwa
Copy link
Contributor Author

Cool, the docker-compose file seems to have worked!

@dlorenc
Copy link
Member

dlorenc commented Mar 5, 2021

So cool! I'm gonna merge and play with it :)

@dlorenc dlorenc merged commit 3dbd913 into sigstore:main Mar 5, 2021
tommyd450 pushed a commit to tommyd450/cosign that referenced this pull request Nov 7, 2023
Co-authored-by: red-hat-trusted-app-pipeline <123456+red-hat-trusted-app-pipeline[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TLOG Support
2 participants