aws-ecr-put-replication-can-modify-configuration
A principal with ecr:PutReplicationConfiguration can change the registry's replication destination settings, enabling supply-chain image interception and poisoning across all repositories in the account.
match
A conjunctive graph pattern. Variables (?x) bind node ids; every clause must hold.
where
node_type(?account) ==
Account
effective_permission(?principal, 'ecr:PutReplicationConfiguration', '<account-registry-arn>') == true
emit
| source type | Identity |
|---|---|
| target type | Account |
| source | ?principal |
| target | ?account |
| permissions | ecr:PutReplicationConfiguration |
| conditions | iam_permission |
| state logic | ACTIVE when the principal has effective ecr:PutReplicationConfiguration at the registry/account level (not denied by SCP or permission boundary). This edge expresses the capability to change registry-wide replication settings affecting all repositories in the account. An SCP requiring replication to go only to blessed destinations would BLOCK this edge. |
Narrative
{principal.name} can reconfigure the replication settings of the ECR registry in account {account.id} (ecr:PutReplicationConfiguration), potentially routing replicated images to attacker-controlled destination repositories and enabling a supply-chain interception attack that affects all repositories in the account.
Raw rule rules/derived/aws/ecr.yaml
id: aws-ecr-put-replication-can-modify-configuration
emits: CanModifyConfiguration
description: A principal with ecr:PutReplicationConfiguration can change the registry's replication destination
settings, enabling supply-chain image interception and poisoning across all repositories in the account.
match:
- - principal: null
- HasPermission
- account: null
where:
- node_type(?account) == Account
- effective_permission(?principal, 'ecr:PutReplicationConfiguration', '<account-registry-arn>') == true
emit:
source_type: Identity
target_type: Account
source: ?principal
target: ?account
permissions:
- ecr:PutReplicationConfiguration
conditions:
- iam_permission
state_logic: ACTIVE when the principal has effective ecr:PutReplicationConfiguration at the registry/account
level (not denied by SCP or permission boundary). This edge expresses the capability to change registry-wide
replication settings affecting all repositories in the account. An SCP requiring replication to go
only to blessed destinations would BLOCK this edge.
confidence: 0.85
derived_from:
- effective_permission(?principal, ecr:PutReplicationConfiguration, <account-registry-arn>)
false_positive_note: PutReplicationConfiguration is a registry/account-level operation, not per-repository.
The escalation consequence requires the attacker to also control (or have CanModifyCode on) the destination
repositories configured by the new replication rule. If the destinations are in separate accounts
or untrusted, the supply-chain impact is realized only if the principal can push to those destinations
OR if they are already compromised.
narrative: '{principal.name} can reconfigure the replication settings of the ECR registry in account
{account.id} (ecr:PutReplicationConfiguration), potentially routing replicated images to attacker-controlled
destination repositories and enabling a supply-chain interception attack that affects all repositories
in the account.'