[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EEZFK37VP1YNPKYX0W2J2J":3,"skill-same:01M7EEZFK37VP1YNPKYX0W2J2J":76},{"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":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M7EEZFK37VP1YNPKYX0W2J2J","aws-essentials",null,"Use when standing up the core AWS surface a small product needs: hardening a fresh account, a private S3 bucket, encrypted RDS Postgres, ECS Fargate vs EC2, CloudFront + OAC, or scoping an IAM policy to least privilege. NOT the CI pipeline that ships the container (that is `deployment`), NOT app-code access-control review (that is `secure-coding`).","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Faws-essentials\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: aws-essentials\ndescription: \"Use when standing up the core AWS surface a small product needs: hardening a fresh account, a private S3 bucket, encrypted RDS Postgres, ECS Fargate vs EC2, CloudFront + OAC, or scoping an IAM policy to least privilege. NOT the CI pipeline that ships the container (that is `deployment`), NOT app-code access-control review (that is `secure-coding`).\"\ntags: [aws, cloud, iam, s3, infrastructure]\nrecommends: [deployment, secure-coding, dynamodb, postgresdb]\norigin: risco\n---\n\n# AWS essentials — the core surface a small product needs, secured from the first command\n\nStand up the foundational AWS services a one-app product actually uses — IAM, S3, ECS Fargate,\nRDS, CloudFront — with the security defaults that prevent the incidents (public buckets,\ngod-mode app roles, long-lived keys, unencrypted databases). Pick the right tier for *small*\n(one app, modest traffic, two engineers), provision it correctly, and wire it without foot-guns.\n\n```text\naccount hardening → IAM (roles + scoped policies) → S3 (private) \u002F RDS (encrypted) \u002F ECS Fargate → CloudFront (OAC) → infra exists, wired, least-privilege\n```\n\n## Service decision table\n\n| Need | Use | Use instead if |\n|------|-----|----------------|\n| Object\u002Ffile storage (uploads, assets, backups) | **S3** (private bucket) | — |\n| Relational data (users, orders, anything with joins) | **RDS** (Postgres\u002FMySQL) | key-value \u002F serverless access pattern → `dynamodb` skill |\n| Long-running container\u002FAPI | **ECS Fargate** | steady ~70%+ CPU 24\u002F7 → EC2 launch type with Savings Plans\u002FSpot; GPU or >120 GB RAM → EC2 |\n| Static site \u002F SPA + public assets | **S3 + CloudFront** | edge functions \u002F global KV → `..\u002Fcloudflare\u002FSKILL.md` |\n| Tiny app, no real AWS need yet | be honest → `..\u002Fvercel\u002FSKILL.md` or `..\u002Fdeployment\u002FSKILL.md` | you genuinely need AWS primitives → stay here |\n\nFargate cold start is ~30–60 s; for spiky\u002Fvariable small-product load its operational simplicity\n(no host patching, per-second billing, strong task isolation) wins. EC2 launch type only earns\nits host-management cost at sustained high utilization. (ECS Managed Instances, Sept 2025, is a\nnewer hybrid — out of scope for a first setup.)\n\n## Account zero-day hardening checklist\n\nDo this once, before anything else. Each line has a reason; skip none.\n\n- [ ] **Enable MFA on the root user** — prefer a passkey \u002F security key (phishing-resistant). Root with no MFA is the single highest-blast-radius account.\n- [ ] **Stop using root for daily work** — root is for the handful of root-only tasks (close account, change support plan). Everything else uses an IAM identity.\n- [ ] **Create an admin identity via IAM Identity Center** (or an assumable admin role). Humans log in to a role with temporary creds, not a static user.\n- [ ] **Delete any root access keys** — root should have zero access keys. If one exists, it is a liability with no upside.\n- [ ] **No long-lived IAM-user access keys for apps or CI** — apps use task roles, CI uses OIDC (see `..\u002Fdeployment\u002FSKILL.md`).\n- [ ] **Set your home region** and create resources there consistently (one exception below: ACM certs for CloudFront must be in `us-east-1`).\n- [ ] **Create a billing\u002Fcost budget alarm** — a misconfigured resource should page you, not surprise you on the invoice.\n\n## IAM — least privilege without guessing\n\nTwo principal types. **IAM users** = long-lived humans\u002Fkeys; avoid them for workloads. **Roles**\n= an identity something *assumes* to get temporary credentials — this is what ECS tasks, Lambda,\nCI, and federated humans use. Default to roles: a temporary credential beats a long-lived `AKIA…`\nkey that lives forever in a `.env`. (IAM governs who may call AWS APIs; access control *inside*\nyour app code is `..\u002Fsecure-coding\u002FSKILL.md`.)\n\nA policy is a JSON document. The four parts that matter:\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [{\n    \"Effect\": \"Allow\",\n    \"Action\": [\"s3:GetObject\", \"s3:PutObject\"],\n    \"Resource\": \"arn:aws:s3:::acme-uploads\u002Fusers\u002F*\",\n    \"Condition\": { \"StringEquals\": { \"aws:SecureTransport\": \"true\" } }\n  }]\n}\n```\n\n`Effect` (Allow\u002FDeny) · `Action` (which API calls) · `Resource` (which ARNs) · `Condition`\n(extra constraints). The whole game is keeping `Action` and `Resource` narrow.\n\n**The workflow — start broad, then tighten (do not hand-author from zero):**\n\n1. Attach the closest **AWS managed policy** to get the app working.\n2. Let it run, then use **IAM Access Analyzer → generate policy from CloudTrail activity** to\n   produce a fine-grained policy from what it *actually* called.\n3. Replace the managed policy with the generated one.\n4. **Validate** with Access Analyzer (runs 100+ policy checks) and review findings.\n5. Periodically prune with **last-accessed data** — remove permissions nothing has used.\n\n```jsonc\n\u002F\u002F Bad — one leak owns the account\n{ \"Effect\": \"Allow\", \"Action\": \"*\", \"Resource\": \"*\" }\n\n\u002F\u002F Good — exactly what this service does, on exactly its resources\n{ \"Effect\": \"Allow\",\n  \"Action\": [\"s3:GetObject\", \"s3:PutObject\"],\n  \"Resource\": \"arn:aws:s3:::acme-uploads\u002Fusers\u002F*\" }\n```\n\nAn ECS task needs a **trust policy** (who may assume the role) plus a **permission policy**\n(what it may do). Trust policy for a task role:\n\n```json\n{ \"Version\": \"2012-10-17\",\n  \"Statement\": [{ \"Effect\": \"Allow\",\n    \"Principal\": { \"Service\": \"ecs-tasks.amazonaws.com\" },\n    \"Action\": \"sts:AssumeRole\" }] }\n```\n\nPolicy JSON anatomy, condition keys, Access Analyzer CLI flow, and copy-ready scoped templates\n(S3 one-prefix R\u002FW, read one Secrets Manager secret, write CloudWatch logs, ECS trust) →\n`references\u002Fiam-least-privilege.md`.\n\n## S3 — private object storage\n\nCreate a bucket. The defaults are already what you want:\n\n```bash\naws s3api create-bucket \\\n  --bucket acme-uploads \\\n  --region eu-west-1 \\\n  --create-bucket-configuration LocationConstraint=eu-west-1\n# Since Apr 2023, this bucket is already: Block Public Access ON (all four),\n# Object Ownership = bucket-owner-enforced (ACLs disabled), SSE-S3 on every object.\n```\n\n**Keep all of that.** Do not re-enable ACLs; do not turn off Block Public Access. Grant access\ntwo ways instead: a **bucket policy** (resource-side, e.g. allow one CloudFront distribution) or\nan **IAM identity policy** (subject-side, e.g. the task role above). For browser uploads, hand\nthe client a **presigned URL** so the app never proxies the bytes and the bucket stays private:\n\n```bash\naws s3 presign s3:\u002F\u002Facme-uploads\u002Fusers\u002F123\u002Favatar.png --expires-in 900\n```\n\n```text\nBad:  set bucket to public-read so the \u003Cimg> tags work\nGood: bucket stays private → presigned URLs for direct upload\u002Fdownload,\n      and CloudFront + OAC for public-read web content (see below)\n```\n\n## Compute — ECS Fargate first\n\nRun the container on Fargate (rationale in the decision table). The mistake that costs an\nafternoon every time:\n\n> **Task role vs execution role — they are different.**\n> - **Execution role**: lets *ECS itself* pull the image from ECR and push logs to CloudWatch. Start from the managed `AmazonECSTaskExecutionRolePolicy`.\n> - **Task role**: the identity *your application code* assumes at runtime to call AWS (read the S3 bucket, read a secret). This is where your scoped least-privilege policy goes.\n> Putting app permissions on the execution role (or vice-versa) is the classic \"works in console, 403 at runtime\" bug.\n\nNetwork layout: **tasks in private subnets**, a load balancer (ALB) in public subnets, egress via\nNAT. The DB and tasks never get public IPs. EC2 launch type only if you hit the steady-utilization\nor hardware thresholds above. Full task-def + service CLI path lives in `..\u002Fdeployment\u002FSKILL.md`\n(that skill owns the ship step); this skill owns the roles and networking it runs on.\n\n## RDS — managed relational DB\n\n```bash\naws rds create-db-instance \\\n  --db-instance-identifier acme-prod \\\n  --engine postgres \\\n  --db-instance-class db.t4g.small \\\n  --allocated-storage 20 \\\n  --storage-encrypted --kms-key-id \u003Cyour-rds-cmk> \\\n  --multi-az \\\n  --no-publicly-accessible \\\n  --master-username acme --manage-master-user-password \\\n  --vpc-security-group-ids sg-app-db\n```\n\n> **Encrypt at create time — you cannot encrypt an existing instance in place.** Storage\n> encryption (AES-256 via KMS) must be set at creation; it then covers backups, read replicas,\n> and snapshots. To fix an unencrypted instance you must snapshot → copy-snapshot *with*\n> encryption → restore (Multi-AZ *clusters* can't even do that directly). Prefer a\n> customer-managed KMS key dedicated to RDS.\n\nTwo more non-negotiables: the DB security group **references the app's security group**, never\n`0.0.0.0\u002F0` (a DB open to the internet is a breach, not a convenience); credentials live in\n**Secrets Manager** with managed rotation (`--manage-master-user-password` above), never in task\nenv vars. Use `--multi-az` for production HA. Full recipe (SG wiring, Secrets Manager rotation,\nconnecting from ECS) → `references\u002Frds-cloudfront-recipes.md`. Schema, indexes and query tuning\nonce the instance exists → `..\u002Fpostgresdb\u002FSKILL.md`.\n\n## CloudFront + OAC — public web content, private bucket\n\nTo serve S3 content publicly, do **not** make the bucket public. Put CloudFront in front and\ngrant it via **Origin Access Control (OAC)** — the modern replacement for the legacy OAI:\n\n- OAC uses short-term, rotated credentials and a resource-based bucket policy scoped to the\n  distribution ARN; CloudFront→S3 is always HTTPS with \"Sign requests\" (the default).\n- OAC supports SSE-KMS origins and all regions. **OAI is legacy — never reach for it.**\n- The bucket keeps Block Public Access **on**; you grant only the distribution, by bucket policy.\n- Set the viewer protocol policy to **redirect-to-HTTPS**; ACM cert for a custom domain must be\n  in **`us-east-1`**.\n\nFull CLI: create OAC → distribution → S3 bucket policy JSON → invalidations → custom domain →\n`references\u002Frds-cloudfront-recipes.md`.\n\n## Anti-patterns\n\n| Anti-pattern | Why it bites | Fix |\n|---|---|---|\n| Public-read S3 bucket | Anyone enumerates\u002Fdownloads everything; classic breach headline | Keep Block Public Access on; presigned URLs or CloudFront+OAC |\n| Re-enabling S3 ACLs | Brings back the confused-deputy\u002Fownership mess April-2023 defaults removed | Leave bucket-owner-enforced; use bucket\u002FIAM policies |\n| `AdministratorAccess` on an app\u002Ftask role | One leaked task credential = full account compromise | Scope to the exact actions+ARNs the service uses |\n| `\"Action\": \"*\", \"Resource\": \"*\"` policy | Same blast radius, just hand-written | Generate from CloudTrail via Access Analyzer; validate |\n| IAM-user access keys in app\u002F`.env`\u002Fcommit | Long-lived, never rotated, leak forever | Task role (app) \u002F OIDC (CI) — temporary creds |\n| Unencrypted RDS | Can't encrypt later without snapshot-copy-restore downtime | `--storage-encrypted` at create, customer-managed KMS key |\n| DB security group open to `0.0.0.0\u002F0` | Database directly reachable from the internet | SG references the app SG only; `--no-publicly-accessible` |\n| CloudFront with OAI | Legacy; misses SSE-KMS, weaker credential model | Use OAC, bucket policy scoped to the distribution ARN |\n| Secrets in task env vars | Leak via logs, console, task definition history | Secrets Manager + managed rotation, injected at runtime |\n| Root user for daily ops | Highest blast radius, no per-action attribution | Root only for root-only tasks; admin via Identity Center |\n| No MFA on root | One phished password = total account loss | Passkey\u002Fsecurity-key MFA on root and every human |\n| Confusing task role and execution role | App gets 403 at runtime, or ECS can't pull the image | Execution = pull image\u002Flogs; task = app's runtime perms |\n","# AWS essentials — the core surface a small product needs, secured from the first command\n\nStand up the foundational AWS services a one-app product actually uses — IAM, S3, ECS Fargate,\nRDS, CloudFront — with the security defaults that prevent the incidents (public buckets,\ngod-mode app roles, long-lived keys, unencrypted databases). Pick the right tier for *small*\n(one app, modest traffic, two engineers), provision it correctly, and wire it without foot-guns.\n\n```text\naccount hardening → IAM (roles + scoped policies) → S3 (private) \u002F RDS (encrypted) \u002F ECS Fargate → CloudFront (OAC) → infra exists, wired, least-privilege\n```\n\n## Service decision table\n\n| Need | Use | Use instead if |\n|------|-----|----------------|\n| Object\u002Ffile storage (uploads, assets, backups) | **S3** (private bucket) | — |\n| Relational data (users, orders, anything with joins) | **RDS** (Postgres\u002FMySQL) | key-value \u002F serverless access pattern → `dynamodb` skill |\n| Long-running container\u002FAPI | **ECS Fargate** | steady ~70%+ CPU 24\u002F7 → EC2 launch type with Savings Plans\u002FSpot; GPU or >120 GB RAM → EC2 |\n| Static site \u002F SPA + public assets | **S3 + CloudFront** | edge functions \u002F global KV → `..\u002Fcloudflare\u002FSKILL.md` |\n| Tiny app, no real AWS need yet | be honest → `..\u002Fvercel\u002FSKILL.md` or `..\u002Fdeployment\u002FSKILL.md` | you genuinely need AWS primitives → stay here |\n\nFargate cold start is ~30–60 s; for spiky\u002Fvariable small-product load its operational simplicity\n(no host patching, per-second billing, strong task isolation) wins. EC2 launch type only earns\nits host-management cost at sustained high utilization. (ECS Managed Instances, Sept 2025, is a\nnewer hybrid — out of scope for a first setup.)\n\n## Account zero-day hardening checklist\n\nDo this once, before anything else. Each line has a reason; skip none.\n\n- [ ] **Enable MFA on the root user** — prefer a passkey \u002F security key (phishing-resistant). Root with no MFA is the single highest-blast-radius account.\n- [ ] **Stop using root for daily work** — root is for the handful of root-only tasks (close account, change support plan). Everything else uses an IAM identity.\n- [ ] **Create an admin identity via IAM Identity Center** (or an assumable admin role). Humans log in to a role with temporary creds, not a static user.\n- [ ] **Delete any root access keys** — root should have zero access keys. If one exists, it is a liability with no upside.\n- [ ] **No long-lived IAM-user access keys for apps or CI** — apps use task roles, CI uses OIDC (see `..\u002Fdeployment\u002FSKILL.md`).\n- [ ] **Set your home region** and create resources there consistently (one exception below: ACM certs for CloudFront must be in `us-east-1`).\n- [ ] **Create a billing\u002Fcost budget alarm** — a misconfigured resource should page you, not surprise you on the invoice.\n\n## IAM — least privilege without guessing\n\nTwo principal types. **IAM users** = long-lived humans\u002Fkeys; avoid them for workloads. **Roles**\n= an identity something *assumes* to get temporary credentials — this is what ECS tasks, Lambda,\nCI, and federated humans use. Default to roles: a temporary credential beats a long-lived `AKIA…`\nkey that lives forever in a `.env`. (IAM governs who may call AWS APIs; access control *inside*\nyour app code is `..\u002Fsecure-coding\u002FSKILL.md`.)\n\nA policy is a JSON document. The four parts that matter:\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [{\n    \"Effect\": \"Allow\",\n    \"Action\": [\"s3:GetObject\", \"s3:PutObject\"],\n    \"Resource\": \"arn:aws:s3:::acme-uploads\u002Fusers\u002F*\",\n    \"Condition\": { \"StringEquals\": { \"aws:SecureTransport\": \"true\" } }\n  }]\n}\n```\n\n`Effect` (Allow\u002FDeny) · `Action` (which API calls) · `Resource` (which ARNs) · `Condition`\n(extra constraints). The whole game is keeping `Action` and `Resource` narrow.\n\n**The workflow — start broad, then tighten (do not hand-author from zero):**\n\n1. Attach the closest **AWS managed policy** to get the app working.\n2. Let it run, then use **IAM Access Analyzer → generate policy from CloudTrail activity** to\n   produce a fine-grained policy from what it *actually* called.\n3. Replace the managed policy with the generated one.\n4. **Validate** with Access Analyzer (runs 100+ policy checks) and review findings.\n5. Periodically prune with **last-accessed data** — remove permissions nothing has used.\n\n```jsonc\n\u002F\u002F Bad — one leak owns the account\n{ \"Effect\": \"Allow\", \"Action\": \"*\", \"Resource\": \"*\" }\n\n\u002F\u002F Good — exactly what this service does, on exactly its resources\n{ \"Effect\": \"Allow\",\n  \"Action\": [\"s3:GetObject\", \"s3:PutObject\"],\n  \"Resource\": \"arn:aws:s3:::acme-uploads\u002Fusers\u002F*\" }\n```\n\nAn ECS task needs a **trust policy** (who may assume the role) plus a **permission policy**\n(what it may do). Trust policy for a task role:\n\n```json\n{ \"Version\": \"2012-10-17\",\n  \"Statement\": [{ \"Effect\": \"Allow\",\n    \"Principal\": { \"Service\": \"ecs-tasks.amazonaws.com\" },\n    \"Action\": \"sts:AssumeRole\" }] }\n```\n\nPolicy JSON anatomy, condition keys, Access Analyzer CLI flow, and copy-ready scoped templates\n(S3 one-prefix R\u002FW, read one Secrets Manager secret, write CloudWatch logs, ECS trust) →\n`references\u002Fiam-least-privilege.md`.\n\n## S3 — private object storage\n\nCreate a bucket. The defaults are already what you want:\n\n```bash\naws s3api create-bucket \\\n  --bucket acme-uploads \\\n  --region eu-west-1 \\\n  --create-bucket-configuration LocationConstraint=eu-west-1\n# Since Apr 2023, this bucket is already: Block Public Access ON (all four),\n# Object Ownership = bucket-owner-enforced (ACLs disabled), SSE-S3 on every object.\n```\n\n**Keep all of that.** Do not re-enable ACLs; do not turn off Block Public Access. Grant access\ntwo ways instead: a **bucket policy** (resource-side, e.g. allow one CloudFront distribution) or\nan **IAM identity policy** (subject-side, e.g. the task role above). For browser uploads, hand\nthe client a **presigned URL** so the app never proxies the bytes and the bucket stays private:\n\n```bash\naws s3 presign s3:\u002F\u002Facme-uploads\u002Fusers\u002F123\u002Favatar.png --expires-in 900\n```\n\n```text\nBad:  set bucket to public-read so the \u003Cimg> tags work\nGood: bucket stays private → presigned URLs for direct upload\u002Fdownload,\n      and CloudFront + OAC for public-read web content (see below)\n```\n\n## Compute — ECS Fargate first\n\nRun the container on Fargate (rationale in the decision table). The mistake that costs an\nafternoon every time:\n\n> **Task role vs execution role — they are different.**\n> - **Execution role**: lets *ECS itself* pull the image from ECR and push logs to CloudWatch. Start from the managed `AmazonECSTaskExecutionRolePolicy`.\n> - **Task role**: the identity *your application code* assumes at runtime to call AWS (read the S3 bucket, read a secret). This is where your scoped least-privilege policy goes.\n> Putting app permissions on the execution role (or vice-versa) is the classic \"works in console, 403 at runtime\" bug.\n\nNetwork layout: **tasks in private subnets**, a load balancer (ALB) in public subnets, egress via\nNAT. The DB and tasks never get public IPs. EC2 launch type only if you hit the steady-utilization\nor hardware thresholds above. Full task-def + service CLI path lives in `..\u002Fdeployment\u002FSKILL.md`\n(that skill owns the ship step); this skill owns the roles and networking it runs on.\n\n## RDS — managed relational DB\n\n```bash\naws rds create-db-instance \\\n  --db-instance-identifier acme-prod \\\n  --engine postgres \\\n  --db-instance-class db.t4g.small \\\n  --allocated-storage 20 \\\n  --storage-encrypted --kms-key-id \u003Cyour-rds-cmk> \\\n  --multi-az \\\n  --no-publicly-accessible \\\n  --master-username acme --manage-master-user-password \\\n  --vpc-security-group-ids sg-app-db\n```\n\n> **Encrypt at create time — you cannot encrypt an existing instance in place.** Storage\n> encryption (AES-256 via KMS) must be set at creation; it then covers backups, read replicas,\n> and snapshots. To fix an unencrypted instance you must snapshot → copy-snapshot *with*\n> encryption → restore (Multi-AZ *clusters* can't even do that directly). Prefer a\n> customer-managed KMS key dedicated to RDS.\n\nTwo more non-negotiables: the DB security group **references the app's security group**, never\n`0.0.0.0\u002F0` (a DB open to the internet is a breach, not a convenience); credentials live in\n**Secrets Manager** with managed rotation (`--manage-master-user-password` above), never in task\nenv vars. Use `--multi-az` for production HA. Full recipe (SG wiring, Secrets Manager rotation,\nconnecting from ECS) → `references\u002Frds-cloudfront-recipes.md`. Schema, indexes and query tuning\nonce the instance exists → `..\u002Fpostgresdb\u002FSKILL.md`.\n\n## CloudFront + OAC — public web content, private bucket\n\nTo serve S3 content publicly, do **not** make the bucket public. Put CloudFront in front and\ngrant it via **Origin Access Control (OAC)** — the modern replacement for the legacy OAI:\n\n- OAC uses short-term, rotated credentials and a resource-based bucket policy scoped to the\n  distribution ARN; CloudFront→S3 is always HTTPS with \"Sign requests\" (the default).\n- OAC supports SSE-KMS origins and all regions. **OAI is legacy — never reach for it.**\n- The bucket keeps Block Public Access **on**; you grant only the distribution, by bucket policy.\n- Set the viewer protocol policy to **redirect-to-HTTPS**; ACM cert for a custom domain must be\n  in **`us-east-1`**.\n\nFull CLI: create OAC → distribution → S3 bucket policy JSON → invalidations → custom domain →\n`references\u002Frds-cloudfront-recipes.md`.\n\n## Anti-patterns\n\n| Anti-pattern | Why it bites | Fix |\n|---|---|---|\n| Public-read S3 bucket | Anyone enumerates\u002Fdownloads everything; classic breach headline | Keep Block Public Access on; presigned URLs or CloudFront+OAC |\n| Re-enabling S3 ACLs | Brings back the confused-deputy\u002Fownership mess April-2023 defaults removed | Leave bucket-owner-enforced; use bucket\u002FIAM policies |\n| `AdministratorAccess` on an app\u002Ftask role | One leaked task credential = full account compromise | Scope to the exact actions+ARNs the service uses |\n| `\"Action\": \"*\", \"Resource\": \"*\"` policy | Same blast radius, just hand-written | Generate from CloudTrail via Access Analyzer; validate |\n| IAM-user access keys in app\u002F`.env`\u002Fcommit | Long-lived, never rotated, leak forever | Task role (app) \u002F OIDC (CI) — temporary creds |\n| Unencrypted RDS | Can't encrypt later without snapshot-copy-restore downtime | `--storage-encrypted` at create, customer-managed KMS key |\n| DB security group open to `0.0.0.0\u002F0` | Database directly reachable from the internet | SG references the app SG only; `--no-publicly-accessible` |\n| CloudFront with OAI | Legacy; misses SSE-KMS, weaker credential model | Use OAC, bucket policy scoped to the distribution ARN |\n| Secrets in task env vars | Leak via logs, console, task definition history | Secrets Manager + managed rotation, injected at runtime |\n| Root user for daily ops | Highest blast radius, no per-action attribution | Root only for root-only tasks; admin via Identity Center |\n| No MFA on root | One phished password = total account loss | Passkey\u002Fsecurity-key MFA on root and every human |\n| Confusing task role and execution role | App gets 403 at runtime, or ECS can't pull the image | Execution = pull image\u002Flogs; task = app's runtime perms |\n",{"name":5,"tags":24,"origin":30,"recommends":31,"description":7},[25,26,27,28,29],"aws","cloud","iam","s3","infrastructure","risco",[32,33,34,35],"deployment","secure-coding","dynamodb","postgresdb","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Faws-essentials",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill aws-essentials",{"tool":50,"command":51},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill aws-essentials",{"tool":53,"command":54},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill aws-essentials","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Faws-essentials\u002FSKILL.md",true,[58,64,68,72],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"evals\u002Fcases.yaml","REFERENCE","参考文档",2988,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Faws-essentials\u002Fevals\u002Fcases.yaml",{"path":65,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":66,"sourceHtmlUrl":67},"evals\u002FREADME.md",747,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Faws-essentials\u002Fevals\u002FREADME.md",{"path":69,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fiam-least-privilege.md",4953,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Faws-essentials\u002Freferences\u002Fiam-least-privilege.md",{"path":73,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Frds-cloudfront-recipes.md",4847,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Faws-essentials\u002Freferences\u002Frds-cloudfront-recipes.md",[77,85,90,97,104,111],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":84},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":86,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":84},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":84},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":84},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":84},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":84},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]