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 and verify images made/used in all Makefiles and docker-compose files #2544

Closed
1 task
mogul opened this issue Dec 10, 2020 · 5 comments
Closed
1 task

Comments

@mogul
Copy link
Contributor

mogul commented Dec 10, 2020

User Story

In order to have a verifiable supply chain for Docker-based workflows and operations, the team wants to use Docker Content Trust to verify pulled images haven't been tampered with before using them.

Acceptance Criteria

[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]

  • GIVEN we set our environment to use a registry with tampered images
    WHEN we run a make or docker-compose that pulls its images from that registry
    THEN we see an error indicating that the image could not be verified.

Background

[Any helpful contextual notes or links to artifacts/evidence, if needed]
We mostly use Docker Official Images from hub.docker.com, where the images were based on Dockerfiles provided directly by the teams that create the software. These images are generated directly by Docker Hub, which uses Notary to sign the created images. However, we aren't checking those Notary signatures when we pull and use images. We should!

See section 10.8.4 in the data.gov SSP for additional context.

Security Considerations (required)

[Any security concerns that might be implicated in the change. "None" is OK, just be explicit here!]
This only tightens our security and makes it obvious whenever we do not rely on official images (because they will fail to run).

Sketch

[Notes or a checklist reflecting our understanding of the selected approach]

  • In all Makefiles: Make sure we set DOCKER_CONTENT_TRUST=1.
  • Use trusted-compose instead of docker-compose.
  • In our own Dockerfiles, prefix any referenced image name with an environment variable:
ARG DOCKER_REGISTRY
FROM ${DOCKER_REGISTRY}debian:stable
@mogul mogul changed the title Use Docker Content Trust in all Makefiles/docker-compose files Verify signatures on images used in all Makefiles and docker-compose files Dec 10, 2020
@mogul mogul changed the title Verify signatures on images used in all Makefiles and docker-compose files Use Docker Content Trust to verify images used in all Makefiles and docker-compose files Dec 31, 2020
@mogul mogul changed the title Use Docker Content Trust to verify images used in all Makefiles and docker-compose files Use Docker Content Trust to verify images made/used in all Makefiles and docker-compose files Apr 7, 2021
@adborden adborden changed the title Use Docker Content Trust to verify images made/used in all Makefiles and docker-compose files Sign and verify images made/used in all Makefiles and docker-compose files Apr 22, 2021
@adborden
Copy link
Contributor

Just want to add that we should consider GSA-TTS/datagov-brokerpak-eks#13 when looking at this story. We'd prefer to use the same signature/verification scheme for container images in local development and production.

@mogul
Copy link
Contributor Author

mogul commented Jun 2, 2021

I just stumbled across cosign which might be useful in a variety of workflows!

@mogul
Copy link
Contributor Author

mogul commented Jun 2, 2021

Related: the umbrella sigstore project.

@mogul
Copy link
Contributor Author

mogul commented Jun 2, 2021

compose is now available as a sub-command of the main docker binary. I think if we use it that way then DOCKER_CONTENT_TRUST is all we need.

@mogul mogul moved this to Icebox in data.gov team board Dec 3, 2021
@mogul mogul changed the title Sign and verify images made/used in all Makefiles and docker-compose files Sign and verify images made/used in all Makefiles and docker-compose files Dec 4, 2021
@mogul mogul changed the title Sign and verify images made/used in all Makefiles and docker-compose files Sign and verify images made/used in all Makefiles and docker-compose files Dec 4, 2021
@mogul
Copy link
Contributor Author

mogul commented Jan 1, 2022

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

No branches or pull requests

3 participants