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 attestation entry point to Docker Images #1476

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

fabergat
Copy link
Collaborator

@fabergat fabergat commented Mar 5, 2025

Description

This PR adds the support to the attestation verification in offline mode and give a suggestion on how to override the Docker entry point for Docker and Docker Compose.

Closes: #1310

Note:

The key material in trusted_root.jsonl does not have a built-in expiration date, so anything signed before you generate the trusted root file will continue to successfully verify. Anything signed after the file is generated will verify until that Sigstore instance rotates its key material, which typically happens a few times per year. You will not know if key material has been revoked since you last generated the trusted root file.

Open questions:

  • Is this thing adding a lot more security?
  • Is it worth it complicate the config?

Changes

Testing Information

Checklist:

  • I have performed a self-review of my code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@fabergat fabergat marked this pull request as ready for review March 5, 2025 15:14
@fabergat fabergat requested review from aldur and djordon March 10, 2025 14:34
@djordon djordon added this to the sBTC: Withdrawal fine tuning milestone Mar 10, 2025
@djordon djordon added the chore label Mar 10, 2025
@aldur aldur requested a review from fdefelici March 10, 2025 14:45
Copy link

@fdefelici fdefelici left a comment

Choose a reason for hiding this comment

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

Added few remarks.

I need also a clarification, to check if my undestanding is right about this need.
We are offering this attestation verification and related samples, to allow a user to create its own docker image with blockstack-cli and signer binary?

@@ -0,0 +1,24 @@
#!/bin/bash

Choose a reason for hiding this comment

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

Rename this file entry_point.sh in order to match the entrypoint.sh file referred in the README.md

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done


This will:
1. **Set up the Docker container** with the required environment variables for attestation.
2. **Use `/entrypoint.sh`**: The entry point script checks the attestation and proceeds if verified.

Choose a reason for hiding this comment

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

Add hyperlink to the entry point file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

- `BUNDLE_PATH="/path/to/your/bundle.jsonl"`: Specifies the local path to the attestation bundle file.
- `TRUSTED_ROOT_PATH="/path/to/your/trusted_root.jsonl"`: Specifies the local path to the trusted root file for the attestation.

2. **Use `/entrypoint.sh`**: The entrypoint of the Docker image is overridden to run the `entrypoint.sh` script, which performs the attestation verification before running the application.

Choose a reason for hiding this comment

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

Add hyperlink to the entry point file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

/usr/local/bin/blocklist-client
```

This command will:

Choose a reason for hiding this comment

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

Considering the section "Enviroment Variables", The description could be simplified in something like this:

The commands above:
1. **Set the environment variables**: `TAG`, `BUNDLE_PATH` and `TRUSTED_ROOT_PATH`
2. .... 

By this the message is still the same, but get rid off duplication respect of the "Environment Variables" section

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@fabergat
Copy link
Collaborator Author

Added few remarks.

I need also a clarification, to check if my undestanding is right about this need. We are offering this attestation verification and related samples, to allow a user to create its own docker image with blockstack-cli and signer binary?

We would like to enforce another small step that automate the process to verify the images source, the idea is to limit the the possibility to run unsigned software. To add to our signer plus the partners

Copy link
Collaborator

@aldur aldur left a comment

Choose a reason for hiding this comment

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

Can you also modify the files under https://github.com/stacks-network/sbtc/blob/main/docker/mainnet/docker-compose.yml and the testnet corresponding version?

@aldur aldur deployed to Push to Docker March 12, 2025 14:00 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

[Feature]: Have our production Docker builds verify their attestation at runtime, before running
4 participants