{"id":17747669,"url":"https://github.com/docker/attest-provider","last_synced_at":"2026-01-11T01:41:16.829Z","repository":{"id":259233438,"uuid":"804945974","full_name":"docker/attest-provider","owner":"docker","description":"OPA Gatekeeper external data provider implementation for Docker attest library image attestation verification","archived":false,"fork":false,"pushed_at":"2024-10-23T19:34:55.000Z","size":397,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-25T18:50:11.298Z","etag":null,"topics":["admission-controller","external-data-provider","gatekeeper","k8s","kubernetes","rego","supply-chain-security"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-23T15:19:53.000Z","updated_at":"2024-10-23T14:59:46.000Z","dependencies_parsed_at":"2024-10-28T14:58:56.744Z","dependency_job_id":null,"html_url":"https://github.com/docker/attest-provider","commit_stats":null,"previous_names":["docker/attest-provider"],"tags_count":20,"template":false,"template_full_name":"open-policy-agent/gatekeeper-external-data-provider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fattest-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fattest-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fattest-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fattest-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docker","download_url":"https://codeload.github.com/docker/attest-provider/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246635983,"owners_count":20809333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admission-controller","external-data-provider","gatekeeper","k8s","kubernetes","rego","supply-chain-security"],"created_at":"2024-10-26T10:00:20.414Z","updated_at":"2026-01-11T01:41:16.824Z","avatar_url":"https://github.com/docker.png","language":"Go","readme":"# Attest External Data Provider\n\nOPA Gatekeeper external data provider implementation for Docker attest library image attestation verification.\n\n## Prerequisites\n\n- [ ] [`docker`](https://docs.docker.com/get-docker/)\n- [ ] [`helm`](https://helm.sh/)\n- [ ] [`kind`](https://kind.sigs.k8s.io/)\n- [ ] [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl)\n\n## Quick Start\n\n1. Create a [kind cluster](https://kind.sigs.k8s.io/docs/user/quick-start/).\n\n```bash\nkind create cluster --name gatekeeper\n```\n\n2. Install the latest version of Gatekeeper and enable the external data feature.\n\n```bash\n# Add the Gatekeeper Helm repository\nhelm repo add gatekeeper https://open-policy-agent.github.io/gatekeeper/charts\n\n# Install the latest version of Gatekeeper with the external data feature enabled.\nhelm install gatekeeper/gatekeeper \\\n    --set enableExternalData=true \\\n    --set emitAdmissionEvents=true \\\n    --set emitAuditEvents=true \\\n    --set validatingWebhookFailurePolicy=Fail \\\n    --set validatingWebhookTimeoutSeconds=10 \\\n    --set postInstall.probeWebhook.enabled=false \\\n    --set postInstall.labelNamespace.enabled=false \\\n    --name-template=gatekeeper \\\n    --namespace security \\\n    --create-namespace\n```\n\n3. Build and deploy the external data provider.\n\n```bash\ngit clone https://github.com/docker/attest-provider.git\ncd attest-provider\n\n# if you are not planning to establish mTLS between the provider and Gatekeeper,\n# deploy the provider to a separate namespace. Otherwise, do not run the following command\n# and deploy the provider to the same namespace as Gatekeeper.\nexport NAMESPACE=security\n\n# generate a self-signed certificate for the external data provider\n./scripts/generate-tls-cert.sh\n\n# build the image via docker buildx\nmake docker-buildx\n\n# load the image into kind\nmake kind-load-image\n\n# deploy attest provider\nhelm install attest-provider charts/attest-provider \\\n    --set provider.tls.caBundle=\"$(cat certs/ca.crt | base64 | tr -d '\\n\\r')\" \\\n    --set image=\"docker/attest-provider:dev\" \\\n    --namespace \"${NAMESPACE:-gatekeeper-system}\"\n```\n\n4. Install constraint template and constraint.\n\n```bash\nkubectl apply -f validation/attest-constraint-template.yaml\nkubectl apply -f validation/attest-constraint.yaml\n```\n\n5. Test the external data provider by dry-running the following command:\n\n```bash\nkubectl create ns test\nkubectl run nginx --image nginx -n test --dry-run=server -ojson\n```\n\nGatekeeper should deny the pod admission above because the image `nginx` is missing signed annotations but has an image policy in tuf-staging.\n\nTODO: implement mutating policy (tag -\u003e digest)\n\n\u003c!-- 6. Install Assign mutation.\n\n```bash\nkubectl apply -f mutation/external-data-provider-mutation.yaml\n```\n\n7. Test the external data provider by dry-running the following command:\n\n```bash\nkubectl run nginx --image=nginx --dry-run=server -ojson\n```\n\nThe expected JSON output should have the following image field with `_valid` appended by the external data provider:\n\n```json\n\"containers\": [\n    {\n        \"name\": \"nginx\",\n        \"image\": \"nginx_valid\",\n        ...\n    }\n]\n``` --\u003e\n\n1. To reload the attest-provider image after making changes, run the following command:\n\n```bash\nmake reload\n```\n\n1. Uninstall the external data provider and Gatekeeper.\n\n```bash\nkubectl delete -f validation/\n# kubectl delete -f mutation/ TODO: implement mutation\nhelm uninstall attest-provider --namespace \"${NAMESPACE:-gatekeeper-system}\"\nhelm uninstall gatekeeper --namespace security\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Fattest-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocker%2Fattest-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Fattest-provider/lists"}