Only deploy signed images
Refuse a new app deployment unless every image it runs is signed by a key your organization trusts.
The policy is checked by the deploy service when an app is deployed. Running apps keep running.
Important
Turned on with no trusted key, it refuses every image except those Deutsche Cloud builds from your repositories.
Prerequisites
- Permission for
ecr:PutSigningPolicy. To open the console's Signing page,ecr:GetSigningPolicy; without it the page shows a refusal. - At least one trusted key (see Sign an image).
Turn it on
- Open Container registry, then choose Signing.
- Under Only signed images deploy, choose Turn on.
Turn off turns it off again.
dcloud ecr signing put-policy --require-signed-imagesdcloud ecr signing delete-policy turns it off; the trusted keys stay.
PUT /ecr/api/signing-policy
{ "requireSignedImages": true }resource "dcloud_ecr_signing_policy" "this" {
require_signed_images = true
depends_on = [dcloud_ecr_signing_key.release]
}Result
From then on a new deployment is refused unless every image it runs passes:
- an image from your registry must carry a signature a trusted key verifies, checked at the digest the deployment will run; a reference with neither a tag nor a digest is refused;
- an image from another registry is refused: bring it in through a pull-through cache rule, or copy it into your registry and sign it there;
- in a compose app, only the services that run images of the app's bound registry repository are checked for signatures; a service running an image of any other repository, in your registry or not, is refused as an image from another registry;
- an image Deutsche Cloud builds from your repository passes, and the deployment log says "trusted by build provenance".
A refused deployment fails with
Refused by the registry signature policy ("only signed images deploy"): …, naming each refused
image and why. A passed check is written to the deployment's log. Every check is emitted on your
event bus as ECR Image Signature Check (detail.result allowed or denied).
When the policy is turned on with no trusted key, the answer's warning is "No signing keys are
trusted yet: every image except those Deutsche Cloud builds from source will be refused."
Kubernetes clusters and Functions do not check the policy.