[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A7HZPD7JWEAGNCZCSG6X5M":3,"skill-same:01M7A7HZPD7JWEAGNCZCSG6X5M":140},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M7A7HZPD7JWEAGNCZCSG6X5M","ecr-repository-auditor",null,"Audits AWS ECR private repositories for public-access exposure via repositoryPolicy, image-scan configuration gaps (scanOnPush off + unscanned images), lifecycle-policy absence, tag-immutability gaps, and encryption posture. Emits a deterministic verdict (PUBLIC | NO_SCAN | NO_LIFECYCLE | CONFIG_GAP | OK) per repository with enumerated findings and specific CLI remediation. Use when reviewing ECR repository policies, checking for public image access, validating scan-on-push enablement, auditing lifecycle rules, or hardening container-image supply-chain posture before production deployment.","jhkchan\u002Faws-agent-skills","jhkchan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1083902?v=4","01M7A2SVQYP9GQTPTDXP5JKYQ4","Jacky Chan","01M7A2SVS117YWCTZABB75HZR1",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ecr-repository-auditor\ndescription: Audits AWS ECR private repositories for public-access exposure via repositoryPolicy, image-scan configuration gaps (scanOnPush off + unscanned images), lifecycle-policy absence, tag-immutability gaps, and encryption posture. Emits a deterministic verdict (PUBLIC | NO_SCAN | NO_LIFECYCLE | CONFIG_GAP | OK) per repository with enumerated findings and specific CLI remediation. Use when reviewing ECR repository policies, checking for public image access, validating scan-on-push enablement, auditing lifecycle rules, or hardening container-image supply-chain posture before production deployment.\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline config classification. Live-account audits use aws ecr describe-repositories, aws ecr get-repository-policy, aws ecr describe-images, aws ecr get-lifecycle-policy, and aws ecr put-image-scanning-configuration (AWS CLI v2, SSO or key-based credentials).\nmetadata:\n  domain: aws-cloudops\n  complexity: high\n  requires_llm: 'true'\n  phase: '2'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Storage\n  verdict_shape: PUBLIC | NO_SCAN | NO_LIFECYCLE | CONFIG_GAP | OK\n  when_to_use: Reviewing an ECR repository before production deployment, checking for public image access via repositoryPolicy, validating scan-on-push enablement, auditing lifecycle-policy coverage, hardening tag immutability, or assessing container supply-chain posture across an account.\n  activation_triggers: audit this ECR repository, is my ECR repo public, check ECR repository policy, ECR scanOnPush enabled, ECR lifecycle policy, unscanned container images, tag immutability check, ECR cross-account access, container image vulnerability scan, hardening ECR repository\n  invocation_schema: 'Input: either (a) an ECR repository configuration bundle (repositoryPolicy JSON + imageScanningConfiguration + imageTagMutability + lifecyclePolicyText + image metadata), OR (b) a repository name\u002FARN for live-account audit. Output: deterministic REPO\u002FVERDICT\u002FREASON\u002FFINDINGS\u002FREMEDIATION block per repository, where VERDICT is one of {PUBLIC, NO_SCAN, NO_LIFECYCLE, CONFIG_GAP, OK}.'\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: ECR, container registry, repository policy, scanOnPush, image scanning, lifecycle policy, tag immutability, Principal:\"*\", cross-account ECR, supply chain security, container image audit, unscanned images, ecr:GetDownloadUrlForLayer, ecr:BatchGetImage, ecr:PutImage, aws:SourceVpce, image vulnerability, KMS encryption ECR, ECR public access\n  tags: ecr, storage, security, container, supply-chain, image-scanning, lifecycle, tag-immutability, audit\n---\n\n# ECR Repository Auditor\n\n## Mindset\n\n**One-line takeaway:** the verdict is always the **worst** finding across all\ndimensions, and `repositoryPolicy` with `Principal: \"*\"` is the dominant\nfinding — a public container image is a supply-chain attack surface that\nsilently spreads to every downstream deployment.\n\nAn ECR private repository is the source of truth for container images that\nproduction workloads pull and execute. Three properties make ECR audit\ndistinct from S3 or KMS:\n- A **public repository policy** (`Principal: \"*\"`) grants the entire internet\n  permission to pull images — and anyone who can pull can inspect every layer\n  for embedded secrets, application logic, and dependency versions.\n- **scanOnPush: false** creates a vulnerability blind spot: images enter the\n  registry unscanned, and without a lifecycle policy, stale unscanned images\n  accumulate indefinitely.\n- **Tag mutability** (`MUTABLE`) is a supply-chain integrity risk: any principal\n  with `ecr:PutImage` can overwrite a production tag (`:latest`, `:v2`) with a\n  different image digest, silently swapping what deployments pull.\n\n## Quick reference — verdict thresholds\n\n| Condition | Verdict | Step |\n|---|---|---|\n| `Principal: \"*\"` + pull\u002Fpush action + no STRONG condition | **PUBLIC** | Step 1 |\n| Cross-account + pull\u002Fpush action + no STRONG condition | **PUBLIC** | Step 1 |\n| `Principal: \"*\"` + pull\u002Fpush action + STRONG condition (`aws:SourceVpce`, `aws:SourceAccount`) | **CONFIG_GAP** | Step 1 (downgrade) |\n| `imageScanningConfiguration.scanOnPush: false` AND images with `imageScanStatus` null\u002Fincomplete | **NO_SCAN** | Step 2 |\n| `scanOnPush: false` AND zero images in repo | **NO_SCAN** | Step 2 |\n| No `lifecyclePolicyText` present | **NO_LIFECYCLE** | Step 3 |\n| `imageTagMutability: MUTABLE` (all other dimensions clean) | **CONFIG_GAP** | Step 4 |\n| Cross-account + metadata-only actions + no condition | **CONFIG_GAP** | Step 4 |\n| All dimensions clean | **OK** | Step 5 |\n\nSee the ordered steps below for edge cases. Deep ECR authorization internals\n(policy vs IAM intersection, lifecycle rule ordering, enhanced scanning) are in\nthe [Deep reference](#deep-reference-ecr-authorization-and-scanning-internals)\nsection at the end.\n\n## Pre-flight: repository metadata gate (run before policy classification)\n\nBefore evaluating the repository policy, classify the repository itself.\nSeveral attributes **short-circuit** the audit — misclassifying them produces\nfalse positives.\n\nMulti-repo \u002F account-wide sweep pagination guidance moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when auditing every repository in an account (describe-repositories \u002F describe-images \u002F lifecycle-preview nextToken draining).\n\n**Live-account pre-flight checks (skip if doing offline config audit):**\nLive-account pre-flight checks (remediation IAM permissions, CloudTrail data events, pre-edit image snapshot) moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand before a live-account audit that may propose remediation.\n\n| Attribute | Value | Effect on audit |\n|---|---|---|\n| `registryId` | account ID | The 12-digit account that owns the registry. Cross-account principal detection compares this against principal ARNs in the repositoryPolicy. |\n| Empty repositoryPolicy | no policy document | **IAM-only access.** This is the DEFAULT and MOST SECURE posture for ECR private repos. No resource-based policy means access is controlled entirely by IAM identity-based policies. Do NOT flag as a gap — proceed to scan\u002Flifecycle\u002Ftag steps. |\n| `imageScanningConfiguration.scanOnPush` | `true` | Images are scanned automatically on push. Does NOT scan images pushed before this was enabled, nor re-scan on CVE database updates (unless enhanced scanning is on). |\n| `imageScanningConfiguration.scanOnPush` | `false` | Images are NOT scanned on push. Manual `aws ecr start-image-scan` is required per image. Flag in Step 2 if unscanned images exist. |\n| `imageTagMutability` | `IMMUTABLE` | Tags cannot be overwritten — each tag permanently maps to one digest. This is the secure default for supply-chain integrity. |\n| `imageTagMutability` | `MUTABLE` | Tags CAN be overwritten — any principal with `ecr:PutImage` can push a new image under an existing tag, silently changing what deployments pull. Flag in Step 4. |\n| `encryptionConfiguration.encryptionType` | `AES256` | Default encryption using an AWS-managed key. Acceptable but not customer-controlled. Note as informational. |\n| `encryptionConfiguration.encryptionType` | `KMS` | Customer-managed KMS key (BYOK). Provides audit trail via CloudTrail and rotation control. |\n| `encryptionConfiguration.encryptionType` | `KMS_DSSE` | Double-layer server-side encryption (KMS + AES256). Highest encryption posture. |\n| `encryptionConfiguration.encryptionType` | absent | Defaults to `AES256`. Do not flag. |\n| `lifecyclePolicyText` | absent \u002F empty | No lifecycle rules. Images accumulate indefinitely — cost grows unbounded and stale images remain pullable. Flag in Step 3. |\n\n**If the repositoryPolicy JSON is malformed** (invalid JSON, missing\n`Statement`, missing `Principal` or `Action`\u002F`NotAction`), output:\n\n```text\nREPO: \u003Crepo-name>\nVERDICT: ERROR\nREASON: Repository policy document is not valid JSON or is missing required fields — cannot classify.\nREMEDIATION: Retrieve the canonical policy with `aws ecr get-repository-policy --repository-name \u003Cname> --output json` and re-audit.\n```\n\n## Process — Classification logic (apply in order, aggregate worst)\n\n### Step 0: Expert knowledge — non-obvious ECR behaviors that change classification\n\nThese behaviors are easy to misjudge without operational ECR experience.\nEach changes a verdict if ignored:\n\nStep 0 expert-knowledge behaviors moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when a verdict depends on non-obvious behavior (private vs public, GetAuthorizationToken scope, union\u002Fintersection, SourceVpce strength, scan staleness, rulePriority order, untagged cleanup).\n\n### Step 1: PUBLIC — repositoryPolicy exposure (highest priority)\n\nFor each `Effect: Allow` statement in the repositoryPolicy, classify the\nprincipal and actions:\n\n**Principal scope:**\n- **WILDCARD_PRINCIPAL** — Principal is `\"*\"`, `{\"AWS\": \"*\"}`, or any\n  construct resolving to all authenticated AWS principals.\n- **CROSS_ACCOUNT** — Principal includes an ARN whose 12-digit account ID\n  differs from the registry's owning account (`registryId`).\n- **SAME_ACCOUNT** — All principals share the `registryId`. This includes\n  the account root, same-account roles, users, and services.\n\n**Action danger classification:**\n- **PULL** — `ecr:GetDownloadUrlForLayer`, `ecr:BatchGetImage`,\n  `ecr:BatchCheckLayerAvailability`, `ecr:DescribeImages`,\n  `ecr:DescribeRepositories`, `ecr:GetDownloadUrlForLayer`. A principal with\n  pull can download every layer — equivalent to reading all source code,\n  secrets, and binaries.\n- **PUSH** — `ecr:PutImage`, `ecr:InitiateLayerUpload`,\n  `ecr:UploadLayerPart`, `ecr:CompleteLayerUpload`,\n  `ecr:BatchDeleteImage`. A principal with push can inject malicious images\n  or overwrite production tags.\n- **ADMIN** — `ecr:*`, `ecr:DeleteRepository`,\n  `ecr:PutRepositoryPolicy`, `ecr:SetRepositoryPolicy`. Full control of the\n  repo including policy modification and deletion.\n- **METADATA** — `ecr:Describe*`, `ecr:List*`, `ecr:GetRepositoryPolicy`.\n  Read-only informational access. Low severity but still a data leak in\n  aggregate (repo names, image counts, tags).\n\n**Severity matrix for repositoryPolicy (apply in order, first match wins):**\n\n| # | Principal | Action | Condition | Severity |\n|---|---|---|---|---|\n| 1a | WILDCARD_PRINCIPAL | PUSH or ADMIN | None\u002Fweak | **PUBLIC** |\n| 1b | WILDCARD_PRINCIPAL | PULL | None\u002Fweak | **PUBLIC** |\n| 1c | CROSS_ACCOUNT | PUSH or ADMIN | None\u002Fweak | **PUBLIC** |\n| 1d | CROSS_ACCOUNT | PULL | None\u002Fweak | **PUBLIC** |\n| 1e | WILDCARD or CROSS | PULL\u002FPUSH | STRONG (`aws:SourceVpce`, `aws:SourceAccount`, `aws:SourceArn`) | **CONFIG_GAP** (downgraded — fragile but scoped) |\n| 1f | WILDCARD or CROSS | METADATA only | None\u002Fweak | **CONFIG_GAP** |\n| 1g | SAME_ACCOUNT | Any | Any | Not a PUBLIC finding (proceed to other steps) |\n\n**Special case — the empty repositoryPolicy:** An ECR repo with no\n`repositoryPolicy` (the default) has NO resource-based policy. This means\naccess is governed ENTIRELY by IAM identity-based policies. This is the\nSECURE DEFAULT. Do NOT flag an empty repo policy as a gap — it is more\nsecure than a permissive one. Proceed to Steps 2-4.\n\n**Special case — the account-root delegation statement:** A statement with\n`Principal: {\"AWS\": \"arn:aws:iam::ACCOUNT:root\"}` + `ecr:*` (or any broad\naction set) is the **root-delegation pattern**. It delegates repository\naccess control to the account's IAM identity-based policies — anyone with\nthe right IAM permissions can use the repo, anyone without cannot. This is\nthe NORMAL and EXPECTED pattern for ECR repos that rely on IAM for access\ncontrol. Do NOT flag it as CONFIG_GAP or any other finding. It is functionally\nequivalent to the empty repositoryPolicy (both defer to IAM). Classify this\nstatement as SAME_ACCOUNT \u002F OK (row 1g) and proceed to Steps 2-4. The only\nexception: if the same statement ALSO includes a wildcard or cross-account\nprincipal alongside the root principal — classify by the WIDEST principal\n(row 1a-1f apply to the wildcard\u002Fcross-account portion).\n\n**Special case — the account-root delegation statement:** A statement with\n`Principal: {\"AWS\": \"arn:aws:iam::ACCOUNT:root\"}` + `ecr:*` (or any broad\naction set) is the **root-delegation pattern**. It delegates repository\naccess control to the account's IAM identity-based policies — anyone with\nthe right IAM permissions can use the repo, anyone without cannot. This is\nthe NORMAL and EXPECTED pattern for ECR repos that rely on IAM for access\ncontrol. Do NOT flag it as CONFIG_GAP or any other finding. It is functionally\nequivalent to the empty repositoryPolicy (both defer to IAM). Classify this\nstatement as SAME_ACCOUNT \u002F OK (row 1g) and proceed to Steps 2-4. The only\nexception: if the same statement ALSO includes a wildcard or cross-account\nprincipal alongside the root principal — classify by the WIDEST principal\n(row 1a-1f apply to the wildcard\u002Fcross-account portion).\n\n**NotAction in an Allow statement** is an inverse wildcard — it grants every\nECR action EXCEPT the listed ones. Treat as ADMIN danger level (worst case)\nbecause new ECR APIs are automatically included.\n\n**Condition strength:**\n- **STRONG (downgrade by two levels):** `aws:SourceVpce` (VPC endpoint ID —\n  infrastructure-assigned, unforgeable), `aws:SourceAccount` with\n  `StringEquals`, `aws:SourceArn` with `StringEquals`\u002F`StringLike`.\n- **WEAK (no downgrade):** `aws:SourceIp` \u002F `aws:SourceIp` containing\n  `0.0.0.0\u002F0` (bypassable by anyone with a proxy or VPN; the entire internet\n  if `0.0.0.0\u002F0`), `aws:Referer`, `aws:UserAgent` (trivially forgeable).\n\n### Step 2: NO_SCAN — image scanning gaps\n\nEvaluate the scanning posture:\n\n- **`scanOnPush: false` AND any image with `imageScanStatus: null` or\n  `imageScanStatus.status` not `\"COMPLETE\"`** → **NO_SCAN**. Images are\n  entering the registry without vulnerability scanning. Any CVE in a base\n  image layer or dependency goes undetected.\n\n- **`scanOnPush: false` AND the repo has zero images** → **NO_SCAN**. The\n  repo is empty now, but the first image pushed will not be scanned.\n  Remediate preemptively.\n\n- **`scanOnPush: true` AND all images have `imageScanStatus.status:\n  \"COMPLETE\"`** → OK for this dimension. Note: basic scanning (non-enhanced)\n  does not re-scan on CVE database updates — recommend enhanced scanning for\n  production repos.\n\n- **`scanOnPush: true` AND some images have `imageScanStatus: null`** →\n  **NO_SCAN**. These images were pushed before scanOnPush was enabled and\n  were never manually scanned. Run `aws ecr start-image-scan` on each.\n\n### Step 3: NO_LIFECYCLE — lifecycle policy absence\n\n- **No `lifecyclePolicyText` present (empty string or absent field)** →\n  **NO_LIFECYCLE**. Without lifecycle rules, images accumulate indefinitely.\n  This means: (1) storage cost grows without bound, (2) stale images with\n  known vulnerabilities remain pullable, (3) the repo approaches the\n  per-repo image quota with no cleanup path.\n\n- **`lifecyclePolicyText` present but contains only a `tagStatus: tagged`\n  retention rule with no `tagStatus: untagged` rule** → still **NO_LIFECYCLE**\n  (partial gap). Untagged images are not cleaned up. Emit a CONFIG_GAP-level\n  note within the NO_LIFECYCLE finding: \"Lifecycle policy exists but lacks an\n  `untagged` cleanup rule — untagged images accumulate indefinitely.\"\n\n- **`lifecyclePolicyText` present with at least one rule** → OK for this\n  dimension. Verify the rule ordering (lowest `rulePriority` evaluated first)\n  and that the rule set is logically sound (a broad early rule does not\n  shadow a selective later rule).\n\n### Step 4: CONFIG_GAP — tag immutability, encryption, and other config gaps\n\nIf Steps 1-3 produced no PUBLIC\u002FNO_SCAN\u002FNO_LIFECYCLE finding, evaluate\nremaining configuration:\n\n- **`imageTagMutability: MUTABLE`** → **CONFIG_GAP**. Tags can be overwritten\n  by any principal with `ecr:PutImage`. A supply-chain attacker who\n  compromises a CI\u002FCD role can push a backdoored image under the `:prod` tag,\n  and the next deployment pulls the malicious image with no visible change to\n  the tag name. Immutable tags prevent this: each tag permanently maps to one\n  digest.\n\n- **Cross-account principal with METADATA-only actions and no condition** →\n  **CONFIG_GAP**. Not PUBLIC (metadata only) but still an information leak\n  (repo inventory, image counts, tag names).\n\n- **Cross-account PULL\u002FPUSH with STRONG condition (already downgraded from\n  Step 1)** → the downgrade lands here as **CONFIG_GAP** (fragile but scoped).\n\n- **`imageTagMutability: IMMUTABLE` + no other config gaps** → OK for this\n  dimension.\n\n### Step 5: Aggregation — worst finding wins\n\nThe final verdict is the **maximum severity** finding across all steps, where\nPUBLIC > NO_SCAN > NO_LIFECYCLE > CONFIG_GAP > OK:\n\n```text\nverdict = max(step1_finding, step2_finding, step3_finding, step4_finding)\n```\n\nIf no findings (all dimensions clean), the verdict is **OK**.\n\n## Output format (per repository)\n\n```text\nREPO: \u003Cregistry-id>.dkr.ecr.\u003Cregion>.amazonaws.com\u002F\u003Crepo-name>\nVERDICT: PUBLIC | NO_SCAN | NO_LIFECYCLE | CONFIG_GAP | OK\nREASON: \u003C1-2 sentences citing the worst finding and its step>\nFINDINGS:\n  - [PUBLIC] \u003Cfinding description (Step 1a)>\n  - [NO_SCAN] \u003Cfinding description (Step 2)>\n  - [OK] \u003Cdimension that passed>\nREMEDIATION: \u003Cspecific action per finding, or \"None required\" if OK>\n```\n\n### Worked example — public pull with scan off and no lifecycle\n\n```text\nREPO: 111111111111.dkr.ecr.us-east-1.amazonaws.com\u002Fapp-frontend\nVERDICT: PUBLIC\nREASON: Statement \"PublicPull\" grants ecr:BatchGetImage and\necr:GetDownloadUrlForLayer to Principal \"*\" with no condition — any AWS\naccount holder can pull every image layer, exposing source code and embedded\nsecrets (Step 1b). scanOnPush is also disabled with unscanned images present.\nFINDINGS:\n  - [PUBLIC] Principal \"*\" + PULL actions (BatchGetImage, GetDownloadUrlForLayer) with no condition (Step 1b)\n  - [NO_SCAN] scanOnPush: false + 3 images with imageScanStatus: null (Step 2)\n  - [NO_LIFECYCLE] No lifecyclePolicyText present (Step 3)\n  - [CONFIG_GAP] imageTagMutability: MUTABLE (Step 4)\nREMEDIATION:\n  1. PUBLIC — Remove the \"PublicPull\" statement or add aws:SourceAccount \u002F\n     aws:SourceVpce conditions to scope to trusted accounts\u002Fendpoints only.\n  2. NO_SCAN — Enable scan-on-push:\n     aws ecr put-image-scanning-configuration --repository-name app-frontend\n     --image-scanning-configuration scanOnPush=true --registry-id 111111111111\n  3. NO_LIFECYCLE — Apply a lifecycle policy that keeps the last 10 tagged\n     images and deletes untagged images after 1 day (see remediation CLI).\n  4. CONFIG_GAP — Set tag immutability:\n     aws ecr put-image-tag-mutability --repository-name app-frontend\n     --image-tag-mutability IMMUTABLE --registry-id 111111111111\n```\n\n## Anti-Patterns — NEVER\n\n- NEVER classify a `Principal: \"*\"` grant with `ecr:BatchGetImage` \u002F\n  `ecr:GetDownloadUrlForLayer` as anything other than PUBLIC when there is no\n  STRONG condition. Pull permissions grant access to every image layer —\n  equivalent to reading all source code, embedded secrets, and binaries.\n  This is not \"broad access\" — it is total image exposure.\n\n- NEVER flag an empty repositoryPolicy as a security gap. An ECR repo with no\n  resource-based policy relies on IAM identity-based policies for access\n  control — this is the **secure default** and more restrictive than a\n  permissive policy. Flagging it as a gap causes unnecessary policy churn\n  that can introduce exposure.\n\n- NEVER flag `Principal: {\"AWS\": \"arn:aws:iam::ACCOUNT:root\"}` + `ecr:*` as\n  a CONFIG_GAP or security finding. This is the **root-delegation statement**\n  — it delegates repository access to the account's IAM policies, exactly\n  like an empty repositoryPolicy but explicit. Without it, IAM-based access\n  patterns still work (same-account union evaluation), but its presence is\n  NOT a sign of over-permissive access. The root principal is the account\n  owner; `ecr:*` to root means \"the account owner can manage this repo via\n  IAM.\" Flagging it as CONFIG_GAP is a false positive that produces alert\n  fatigue. The equivalent in KMS is the root-of-trust statement — normal and\n  required.\n\n- NEVER flag `Principal: {\"AWS\": \"arn:aws:iam::ACCOUNT:root\"}` + `ecr:*` as\n  a CONFIG_GAP or security finding. This is the **root-delegation statement**\n  — it delegates repository access to the account's IAM policies, exactly\n  like an empty repositoryPolicy but explicit. Without it, IAM-based access\n  patterns still work (same-account union evaluation), but its presence is\n  NOT a sign of over-permissive access. The root principal is the account\n  owner; `ecr:*` to root means \"the account owner can manage this repo via\n  IAM.\" Flagging it as CONFIG_GAP is a false positive that produces alert\n  fatigue. The equivalent in KMS is the root-of-trust statement — normal and\n  required.\n\n- NEVER treat `aws:SourceIp` with `0.0.0.0\u002F0` as a real condition. This CIDR\n  is the entire internet and provides zero restriction. Any principal with a\n  proxy, VPN, or NAT gateway can route through an allowed CIDR. Treat the\n  statement as if the condition is absent.\n\n- NEVER treat `ecr:GetAuthorizationToken` in a repositoryPolicy as a\n  meaningful grant. This action is account-scoped (returns a registry-wide\n  auth token) and is evaluated at the IAM level, not the repo-policy level.\n  Its presence in a repo policy is misleading — do NOT use it to escalate the\n  verdict or classify as a PULL\u002FPUSH\u002FADMIN action.\n\n- NEVER classify a `Principal: \"*\"` grant with a STRONG condition\n  (`aws:SourceVpce`, `aws:SourceAccount`, `aws:SourceArn`) as PUBLIC. The\n  condition narrows access to a known endpoint or account. Downgrade to\n  CONFIG_GAP. Classifying it as PUBLIC conflates \"currently restricted\" with\n  \"unrestricted\" and produces alert fatigue.\n\n- NEVER overlook `NotAction` in an Allow statement. `NotAction` grants every\n  ECR action EXCEPT the listed ones — the inverse of the intended scope, and\n  almost always a misconfiguration. Treat as ADMIN danger (worst case) because\n  new ECR APIs are automatically included.\n\n- NEVER assume `scanOnPush: true` means all images are scanned. Images pushed\n  before scanOnPush was enabled are NOT retroactively scanned. Always\n  enumerate images and check per-image `imageScanStatus` — the repo-level\n  config reflects intent, not per-image reality.\n\n- NEVER assume a lifecycle policy with `tagStatus: tagged` rules cleans up\n  untagged images. Only a `tagStatus: untagged` rule deletes untagged images.\n  Without it, untagged images persist indefinitely, consuming storage and\n  counting against the image quota while being invisible to tag-based queries.\n\n- NEVER recommend setting `imageTagMutability: IMMUTABLE` without warning\n  that existing mutable tags remain mutable until overwritten. The setting\n  applies to future tag operations only — a tag that was overwritten before\n  the change keeps its current digest. Re-push affected images to pin the\n  intended digest.\n\n- NEVER ignore lifecycle policy `rulePriority` ordering. Rules are evaluated\n  lowest-number-first and first-match-wins. A broad retention\u002Fdeletion rule\n  at priority 1 shadows all subsequent rules. The most selective rule must\n  have the lowest priority number.\n\n- NEVER assume cross-region replication does not propagate repository\n  policies. ECR replication copies the source repo's repositoryPolicy to\n  replicas in target regions. A public policy on a source repo is\n  automatically multi-region. Audit replicas independently when replication\n  is configured.\n\n- NEVER confuse ECR Private with ECR Public. ECR Private\n  (`api.ecr.\u003Cregion>.amazonaws.com`) uses repositoryPolicy for access control.\n  ECR Public (`public.ecr.aws`) uses catalog-level visibility — there is no\n  per-repo policy for public access. This skill audits private repositories\n  only.\n\n- NEVER recommend deleting an ECR repository as remediation without first\n  verifying that no running workloads pull from it. Repository deletion is\n  irreversible — all images are permanently lost. Run `aws ecr describe-images`\n  and check ECS\u002FEC2\u002FEKS task definitions for references before recommending\n  deletion.\n\n- NEVER classify a same-account-only repositoryPolicy with named principals\n  as PUBLIC. Same-account access is governed by IAM identity-based policies\n  (union evaluation), which provides a second authorization layer. Flag\n  CONFIG_GAP at worst for same-account metadata-only cross-principal access.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (PutImageScanningConfiguration, PutLifecyclePolicy,\n  PutImageTagMutability, DeleteRepositoryPolicy, DeleteRepository), the\n  auditor MUST emit:\n  `CONFIRM: About to \u003Caction> on repository \u003Cname> in account \u003Caccount>.\n  This affects \u003Cconsequence>. Proceed? (yes\u002Fno)`\n  Do NOT execute the CLI command until the operator confirms.\n\n- **PutImageTagMutability is irreversible for existing tags.** Changing from\n  MUTABLE to IMMUTABLE prevents future overwrites but does not restore\n  previously overwritten tags. Changing from IMMUTABLE to MUTABLE re-enables\n  overwrites for all tags. Warn the operator about both directions.\n\n- **PutLifecyclePolicy can delete images immediately.** A lifecycle policy\n  with `tagStatus: any` and `countNumberInList: 1` evaluates on the next\n  lifecycle evaluation cycle (within ~24 hours) and can delete images\n  matching the rule. ALWAYS run `aws ecr get-lifecycle-policy-preview` to\n  dry-run the policy before applying it. The preview shows exactly which\n  images would be deleted.\n\n- Confirm the repository exists and is accessible:\n  `aws ecr describe-repositories --repository-names \u003Cname> --registry-id \u003Cid>`\n  — fail closed (skip remediation) if it returns an error.\n\n- Capture the current configuration for rollback before any modification:\n  ```bash\n  aws ecr get-repository-policy --repository-name \u003Cname> --registry-id \u003Cid> \\\n    --output json > \u002Ftmp\u002F\u003Cname>-policy-backup-$(date +%s).json\n  aws ecr get-lifecycle-policy --repository-name \u003Cname> --registry-id \u003Cid> \\\n    --output json > \u002Ftmp\u002F\u003Cname>-lifecycle-backup-$(date +%s).json\n  ```\n\n- For PUBLIC findings (wildcard principal with pull\u002Fpush, no condition),\n  treat as incident-response. Audit CloudTrail for `ecr:BatchGetImage` \u002F\n  `ecr:GetDownloadUrlForLayer` events from external principals during the\n  exposure window. Any pulled image should be considered potentially\n  inspected for embedded secrets — rotate any secrets found in image layers.\n\n- Prefer additive changes (add a Deny statement, add a condition) over\n  destructive changes (remove an Allow statement) — additive changes are\n  reversible and do not risk breaking existing pull workflows. The safe\n  sequence for a PUBLIC finding is: (1) back up policy, (2) add a Deny that\n  blocks the wildcard principal, (3) verify the Deny is effective via policy\n  preview, (4) only then remove the offending Allow statement.\n\n## Remediation guidance\n\nPer-verdict remediation guidance (PUBLIC, NO_SCAN, NO_LIFECYCLE, CONFIG_GAP, OK) with full CLI sequences moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when emitting REMEDIATION or before executing any state-changing CLI.\n\n## Deep reference: ECR authorization and scanning internals\n\nDeep ECR authorization and scanning internals moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand for the policy-vs-IAM evaluation pipeline, lifecycle rule evaluation, basic vs enhanced scanning, KMS encryption internals, and replication propagation.\n\n## Recent AWS features (2024-2026)\n\nRecent AWS features (2024-2026) moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when auditing enhanced scanning, pull-through caches, replication, or lifecycle enhancements.\n\n## References (load on demand)\n\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — live-account pre-flight checks, multi-repo sweep pagination, and per-verdict remediation CLI sequences moved from SKILL.md.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step 0 expert-knowledge deep dives, ECR authorization and scanning internals, and recent AWS features moved from SKILL.md.\n\n## Domain\n\nAWS CloudOps \u002F ECR Container Registry Security & Supply-Chain Compliance.\n\n## AWS documentation\n\n- **Amazon ECR User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECR\u002Flatest\u002Fuserguide\u002Fwhat-is-ecr.html\n- **ECR Security** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECR\u002Flatest\u002Fuserguide\u002Fsecurity.html\n- **ECR API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECR\u002Flatest\u002FAPIReference\u002F\n- **ECR CLI Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fecr\u002F\n- **Enhanced scanning with Amazon Inspector** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECR\u002Flatest\u002Fuserguide\u002Fimage-scanning-enhanced.html\n","# ECR Repository Auditor\n\n## Mindset\n\n**One-line takeaway:** the verdict is always the **worst** finding across all\ndimensions, and `repositoryPolicy` with `Principal: \"*\"` is the dominant\nfinding — a public container image is a supply-chain attack surface that\nsilently spreads to every downstream deployment.\n\nAn ECR private repository is the source of truth for container images that\nproduction workloads pull and execute. Three properties make ECR audit\ndistinct from S3 or KMS:\n- A **public repository policy** (`Principal: \"*\"`) grants the entire internet\n  permission to pull images — and anyone who can pull can inspect every layer\n  for embedded secrets, application logic, and dependency versions.\n- **scanOnPush: false** creates a vulnerability blind spot: images enter the\n  registry unscanned, and without a lifecycle policy, stale unscanned images\n  accumulate indefinitely.\n- **Tag mutability** (`MUTABLE`) is a supply-chain integrity risk: any principal\n  with `ecr:PutImage` can overwrite a production tag (`:latest`, `:v2`) with a\n  different image digest, silently swapping what deployments pull.\n\n## Quick reference — verdict thresholds\n\n| Condition | Verdict | Step |\n|---|---|---|\n| `Principal: \"*\"` + pull\u002Fpush action + no STRONG condition | **PUBLIC** | Step 1 |\n| Cross-account + pull\u002Fpush action + no STRONG condition | **PUBLIC** | Step 1 |\n| `Principal: \"*\"` + pull\u002Fpush action + STRONG condition (`aws:SourceVpce`, `aws:SourceAccount`) | **CONFIG_GAP** | Step 1 (downgrade) |\n| `imageScanningConfiguration.scanOnPush: false` AND images with `imageScanStatus` null\u002Fincomplete | **NO_SCAN** | Step 2 |\n| `scanOnPush: false` AND zero images in repo | **NO_SCAN** | Step 2 |\n| No `lifecyclePolicyText` present | **NO_LIFECYCLE** | Step 3 |\n| `imageTagMutability: MUTABLE` (all other dimensions clean) | **CONFIG_GAP** | Step 4 |\n| Cross-account + metadata-only actions + no condition | **CONFIG_GAP** | Step 4 |\n| All dimensions clean | **OK** | Step 5 |\n\nSee the ordered steps below for edge cases. Deep ECR authorization internals\n(policy vs IAM intersection, lifecycle rule ordering, enhanced scanning) are in\nthe [Deep reference](#deep-reference-ecr-authorization-and-scanning-internals)\nsection at the end.\n\n## Pre-flight: repository metadata gate (run before policy classification)\n\nBefore evaluating the repository policy, classify the repository itself.\nSeveral attributes **short-circuit** the audit — misclassifying them produces\nfalse positives.\n\nMulti-repo \u002F account-wide sweep pagination guidance moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when auditing every repository in an account (describe-repositories \u002F describe-images \u002F lifecycle-preview nextToken draining).\n\n**Live-account pre-flight checks (skip if doing offline config audit):**\nLive-account pre-flight checks (remediation IAM permissions, CloudTrail data events, pre-edit image snapshot) moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand before a live-account audit that may propose remediation.\n\n| Attribute | Value | Effect on audit |\n|---|---|---|\n| `registryId` | account ID | The 12-digit account that owns the registry. Cross-account principal detection compares this against principal ARNs in the repositoryPolicy. |\n| Empty repositoryPolicy | no policy document | **IAM-only access.** This is the DEFAULT and MOST SECURE posture for ECR private repos. No resource-based policy means access is controlled entirely by IAM identity-based policies. Do NOT flag as a gap — proceed to scan\u002Flifecycle\u002Ftag steps. |\n| `imageScanningConfiguration.scanOnPush` | `true` | Images are scanned automatically on push. Does NOT scan images pushed before this was enabled, nor re-scan on CVE database updates (unless enhanced scanning is on). |\n| `imageScanningConfiguration.scanOnPush` | `false` | Images are NOT scanned on push. Manual `aws ecr start-image-scan` is required per image. Flag in Step 2 if unscanned images exist. |\n| `imageTagMutability` | `IMMUTABLE` | Tags cannot be overwritten — each tag permanently maps to one digest. This is the secure default for supply-chain integrity. |\n| `imageTagMutability` | `MUTABLE` | Tags CAN be overwritten — any principal with `ecr:PutImage` can push a new image under an existing tag, silently changing what deployments pull. Flag in Step 4. |\n| `encryptionConfiguration.encryptionType` | `AES256` | Default encryption using an AWS-managed key. Acceptable but not customer-controlled. Note as informational. |\n| `encryptionConfiguration.encryptionType` | `KMS` | Customer-managed KMS key (BYOK). Provides audit trail via CloudTrail and rotation control. |\n| `encryptionConfiguration.encryptionType` | `KMS_DSSE` | Double-layer server-side encryption (KMS + AES256). Highest encryption posture. |\n| `encryptionConfiguration.encryptionType` | absent | Defaults to `AES256`. Do not flag. |\n| `lifecyclePolicyText` | absent \u002F empty | No lifecycle rules. Images accumulate indefinitely — cost grows unbounded and stale images remain pullable. Flag in Step 3. |\n\n**If the repositoryPolicy JSON is malformed** (invalid JSON, missing\n`Statement`, missing `Principal` or `Action`\u002F`NotAction`), output:\n\n```text\nREPO: \u003Crepo-name>\nVERDICT: ERROR\nREASON: Repository policy document is not valid JSON or is missing required fields — cannot classify.\nREMEDIATION: Retrieve the canonical policy with `aws ecr get-repository-policy --repository-name \u003Cname> --output json` and re-audit.\n```\n\n## Process — Classification logic (apply in order, aggregate worst)\n\n### Step 0: Expert knowledge — non-obvious ECR behaviors that change classification\n\nThese behaviors are easy to misjudge without operational ECR experience.\nEach changes a verdict if ignored:\n\nStep 0 expert-knowledge behaviors moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when a verdict depends on non-obvious behavior (private vs public, GetAuthorizationToken scope, union\u002Fintersection, SourceVpce strength, scan staleness, rulePriority order, untagged cleanup).\n\n### Step 1: PUBLIC — repositoryPolicy exposure (highest priority)\n\nFor each `Effect: Allow` statement in the repositoryPolicy, classify the\nprincipal and actions:\n\n**Principal scope:**\n- **WILDCARD_PRINCIPAL** — Principal is `\"*\"`, `{\"AWS\": \"*\"}`, or any\n  construct resolving to all authenticated AWS principals.\n- **CROSS_ACCOUNT** — Principal includes an ARN whose 12-digit account ID\n  differs from the registry's owning account (`registryId`).\n- **SAME_ACCOUNT** — All principals share the `registryId`. This includes\n  the account root, same-account roles, users, and services.\n\n**Action danger classification:**\n- **PULL** — `ecr:GetDownloadUrlForLayer`, `ecr:BatchGetImage`,\n  `ecr:BatchCheckLayerAvailability`, `ecr:DescribeImages`,\n  `ecr:DescribeRepositories`, `ecr:GetDownloadUrlForLayer`. A principal with\n  pull can download every layer — equivalent to reading all source code,\n  secrets, and binaries.\n- **PUSH** — `ecr:PutImage`, `ecr:InitiateLayerUpload`,\n  `ecr:UploadLayerPart`, `ecr:CompleteLayerUpload`,\n  `ecr:BatchDeleteImage`. A principal with push can inject malicious images\n  or overwrite production tags.\n- **ADMIN** — `ecr:*`, `ecr:DeleteRepository`,\n  `ecr:PutRepositoryPolicy`, `ecr:SetRepositoryPolicy`. Full control of the\n  repo including policy modification and deletion.\n- **METADATA** — `ecr:Describe*`, `ecr:List*`, `ecr:GetRepositoryPolicy`.\n  Read-only informational access. Low severity but still a data leak in\n  aggregate (repo names, image counts, tags).\n\n**Severity matrix for repositoryPolicy (apply in order, first match wins):**\n\n| # | Principal | Action | Condition | Severity |\n|---|---|---|---|---|\n| 1a | WILDCARD_PRINCIPAL | PUSH or ADMIN | None\u002Fweak | **PUBLIC** |\n| 1b | WILDCARD_PRINCIPAL | PULL | None\u002Fweak | **PUBLIC** |\n| 1c | CROSS_ACCOUNT | PUSH or ADMIN | None\u002Fweak | **PUBLIC** |\n| 1d | CROSS_ACCOUNT | PULL | None\u002Fweak | **PUBLIC** |\n| 1e | WILDCARD or CROSS | PULL\u002FPUSH | STRONG (`aws:SourceVpce`, `aws:SourceAccount`, `aws:SourceArn`) | **CONFIG_GAP** (downgraded — fragile but scoped) |\n| 1f | WILDCARD or CROSS | METADATA only | None\u002Fweak | **CONFIG_GAP** |\n| 1g | SAME_ACCOUNT | Any | Any | Not a PUBLIC finding (proceed to other steps) |\n\n**Special case — the empty repositoryPolicy:** An ECR repo with no\n`repositoryPolicy` (the default) has NO resource-based policy. This means\naccess is governed ENTIRELY by IAM identity-based policies. This is the\nSECURE DEFAULT. Do NOT flag an empty repo policy as a gap — it is more\nsecure than a permissive one. Proceed to Steps 2-4.\n\n**Special case — the account-root delegation statement:** A statement with\n`Principal: {\"AWS\": \"arn:aws:iam::ACCOUNT:root\"}` + `ecr:*` (or any broad\naction set) is the **root-delegation pattern**. It delegates repository\naccess control to the account's IAM identity-based policies — anyone with\nthe right IAM permissions can use the repo, anyone without cannot. This is\nthe NORMAL and EXPECTED pattern for ECR repos that rely on IAM for access\ncontrol. Do NOT flag it as CONFIG_GAP or any other finding. It is functionally\nequivalent to the empty repositoryPolicy (both defer to IAM). Classify this\nstatement as SAME_ACCOUNT \u002F OK (row 1g) and proceed to Steps 2-4. The only\nexception: if the same statement ALSO includes a wildcard or cross-account\nprincipal alongside the root principal — classify by the WIDEST principal\n(row 1a-1f apply to the wildcard\u002Fcross-account portion).\n\n**Special case — the account-root delegation statement:** A statement with\n`Principal: {\"AWS\": \"arn:aws:iam::ACCOUNT:root\"}` + `ecr:*` (or any broad\naction set) is the **root-delegation pattern**. It delegates repository\naccess control to the account's IAM identity-based policies — anyone with\nthe right IAM permissions can use the repo, anyone without cannot. This is\nthe NORMAL and EXPECTED pattern for ECR repos that rely on IAM for access\ncontrol. Do NOT flag it as CONFIG_GAP or any other finding. It is functionally\nequivalent to the empty repositoryPolicy (both defer to IAM). Classify this\nstatement as SAME_ACCOUNT \u002F OK (row 1g) and proceed to Steps 2-4. The only\nexception: if the same statement ALSO includes a wildcard or cross-account\nprincipal alongside the root principal — classify by the WIDEST principal\n(row 1a-1f apply to the wildcard\u002Fcross-account portion).\n\n**NotAction in an Allow statement** is an inverse wildcard — it grants every\nECR action EXCEPT the listed ones. Treat as ADMIN danger level (worst case)\nbecause new ECR APIs are automatically included.\n\n**Condition strength:**\n- **STRONG (downgrade by two levels):** `aws:SourceVpce` (VPC endpoint ID —\n  infrastructure-assigned, unforgeable), `aws:SourceAccount` with\n  `StringEquals`, `aws:SourceArn` with `StringEquals`\u002F`StringLike`.\n- **WEAK (no downgrade):** `aws:SourceIp` \u002F `aws:SourceIp` containing\n  `0.0.0.0\u002F0` (bypassable by anyone with a proxy or VPN; the entire internet\n  if `0.0.0.0\u002F0`), `aws:Referer`, `aws:UserAgent` (trivially forgeable).\n\n### Step 2: NO_SCAN — image scanning gaps\n\nEvaluate the scanning posture:\n\n- **`scanOnPush: false` AND any image with `imageScanStatus: null` or\n  `imageScanStatus.status` not `\"COMPLETE\"`** → **NO_SCAN**. Images are\n  entering the registry without vulnerability scanning. Any CVE in a base\n  image layer or dependency goes undetected.\n\n- **`scanOnPush: false` AND the repo has zero images** → **NO_SCAN**. The\n  repo is empty now, but the first image pushed will not be scanned.\n  Remediate preemptively.\n\n- **`scanOnPush: true` AND all images have `imageScanStatus.status:\n  \"COMPLETE\"`** → OK for this dimension. Note: basic scanning (non-enhanced)\n  does not re-scan on CVE database updates — recommend enhanced scanning for\n  production repos.\n\n- **`scanOnPush: true` AND some images have `imageScanStatus: null`** →\n  **NO_SCAN**. These images were pushed before scanOnPush was enabled and\n  were never manually scanned. Run `aws ecr start-image-scan` on each.\n\n### Step 3: NO_LIFECYCLE — lifecycle policy absence\n\n- **No `lifecyclePolicyText` present (empty string or absent field)** →\n  **NO_LIFECYCLE**. Without lifecycle rules, images accumulate indefinitely.\n  This means: (1) storage cost grows without bound, (2) stale images with\n  known vulnerabilities remain pullable, (3) the repo approaches the\n  per-repo image quota with no cleanup path.\n\n- **`lifecyclePolicyText` present but contains only a `tagStatus: tagged`\n  retention rule with no `tagStatus: untagged` rule** → still **NO_LIFECYCLE**\n  (partial gap). Untagged images are not cleaned up. Emit a CONFIG_GAP-level\n  note within the NO_LIFECYCLE finding: \"Lifecycle policy exists but lacks an\n  `untagged` cleanup rule — untagged images accumulate indefinitely.\"\n\n- **`lifecyclePolicyText` present with at least one rule** → OK for this\n  dimension. Verify the rule ordering (lowest `rulePriority` evaluated first)\n  and that the rule set is logically sound (a broad early rule does not\n  shadow a selective later rule).\n\n### Step 4: CONFIG_GAP — tag immutability, encryption, and other config gaps\n\nIf Steps 1-3 produced no PUBLIC\u002FNO_SCAN\u002FNO_LIFECYCLE finding, evaluate\nremaining configuration:\n\n- **`imageTagMutability: MUTABLE`** → **CONFIG_GAP**. Tags can be overwritten\n  by any principal with `ecr:PutImage`. A supply-chain attacker who\n  compromises a CI\u002FCD role can push a backdoored image under the `:prod` tag,\n  and the next deployment pulls the malicious image with no visible change to\n  the tag name. Immutable tags prevent this: each tag permanently maps to one\n  digest.\n\n- **Cross-account principal with METADATA-only actions and no condition** →\n  **CONFIG_GAP**. Not PUBLIC (metadata only) but still an information leak\n  (repo inventory, image counts, tag names).\n\n- **Cross-account PULL\u002FPUSH with STRONG condition (already downgraded from\n  Step 1)** → the downgrade lands here as **CONFIG_GAP** (fragile but scoped).\n\n- **`imageTagMutability: IMMUTABLE` + no other config gaps** → OK for this\n  dimension.\n\n### Step 5: Aggregation — worst finding wins\n\nThe final verdict is the **maximum severity** finding across all steps, where\nPUBLIC > NO_SCAN > NO_LIFECYCLE > CONFIG_GAP > OK:\n\n```text\nverdict = max(step1_finding, step2_finding, step3_finding, step4_finding)\n```\n\nIf no findings (all dimensions clean), the verdict is **OK**.\n\n## Output format (per repository)\n\n```text\nREPO: \u003Cregistry-id>.dkr.ecr.\u003Cregion>.amazonaws.com\u002F\u003Crepo-name>\nVERDICT: PUBLIC | NO_SCAN | NO_LIFECYCLE | CONFIG_GAP | OK\nREASON: \u003C1-2 sentences citing the worst finding and its step>\nFINDINGS:\n  - [PUBLIC] \u003Cfinding description (Step 1a)>\n  - [NO_SCAN] \u003Cfinding description (Step 2)>\n  - [OK] \u003Cdimension that passed>\nREMEDIATION: \u003Cspecific action per finding, or \"None required\" if OK>\n```\n\n### Worked example — public pull with scan off and no lifecycle\n\n```text\nREPO: 111111111111.dkr.ecr.us-east-1.amazonaws.com\u002Fapp-frontend\nVERDICT: PUBLIC\nREASON: Statement \"PublicPull\" grants ecr:BatchGetImage and\necr:GetDownloadUrlForLayer to Principal \"*\" with no condition — any AWS\naccount holder can pull every image layer, exposing source code and embedded\nsecrets (Step 1b). scanOnPush is also disabled with unscanned images present.\nFINDINGS:\n  - [PUBLIC] Principal \"*\" + PULL actions (BatchGetImage, GetDownloadUrlForLayer) with no condition (Step 1b)\n  - [NO_SCAN] scanOnPush: false + 3 images with imageScanStatus: null (Step 2)\n  - [NO_LIFECYCLE] No lifecyclePolicyText present (Step 3)\n  - [CONFIG_GAP] imageTagMutability: MUTABLE (Step 4)\nREMEDIATION:\n  1. PUBLIC — Remove the \"PublicPull\" statement or add aws:SourceAccount \u002F\n     aws:SourceVpce conditions to scope to trusted accounts\u002Fendpoints only.\n  2. NO_SCAN — Enable scan-on-push:\n     aws ecr put-image-scanning-configuration --repository-name app-frontend\n     --image-scanning-configuration scanOnPush=true --registry-id 111111111111\n  3. NO_LIFECYCLE — Apply a lifecycle policy that keeps the last 10 tagged\n     images and deletes untagged images after 1 day (see remediation CLI).\n  4. CONFIG_GAP — Set tag immutability:\n     aws ecr put-image-tag-mutability --repository-name app-frontend\n     --image-tag-mutability IMMUTABLE --registry-id 111111111111\n```\n\n## Anti-Patterns — NEVER\n\n- NEVER classify a `Principal: \"*\"` grant with `ecr:BatchGetImage` \u002F\n  `ecr:GetDownloadUrlForLayer` as anything other than PUBLIC when there is no\n  STRONG condition. Pull permissions grant access to every image layer —\n  equivalent to reading all source code, embedded secrets, and binaries.\n  This is not \"broad access\" — it is total image exposure.\n\n- NEVER flag an empty repositoryPolicy as a security gap. An ECR repo with no\n  resource-based policy relies on IAM identity-based policies for access\n  control — this is the **secure default** and more restrictive than a\n  permissive policy. Flagging it as a gap causes unnecessary policy churn\n  that can introduce exposure.\n\n- NEVER flag `Principal: {\"AWS\": \"arn:aws:iam::ACCOUNT:root\"}` + `ecr:*` as\n  a CONFIG_GAP or security finding. This is the **root-delegation statement**\n  — it delegates repository access to the account's IAM policies, exactly\n  like an empty repositoryPolicy but explicit. Without it, IAM-based access\n  patterns still work (same-account union evaluation), but its presence is\n  NOT a sign of over-permissive access. The root principal is the account\n  owner; `ecr:*` to root means \"the account owner can manage this repo via\n  IAM.\" Flagging it as CONFIG_GAP is a false positive that produces alert\n  fatigue. The equivalent in KMS is the root-of-trust statement — normal and\n  required.\n\n- NEVER flag `Principal: {\"AWS\": \"arn:aws:iam::ACCOUNT:root\"}` + `ecr:*` as\n  a CONFIG_GAP or security finding. This is the **root-delegation statement**\n  — it delegates repository access to the account's IAM policies, exactly\n  like an empty repositoryPolicy but explicit. Without it, IAM-based access\n  patterns still work (same-account union evaluation), but its presence is\n  NOT a sign of over-permissive access. The root principal is the account\n  owner; `ecr:*` to root means \"the account owner can manage this repo via\n  IAM.\" Flagging it as CONFIG_GAP is a false positive that produces alert\n  fatigue. The equivalent in KMS is the root-of-trust statement — normal and\n  required.\n\n- NEVER treat `aws:SourceIp` with `0.0.0.0\u002F0` as a real condition. This CIDR\n  is the entire internet and provides zero restriction. Any principal with a\n  proxy, VPN, or NAT gateway can route through an allowed CIDR. Treat the\n  statement as if the condition is absent.\n\n- NEVER treat `ecr:GetAuthorizationToken` in a repositoryPolicy as a\n  meaningful grant. This action is account-scoped (returns a registry-wide\n  auth token) and is evaluated at the IAM level, not the repo-policy level.\n  Its presence in a repo policy is misleading — do NOT use it to escalate the\n  verdict or classify as a PULL\u002FPUSH\u002FADMIN action.\n\n- NEVER classify a `Principal: \"*\"` grant with a STRONG condition\n  (`aws:SourceVpce`, `aws:SourceAccount`, `aws:SourceArn`) as PUBLIC. The\n  condition narrows access to a known endpoint or account. Downgrade to\n  CONFIG_GAP. Classifying it as PUBLIC conflates \"currently restricted\" with\n  \"unrestricted\" and produces alert fatigue.\n\n- NEVER overlook `NotAction` in an Allow statement. `NotAction` grants every\n  ECR action EXCEPT the listed ones — the inverse of the intended scope, and\n  almost always a misconfiguration. Treat as ADMIN danger (worst case) because\n  new ECR APIs are automatically included.\n\n- NEVER assume `scanOnPush: true` means all images are scanned. Images pushed\n  before scanOnPush was enabled are NOT retroactively scanned. Always\n  enumerate images and check per-image `imageScanStatus` — the repo-level\n  config reflects intent, not per-image reality.\n\n- NEVER assume a lifecycle policy with `tagStatus: tagged` rules cleans up\n  untagged images. Only a `tagStatus: untagged` rule deletes untagged images.\n  Without it, untagged images persist indefinitely, consuming storage and\n  counting against the image quota while being invisible to tag-based queries.\n\n- NEVER recommend setting `imageTagMutability: IMMUTABLE` without warning\n  that existing mutable tags remain mutable until overwritten. The setting\n  applies to future tag operations only — a tag that was overwritten before\n  the change keeps its current digest. Re-push affected images to pin the\n  intended digest.\n\n- NEVER ignore lifecycle policy `rulePriority` ordering. Rules are evaluated\n  lowest-number-first and first-match-wins. A broad retention\u002Fdeletion rule\n  at priority 1 shadows all subsequent rules. The most selective rule must\n  have the lowest priority number.\n\n- NEVER assume cross-region replication does not propagate repository\n  policies. ECR replication copies the source repo's repositoryPolicy to\n  replicas in target regions. A public policy on a source repo is\n  automatically multi-region. Audit replicas independently when replication\n  is configured.\n\n- NEVER confuse ECR Private with ECR Public. ECR Private\n  (`api.ecr.\u003Cregion>.amazonaws.com`) uses repositoryPolicy for access control.\n  ECR Public (`public.ecr.aws`) uses catalog-level visibility — there is no\n  per-repo policy for public access. This skill audits private repositories\n  only.\n\n- NEVER recommend deleting an ECR repository as remediation without first\n  verifying that no running workloads pull from it. Repository deletion is\n  irreversible — all images are permanently lost. Run `aws ecr describe-images`\n  and check ECS\u002FEC2\u002FEKS task definitions for references before recommending\n  deletion.\n\n- NEVER classify a same-account-only repositoryPolicy with named principals\n  as PUBLIC. Same-account access is governed by IAM identity-based policies\n  (union evaluation), which provides a second authorization layer. Flag\n  CONFIG_GAP at worst for same-account metadata-only cross-principal access.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (PutImageScanningConfiguration, PutLifecyclePolicy,\n  PutImageTagMutability, DeleteRepositoryPolicy, DeleteRepository), the\n  auditor MUST emit:\n  `CONFIRM: About to \u003Caction> on repository \u003Cname> in account \u003Caccount>.\n  This affects \u003Cconsequence>. Proceed? (yes\u002Fno)`\n  Do NOT execute the CLI command until the operator confirms.\n\n- **PutImageTagMutability is irreversible for existing tags.** Changing from\n  MUTABLE to IMMUTABLE prevents future overwrites but does not restore\n  previously overwritten tags. Changing from IMMUTABLE to MUTABLE re-enables\n  overwrites for all tags. Warn the operator about both directions.\n\n- **PutLifecyclePolicy can delete images immediately.** A lifecycle policy\n  with `tagStatus: any` and `countNumberInList: 1` evaluates on the next\n  lifecycle evaluation cycle (within ~24 hours) and can delete images\n  matching the rule. ALWAYS run `aws ecr get-lifecycle-policy-preview` to\n  dry-run the policy before applying it. The preview shows exactly which\n  images would be deleted.\n\n- Confirm the repository exists and is accessible:\n  `aws ecr describe-repositories --repository-names \u003Cname> --registry-id \u003Cid>`\n  — fail closed (skip remediation) if it returns an error.\n\n- Capture the current configuration for rollback before any modification:\n  ```bash\n  aws ecr get-repository-policy --repository-name \u003Cname> --registry-id \u003Cid> \\\n    --output json > \u002Ftmp\u002F\u003Cname>-policy-backup-$(date +%s).json\n  aws ecr get-lifecycle-policy --repository-name \u003Cname> --registry-id \u003Cid> \\\n    --output json > \u002Ftmp\u002F\u003Cname>-lifecycle-backup-$(date +%s).json\n  ```\n\n- For PUBLIC findings (wildcard principal with pull\u002Fpush, no condition),\n  treat as incident-response. Audit CloudTrail for `ecr:BatchGetImage` \u002F\n  `ecr:GetDownloadUrlForLayer` events from external principals during the\n  exposure window. Any pulled image should be considered potentially\n  inspected for embedded secrets — rotate any secrets found in image layers.\n\n- Prefer additive changes (add a Deny statement, add a condition) over\n  destructive changes (remove an Allow statement) — additive changes are\n  reversible and do not risk breaking existing pull workflows. The safe\n  sequence for a PUBLIC finding is: (1) back up policy, (2) add a Deny that\n  blocks the wildcard principal, (3) verify the Deny is effective via policy\n  preview, (4) only then remove the offending Allow statement.\n\n## Remediation guidance\n\nPer-verdict remediation guidance (PUBLIC, NO_SCAN, NO_LIFECYCLE, CONFIG_GAP, OK) with full CLI sequences moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when emitting REMEDIATION or before executing any state-changing CLI.\n\n## Deep reference: ECR authorization and scanning internals\n\nDeep ECR authorization and scanning internals moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand for the policy-vs-IAM evaluation pipeline, lifecycle rule evaluation, basic vs enhanced scanning, KMS encryption internals, and replication propagation.\n\n## Recent AWS features (2024-2026)\n\nRecent AWS features (2024-2026) moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when auditing enhanced scanning, pull-through caches, replication, or lifecycle enhancements.\n\n## References (load on demand)\n\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — live-account pre-flight checks, multi-repo sweep pagination, and per-verdict remediation CLI sequences moved from SKILL.md.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step 0 expert-knowledge deep dives, ECR authorization and scanning internals, and recent AWS features moved from SKILL.md.\n\n## Domain\n\nAWS CloudOps \u002F ECR Container Registry Security & Supply-Chain Compliance.\n\n## AWS documentation\n\n- **Amazon ECR User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECR\u002Flatest\u002Fuserguide\u002Fwhat-is-ecr.html\n- **ECR Security** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECR\u002Flatest\u002Fuserguide\u002Fsecurity.html\n- **ECR API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECR\u002Flatest\u002FAPIReference\u002F\n- **ECR CLI Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fecr\u002F\n- **Enhanced scanning with Amazon Inspector** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECR\u002Flatest\u002Fuserguide\u002Fimage-scanning-enhanced.html\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":39},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"complexity":32,"entry_point":33,"when_to_use":34,"requires_llm":35,"verdict_shape":36,"invocation_schema":37,"supports_pipeline":35,"activation_triggers":38},"ecr, storage, security, container, supply-chain, image-scanning, lifecycle, tag-immutability, audit","2","Jacky Chan — AWS Community Builder","aws-cloudops","Storage","0.1.0","ECR, container registry, repository policy, scanOnPush, image scanning, lifecycle policy, tag immutability, Principal:\"*\", cross-account ECR, supply chain security, container image audit, unscanned images, ecr:GetDownloadUrlForLayer, ecr:BatchGetImage, ecr:PutImage, aws:SourceVpce, image vulnerability, KMS encryption ECR, ECR public access","high","false","Reviewing an ECR repository before production deployment, checking for public image access via repositoryPolicy, validating scan-on-push enablement, auditing lifecycle-policy coverage, hardening tag immutability, or assessing container supply-chain posture across an account.","true","PUBLIC | NO_SCAN | NO_LIFECYCLE | CONFIG_GAP | OK","Input: either (a) an ECR repository configuration bundle (repositoryPolicy JSON + imageScanningConfiguration + imageTagMutability + lifecyclePolicyText + image metadata), OR (b) a repository name\u002FARN for live-account audit. Output: deterministic REPO\u002FVERDICT\u002FREASON\u002FFINDINGS\u002FREMEDIATION block per repository, where VERDICT is one of {PUBLIC, NO_SCAN, NO_LIFECYCLE, CONFIG_GAP, OK}.","audit this ECR repository, is my ECR repo public, check ECR repository policy, ECR scanOnPush enabled, ECR lifecycle policy, unscanned container images, tag immutability check, ECR cross-account access, container image vulnerability scan, hardening ECR repository","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline config classification. Live-account audits use aws ecr describe-repositories, aws ecr get-repository-policy, aws ecr describe-images, aws ecr get-lifecycle-policy, and aws ecr put-image-scanning-configuration (AWS CLI v2, SSO or key-based credentials).","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fecr-repository-auditor",0,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills","https:\u002F\u002Fgithub.com\u002Fjhkchan","CTO & Co-Founder @Beever-AI  & @votee. CAISP. AWS Community Builder. Organizer@GDGCloudHK. MongoDB Champion. Technopreneur + Infornographer.","2026-09-24 08:54:10",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill ecr-repository-auditor",{"tool":54,"command":55},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill ecr-repository-auditor",{"tool":57,"command":58},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill ecr-repository-auditor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002FSKILL.md",true,[62,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",9075,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Feval\u002Ftest-cases.yaml",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"evals\u002Fbaselines\u002Fclean-ok.md",306,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fbaselines\u002Fclean-ok.md",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"evals\u002Fbaselines\u002Fno-lifecycle-policy.md",423,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fbaselines\u002Fno-lifecycle-policy.md",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"evals\u002Fbaselines\u002Fpublic-pull-sourcevpce-scoped-config-gap.md",571,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fbaselines\u002Fpublic-pull-sourcevpce-scoped-config-gap.md",{"path":81,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":82,"sourceHtmlUrl":83},"evals\u002Fbaselines\u002Fpublic-pull-wildcard-no-condition.md",629,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fbaselines\u002Fpublic-pull-wildcard-no-condition.md",{"path":85,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":86,"sourceHtmlUrl":87},"evals\u002Fbaselines\u002Fscan-off-unscanned-images.md",479,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fbaselines\u002Fscan-off-unscanned-images.md",{"path":89,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":90,"sourceHtmlUrl":91},"evals\u002Fbaselines\u002Ftag-mutable-config-gap.md",451,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fbaselines\u002Ftag-mutable-config-gap.md",{"path":93,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":94,"sourceHtmlUrl":95},"evals\u002Feval_config.yaml",1897,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Feval_config.yaml",{"path":97,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":98,"sourceHtmlUrl":99},"evals\u002Fevals.json",4906,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fevals.json",{"path":101,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":102,"sourceHtmlUrl":103},"evals\u002Fprompts\u002Fclean-ok.md",732,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fprompts\u002Fclean-ok.md",{"path":105,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":106,"sourceHtmlUrl":107},"evals\u002Fprompts\u002Fno-lifecycle-policy.md",753,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fprompts\u002Fno-lifecycle-policy.md",{"path":109,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":110,"sourceHtmlUrl":111},"evals\u002Fprompts\u002Fpublic-pull-sourcevpce-scoped-config-gap.md",1118,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fprompts\u002Fpublic-pull-sourcevpce-scoped-config-gap.md",{"path":113,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":114,"sourceHtmlUrl":115},"evals\u002Fprompts\u002Fpublic-pull-wildcard-no-condition.md",757,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fprompts\u002Fpublic-pull-wildcard-no-condition.md",{"path":117,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":118,"sourceHtmlUrl":119},"evals\u002Fprompts\u002Fscan-off-unscanned-images.md",838,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fprompts\u002Fscan-off-unscanned-images.md",{"path":121,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":122,"sourceHtmlUrl":123},"evals\u002Fprompts\u002Ftag-mutable-config-gap.md",758,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fevals\u002Fprompts\u002Ftag-mutable-config-gap.md",{"path":125,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":126,"sourceHtmlUrl":127},"examples\u002Fend-to-end.md",6297,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fexamples\u002Fend-to-end.md",{"path":129,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":130,"sourceHtmlUrl":131},"references\u002Fadvanced-patterns.md",11538,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Freferences\u002Fadvanced-patterns.md",{"path":133,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":134,"sourceHtmlUrl":135},"references\u002Fdiagnostic-commands.md",6457,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Freferences\u002Fdiagnostic-commands.md",{"path":137,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":138,"sourceHtmlUrl":139},"skill.usf.yaml",4008,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecr-repository-auditor\u002Fskill.usf.yaml",[141,148,155,162,169,176],{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":19},"01M7ADVD60X4PCAPKSE58P9NDC","xray-tracing-deployer","Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL \u002F method \u002F service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry \u002F ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS \u002F EKS \u002F Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxray-tracing-deployer\u002FSKILL.md",[],[],{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":19},"01M7ADTVJ7DCBM9CB1FY51GH7J","wellarchitected-workload-auditor","Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-workload-auditor\u002FSKILL.md",[],[],{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":19},"01M7ADT59G6FTTNZYHT2QRPNNP","wellarchitected-review-operator","Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer \u002F get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-review-operator\u002FSKILL.md",[],[],{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":19},"01M7ADSH5JA9QHNPPHQCD7EVA7","wafv2-web-acl-deployer","Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB\u002FAPI Gateway\u002FCloudFront, or configuring CAPTCHA\u002FChallenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-deployer\u002FSKILL.md",[],[],{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":19},"01M7ADRYFAT8R73FBNCHRC573X","wafv2-web-acl-auditor","Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow\u002Fbypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-auditor\u002FSKILL.md",[],[],{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":19},"01M7ADR8W7G72JX4KFGN03QK8Q","waf-rule-deployer","Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwaf-rule-deployer\u002FSKILL.md",[],[]]