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

Attestation materials server side verification #35

Open
migmartri opened this issue Mar 15, 2023 · 0 comments
Open

Attestation materials server side verification #35

migmartri opened this issue Mar 15, 2023 · 0 comments

Comments

@migmartri
Copy link
Member

migmartri commented Mar 15, 2023

IMPORTANT: This will be potentially superseded by #122

During the attestation process, the CLI will make sure that before crafting, signing and pushing the in-toto attestation to the control-plane, it meets the requirements of the associated workflow contract.

For example, this is an in-progress attestation that requires three materials, two of them have not been provided yet.

$ chainloop att status
┌───────────────────┬──────────────────────────────────────┐
│ Initialized At    │ 15 Mar 23 11:48 UTC                  │
├───────────────────┼──────────────────────────────────────┤
│ Workflow          │ 37022b2f-34c3-4f47-9fd7-514b4a7baaad │
│ Name              │ build-and-release                    │

┌───────────────────────────────────────────────────────────┐
│ Materials                                                 │
├────────┬─────────────────────┬─────┬──────────┬───────────┤
│ NAME   │ TYPE                │ SET │ REQUIRED │ IS OUTPUT │
├────────┼─────────────────────┼─────┼──────────┼───────────┤
│ image  │ CONTAINER_IMAGE     │ Yes │ Yes      │ x         │
│ binary │ ARTIFACT            │ No  │ Yes      │           │
│ sbom   │ SBOM_CYCLONEDX_JSON │ No  │ Yes      │           │
└────────┴─────────────────────┴─────┴──────────┴───────────┘

When you try to push it, the CLI will complain

$ chainloop att push
ERR some materials have not been crafted yet: binary, sbom

A similar server-side validation is not been performed in the server side.

This task is about implementing server side validations on the control plane API Attestation.Store method

rpc Store (AttestationServiceStoreRequest) returns (AttestationServiceStoreResponse);

This validation must

  • Unpack the received DSSE envelope and extract the attestation,
  • Make sure that the attestation is for the workflow run we receive as part of the robot-account token
  • Verify it's content against the contract revision associated with the workflow run.

For a future task, we should look into verifying the DSSE payload by checking the signature, but to do that we might need to also sign the envelope with a key known by the control plane. Currently the payload is signed by a key provided by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant