aws-ecr-public-repo-exposed

A public ECR repository is pull-accessible to any user on the internet without authentication, enabling supply-chain poisoning by external/anonymous attackers.

derived aws emits ExposedToInternet

match

A conjunctive graph pattern. Variables (?x) bind node ids; every clause must hold.

[{'repository': None}, 'node exists']

where

node_type(?repository) == ContainerRegistry ?repository.provider_type == 'AWS::ECR::PublicRepository'

emit

source typeContainerRegistry
target typeAnonymousIdentity
source?repository
target<AnonymousIdentity>
state logicACTIVE — a public ECR repository is always accessible without authentication to any principal on the internet. No conditions gate this exposure.

Narrative

{repository.name} is a public ECR repository accessible at {repository.public_uri} without authentication. Any external or anonymous attacker can push images to a public repository they control and have workloads pull and execute poisoned images from public.ecr.aws, enabling an unauthenticated supply-chain attack (container-chains models this as a push vector for any workload pulling from this repository).

Raw rule rules/derived/aws/ecr.yaml

id: aws-ecr-public-repo-exposed
emits: ExposedToInternet
description: A public ECR repository is pull-accessible to any user on the internet without authentication,
  enabling supply-chain poisoning by external/anonymous attackers.
match:
- - repository: null
  - node exists
where:
- node_type(?repository) == ContainerRegistry
- ?repository.provider_type == 'AWS::ECR::PublicRepository'
emit:
  source_type: ContainerRegistry
  target_type: AnonymousIdentity
  source: ?repository
  target: <AnonymousIdentity>
  permissions: []
  conditions: []
  state_logic: "ACTIVE \u2014 a public ECR repository is always accessible without authentication to any\
    \ principal on the internet. No conditions gate this exposure."
  confidence: 1.0
  derived_from:
  - ?repository.provider_type == AWS::ECR::PublicRepository
  false_positive_note: Only public repositories (provider_type AWS::ECR::PublicRepository) are exposed
    to the internet. Private repositories (AWS::ECR::Repository) require authentication; emit ExposedToInternet
    only for public repositories. Verify the repository URI resolves to public.ecr.aws before emitting
    this edge.
  narrative: '{repository.name} is a public ECR repository accessible at {repository.public_uri} without
    authentication. Any external or anonymous attacker can push images to a public repository they control
    and have workloads pull and execute poisoned images from public.ecr.aws, enabling an unauthenticated
    supply-chain attack (container-chains models this as a push vector for any workload pulling from this
    repository).'
move · open · esc close