Skip to main content

AWS ECR

CCF compliance plugin for AWS Elastic Container Registry (ECR). Evaluates private ECR repositories and container image scan results against SOC2 TSC 2017 controls.

This page is for operators who run the plugin-aws-ecr plugin with the CCF Agent, and for developers who write policies for it. It documents v0.1.3 and is generated from the plugin's README at v0.1.3.

Requirements​

Required IAM actions​

{
"Effect": "Allow",
"Action": [
"ecr:DescribeRepositories",
"ecr:GetLifecyclePolicy",
"ecr:GetRepositoryPolicy",
"ecr:ListTagsForResource",
"ecr:GetRegistryScanningConfiguration",
"ecr:DescribeImages",
"ecr:DescribeImageScanFindings"
],
"Resource": "*"
}

Configuration​

KeyTypeRequiredDescription
regionsstringYesComma-separated AWS regions to scan (e.g. "us-east-1,eu-west-1")
accountsstringNoComma-separated account IDs to filter on. If omitted, all repositories in the region are evaluated.
policy_labelsstring (JSON)NoExtra labels added to every Evidence record (e.g. {"env":"prod"})

Evidence collected​

What it checks​

CONFIG checks (per repository)​

CheckDescriptionControls
ecr_require_scan_on_pushimageScanningConfiguration.scanOnPush must be trueCC5.3, CC6.8, CC7.1
ecr_require_tag_immutabilityimageTagImmutability must be IMMUTABLECC6.8, CC8.1
ecr_require_encryptionEncryption type must be in approved_encryption_typesCC5.2
ecr_require_lifecycle_policyRepository must have a lifecycle policy configuredCC6.5
ecr_deny_public_accessResource policy must not grant Principal: "*" with Effect: AllowCC6.8, CC8.1
ecr_require_tagsRepository must carry all required_repository_tagsCC6.1

CONFIG checks (per registry / account+region)​

CheckDescriptionControls
ecr_require_registry_scanningRegistry-level scan type must be in approved_registry_scan_typesCC5.2, CC5.3, CC7.1

DYNAMIC checks (per image digest, 90-day lookback)​

CheckDescriptionControls
ecr_require_image_scan_completeImage scan status must be COMPLETECC3.2, CC5.2, CC7.1, CC8.1
ecr_require_no_critical_image_findingsCRITICAL finding count must be 0CC6.8, CC7.1, CC8.1
ecr_require_no_high_image_findingsHIGH finding count must be ≤ max_high_finding_countCC6.8, CC7.1, CC8.1
ecr_require_scan_findings_retrievableScan findings with severity data must be accessibleCC6.8, CC7.1

Policy input​

The plugin evaluates three kinds of resource, and a policy receives one document of the matching kind as input. Every document has a resource_type field that says which: ecr-repository (one per private repository), ecr-registry (one per region) and ecr-image (one per image pushed within the lookback window, 90 days unless the image_lookback_days policy data says otherwise). A bundle is matched to a kind by its name: ecr-repository-policies, ecr-registry-policies or ecr-image-policies. The tables list the fields of every kind, and the example shows one document of each kind under the key named after its resource_type; a real input is only the document itself, without that key.

FieldTypeDescription
resource_typestringAll kinds. ecr-repository, ecr-registry or ecr-image.
regionstringAll kinds. AWS region.
account_idstringAll kinds. AWS account ID. For a registry it is the registry ID.
registry_idstringRepository and registry. ECR registry ID, which is the account ID.
repository_arnstringRepository and image. ARN of the repository.
repository_namestringRepository and image. Name of the repository.
image_tag_immutabilitystringRepository. MUTABLE or IMMUTABLE.
scan_on_pushbooleanRepository. Whether images are scanned when pushed.
encryption_typestringRepository. AES256 or KMS.
kms_keystringRepository. ARN of the KMS key when encryption_type is KMS, otherwise empty.
has_lifecycle_policybooleanRepository. Whether the repository has a lifecycle policy.
lifecycle_policy_textstringRepository. The lifecycle policy as a JSON string. Empty when there is none.
has_repository_policybooleanRepository. Whether the repository has a repository (permissions) policy.
repository_policy_textstringRepository. The repository policy as a JSON string. Empty when there is none.
tagsobject (string to string)Repository. The repository's tags.
registry_scan_typestringRegistry. BASIC or ENHANCED.
enhanced_scanning_enabledbooleanRegistry. True when registry_scan_type is ENHANCED.
image_digeststringImage. Immutable digest of the image (sha256:...).
image_tagsarray of stringsImage. Tags that point at the digest. An empty array for an untagged image.
image_pushed_atstring (RFC 3339 time)Image. When the image was pushed.
scan_statusstringImage. Scan status, such as COMPLETE or FAILED; UNSUPPORTED when the image has no scan.
findings_criticalintegerImage. Number of critical findings. 0 unless the scan is COMPLETE.
findings_highintegerImage. Number of high findings. 0 unless the scan is COMPLETE.
has_severity_databooleanImage. True when the scan completed and returned severity counts, so a zero in the counts is real.

An example input:

