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

feat: add signing certificate to envelope #330

Merged
merged 4 commits into from
Jun 17, 2022

Conversation

asraa
Copy link
Collaborator

@asraa asraa commented Jun 16, 2022

Signed-off-by: Asra Ali asraa@google.com

Adds a PEM-encoded certificate to the DSSE envelope's signatures. Testing was done to ensure

  1. We can add and retrieve the signing cert (the verifier will need the retrieval)
  2. Rekor's intoto entry can validate this "slightly off-spec" envelope.

e2e test using this generator code and my verifier PR: https://github.com/asraa/slsa-on-github-test/actions/runs/2516202385

$ go run . -artifact-path ~/Downloads/binary-linux-amd64 -provenance ~/Downloads/binary-linux-amd64.intoto.jsonl -source github.com/asraa/slsa-on-github-test
Verified signature against tlog entry index 2694513 at URL: https://rekor.sigstore.dev/api/v1/log/entries/bf2882983fc8b0652902eab8500b540e1bb2530f91c004a7d6f0c204d703ded7
Signing certificate information:
 {
	"caller": "asraa/slsa-on-github-test",
	"commit": "e8c34fe013f732e9beb61a94b4667e1d30cde82e",
	"job_workflow_ref": "/asraa/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@refs/heads/add-cert-to-envelope",
	"trigger": "workflow_dispatch",
	"issuer": "https://token.actions.githubusercontent.com"
}
FAILED: SLSA verification failed: untrusted reusable workflow: asraa/slsa-github-generator/.github/workflows/builder_go_slsa3.yml
exit status 2

Signed-off-by: Asra Ali <asraa@google.com>
Copy link
Collaborator

@laurentsimon laurentsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Maybe add a test to verify it works as expected

signing/envelope/envelope.go Show resolved Hide resolved
signing/envelope/envelope.go Show resolved Hide resolved
@ianlewis
Copy link
Member

ianlewis commented Jun 16, 2022

+1 for adding a test

@asraa
Copy link
Collaborator Author

asraa commented Jun 17, 2022

Thanks! I'll work on adding a test tomorrow morning, for now I have been able to "retroactively verify" the v1.1.0 release by manually constructing the correct envelope (inserted certPEM) with the code in: slsa-framework/slsa-verifier#97

now to test e2e and add testing (and remove duped code)

Signed-off-by: Asra Ali <asraa@google.com>
@asraa
Copy link
Collaborator Author

asraa commented Jun 17, 2022

Added envelope tests! See PR description.

@asraa asraa changed the title WIP: add signing certificate to envelope feat: add signing certificate to envelope Jun 17, 2022
@asraa asraa enabled auto-merge (squash) June 17, 2022 18:10
@asraa asraa merged commit cb8f03b into slsa-framework:main Jun 17, 2022
asraa added a commit to asraa/slsa-github-generator that referenced this pull request Jun 20, 2022
* add signing certificate to envelope

Signed-off-by: Asra Ali <asraa@google.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.

3 participants