{
"ecr-repository": {
"resource_type": "ecr-repository",
"repository_arn": "arn:aws:ecr:eu-west-1:111122223333:repository/payments/api",
"repository_name": "payments/api",
"registry_id": "111122223333",
"region": "eu-west-1",
"account_id": "111122223333",
"image_tag_immutability": "IMMUTABLE",
"scan_on_push": true,
"encryption_type": "KMS",
"kms_key": "arn:aws:kms:eu-west-1:111122223333:key/1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"has_lifecycle_policy": true,
"lifecycle_policy_text": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Keep 30 images\",\"selection\":{\"tagStatus\":\"any\",\"countType\":\"imageCountMoreThan\",\"countNumber\":30},\"action\":{\"type\":\"expire\"}}]}",
"has_repository_policy": false,
"repository_policy_text": "",
"tags": {
"Environment": "production"
}
},
"ecr-registry": {
"resource_type": "ecr-registry",
"registry_id": "111122223333",
"region": "eu-west-1",
"account_id": "111122223333",
"registry_scan_type": "ENHANCED",
"enhanced_scanning_enabled": true
},
"ecr-image": {
"resource_type": "ecr-image",
"repository_arn": "arn:aws:ecr:eu-west-1:111122223333:repository/payments/api",
"repository_name": "payments/api",
"region": "eu-west-1",
"account_id": "111122223333",
"image_digest": "sha256:4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945",
"image_tags": [
"v1.8.2"
],
"image_pushed_at": "2026-10-30T09:41:07Z",
"scan_status": "COMPLETE",
"findings_critical": 0,
"findings_high": 2,
"has_severity_data": true
}
}

Subject templates​

The subject templates this plugin registers. Each example is built from sample data.

ecr-repository​

A private ECR repository. Title: ECR Repository {{ .repository_name }} in {{ .account_id }}/{{ .region }}. The evidence also carries a repository_name label that is not part of the identity.

Identity keyDescription
account_idAWS account ID.
regionAWS region.
repository_arnARN of the repository.

Example:

{
"name": "ecr-repository",
"type": "component",
"title": "ECR Repository payments/api in 111122223333/eu-west-1",
"description": "AWS ECR private repository payments/api.",
"purpose": "Represents an AWS ECR private repository evaluated for compliance posture.",
"identityLabels": {
"account_id": "111122223333",
"region": "eu-west-1",
"repository_arn": "arn:aws:ecr:eu-west-1:111122223333:repository/payments/api"
}
}

ecr-registry​

The account-level ECR registry in one region, evaluated for scanning configuration. Title: ECR Registry {{ .account_id }}/{{ .region }}.

Identity keyDescription
account_idAWS account ID.
regionAWS region.

Example:

{
"name": "ecr-registry",
"type": "component",
"title": "ECR Registry 111122223333/eu-west-1",
"description": "AWS ECR account-level registry in 111122223333/eu-west-1.",
"purpose": "Represents an AWS ECR registry evaluated for scanning configuration compliance.",
"identityLabels": {
"account_id": "111122223333",
"region": "eu-west-1"
}
}

ecr-image​

One container image digest in a repository, evaluated for vulnerability scan results. Title: ECR Image {{ .repository_name }}@{{ .image_digest }} in {{ .account_id }}/{{ .region }}.

Identity keyDescription
account_idAWS account ID.
regionAWS region.
repository_arnARN of the repository holding the image.
image_digestImmutable image digest (sha256:...).

Example:

{
"name": "ecr-image",
"type": "component",
"title": "ECR Image payments/api@sha256:4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945 in 111122223333/eu-west-1",
"description": "Container image sha256:4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945 in ECR repository payments/api.",
"purpose": "Represents a container image digest evaluated for vulnerability scan compliance.",
"identityLabels": {
"account_id": "111122223333",
"region": "eu-west-1",
"repository_arn": "arn:aws:ecr:eu-west-1:111122223333:repository/payments/api",
"image_digest": "sha256:4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945"
}
}

Policies​

The policy bundles that work with this plugin, at their newest releases. The controls are the ones the bundle's policies list in their metadata.

BundleLatest versionControls coveredCompatible plugin lines
plugin-aws-ecr-image-policiesv0.1.1ctrl-cc3-2-011, ctrl-cc5-2-007, ctrl-cc6-8-004, ctrl-cc6-8-006, ctrl-cc6-8-008, ctrl-cc6-8-010, ctrl-cc7-1-004, ctrl-cc7-1-005, ctrl-cc7-1-010, ctrl-cc7-1-011, ctrl-cc8-1-016, ctrl-cc8-1-017latest
plugin-aws-ecr-registry-policiesv0.1.1ctrl-cc5-2-006, ctrl-cc5-3-025, ctrl-cc7-1-001, ctrl-cc7-1-002, ctrl-cc7-1-006, ctrl-cc7-1-011latest
plugin-aws-ecr-repository-policiesv0.1.1CC6.1, ctrl-cc5-2-006, ctrl-cc5-3-025, ctrl-cc6-5-001, ctrl-cc6-8-001, ctrl-cc6-8-002, ctrl-cc6-8-003, ctrl-cc6-8-005, ctrl-cc6-8-007, ctrl-cc6-8-009, ctrl-cc6-8-011, ctrl-cc6-8-012, ctrl-cc6-8-013, ctrl-cc7-1-001, ctrl-cc7-1-006, ctrl-cc8-1-001, ctrl-cc8-1-008, ctrl-cc8-1-014, ctrl-cc8-1-015latest

Policy data (overrides data.json defaults)​

KeyTypeDefaultDescription
approved_encryption_types[]string["KMS"]Allowed ECR encryption types
approved_registry_scan_types[]string["ENHANCED"]Allowed registry-level scan modes
required_repository_tags[]string["Environment","Owner"]Tag keys every repository must carry
required_tag_valuesobject{}Enforce specific values for certain tags
image_lookback_daysnumber90Days back to evaluate image digests
max_high_finding_countnumber0Maximum HIGH severity findings allowed per image