opencode-skills-collection 4.0.68 → 4.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-skills/.antigravity-install-manifest.json +266 -1
- package/bundled-skills/access-review/SKILL.md +394 -0
- package/bundled-skills/access-review/references/details.md +121 -0
- package/bundled-skills/agent-evals/SKILL.md +420 -0
- package/bundled-skills/agent-observability/SKILL.md +346 -0
- package/bundled-skills/agent-observability/references/details.md +786 -0
- package/bundled-skills/ai-agent-security/SKILL.md +393 -0
- package/bundled-skills/ai-agent-security/references/details.md +912 -0
- package/bundled-skills/ai-coding-agent-guardrails/SKILL.md +442 -0
- package/bundled-skills/ai-coding-agent-guardrails/references/details.md +753 -0
- package/bundled-skills/ai-inference-service-mesh/SKILL.md +449 -0
- package/bundled-skills/ai-pipeline-orchestration/SKILL.md +287 -0
- package/bundled-skills/ai-red-teaming/SKILL.md +409 -0
- package/bundled-skills/ai-security-hardening/SKILL.md +343 -0
- package/bundled-skills/ai-sre-incident-response/SKILL.md +336 -0
- package/bundled-skills/alerting-oncall/SKILL.md +458 -0
- package/bundled-skills/alerting-oncall/references/details.md +84 -0
- package/bundled-skills/apk-redteam-pipeline/SKILL.md +446 -0
- package/bundled-skills/argocd-gitops/SKILL.md +469 -0
- package/bundled-skills/arm-templates/SKILL.md +438 -0
- package/bundled-skills/arm-templates/references/details.md +64 -0
- package/bundled-skills/asset-inventory/SKILL.md +412 -0
- package/bundled-skills/asset-inventory/references/details.md +127 -0
- package/bundled-skills/audit-logging/SKILL.md +476 -0
- package/bundled-skills/aws-cloudtrail/SKILL.md +486 -0
- package/bundled-skills/aws-cost-optimization/SKILL.md +331 -0
- package/bundled-skills/aws-ec2/SKILL.md +426 -0
- package/bundled-skills/aws-ecs-fargate/SKILL.md +388 -0
- package/bundled-skills/aws-iam/SKILL.md +463 -0
- package/bundled-skills/aws-lambda/SKILL.md +428 -0
- package/bundled-skills/aws-rds/SKILL.md +380 -0
- package/bundled-skills/aws-s3/SKILL.md +434 -0
- package/bundled-skills/aws-secrets-manager/SKILL.md +486 -0
- package/bundled-skills/aws-vpc/SKILL.md +436 -0
- package/bundled-skills/azure-ai-document-intelligence-ts/SKILL.md +1 -1
- package/bundled-skills/azure-aks/SKILL.md +423 -0
- package/bundled-skills/azure-devops/SKILL.md +457 -0
- package/bundled-skills/azure-functions-devsec/SKILL.md +436 -0
- package/bundled-skills/azure-keyvault/SKILL.md +455 -0
- package/bundled-skills/azure-keyvault/references/details.md +83 -0
- package/bundled-skills/azure-monitor-audit/SKILL.md +379 -0
- package/bundled-skills/azure-networking/SKILL.md +448 -0
- package/bundled-skills/azure-networking/references/details.md +135 -0
- package/bundled-skills/azure-sql/SKILL.md +413 -0
- package/bundled-skills/azure-sql/references/details.md +113 -0
- package/bundled-skills/azure-vms/SKILL.md +402 -0
- package/bundled-skills/azure-vms/references/details.md +134 -0
- package/bundled-skills/backup-recovery/SKILL.md +388 -0
- package/bundled-skills/bb-methodology/SKILL.md +451 -0
- package/bundled-skills/bb-methodology/references/details.md +120 -0
- package/bundled-skills/block-storage/SKILL.md +371 -0
- package/bundled-skills/blue-green-deploy/SKILL.md +453 -0
- package/bundled-skills/blue-green-deploy/references/details.md +90 -0
- package/bundled-skills/bug-bounty/SKILL.md +447 -0
- package/bundled-skills/bug-bounty/references/details.md +1316 -0
- package/bundled-skills/bugcrowd-reporting/SKILL.md +351 -0
- package/bundled-skills/business-continuity/SKILL.md +463 -0
- package/bundled-skills/career-ops/SKILL.md +186 -0
- package/bundled-skills/cdn-setup/SKILL.md +374 -0
- package/bundled-skills/change-management/SKILL.md +438 -0
- package/bundled-skills/change-management/references/details.md +105 -0
- package/bundled-skills/circleci/SKILL.md +475 -0
- package/bundled-skills/cis-benchmarks/SKILL.md +150 -0
- package/bundled-skills/cloudflare-pages/SKILL.md +318 -0
- package/bundled-skills/cloudflare-r2/SKILL.md +353 -0
- package/bundled-skills/cloudflare-workers/SKILL.md +415 -0
- package/bundled-skills/cloudflare-zero-trust/SKILL.md +361 -0
- package/bundled-skills/cloudformation/SKILL.md +461 -0
- package/bundled-skills/constraint-driven-development/SKILL.md +335 -0
- package/bundled-skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/bundled-skills/container-hardening/SKILL.md +126 -0
- package/bundled-skills/container-registries/SKILL.md +435 -0
- package/bundled-skills/container-scanning/SKILL.md +416 -0
- package/bundled-skills/convex-backend/SKILL.md +338 -0
- package/bundled-skills/dast-scanning/SKILL.md +437 -0
- package/bundled-skills/database-backups/SKILL.md +425 -0
- package/bundled-skills/datadog/SKILL.md +487 -0
- package/bundled-skills/dependency-scanning/SKILL.md +457 -0
- package/bundled-skills/devcontainers-nix/SKILL.md +416 -0
- package/bundled-skills/disaster-recovery/SKILL.md +374 -0
- package/bundled-skills/disaster-recovery/references/details.md +219 -0
- package/bundled-skills/dns-management/SKILL.md +375 -0
- package/bundled-skills/docker-compose/SKILL.md +482 -0
- package/bundled-skills/docker-management/SKILL.md +426 -0
- package/bundled-skills/ebpf-observability/SKILL.md +436 -0
- package/bundled-skills/ebpf-observability/references/details.md +542 -0
- package/bundled-skills/elk-stack/SKILL.md +487 -0
- package/bundled-skills/enterprise-vpn-attack/SKILL.md +395 -0
- package/bundled-skills/evidence-hygiene/SKILL.md +404 -0
- package/bundled-skills/feature-flags/SKILL.md +426 -0
- package/bundled-skills/feature-flags/references/details.md +86 -0
- package/bundled-skills/fedramp-compliance/SKILL.md +453 -0
- package/bundled-skills/firebase-app-platform/SKILL.md +381 -0
- package/bundled-skills/firewall-config/SKILL.md +479 -0
- package/bundled-skills/gcp-audit-logs/SKILL.md +452 -0
- package/bundled-skills/gcp-audit-logs/references/details.md +56 -0
- package/bundled-skills/gcp-cloud-functions/SKILL.md +284 -0
- package/bundled-skills/gcp-cloud-sql/SKILL.md +277 -0
- package/bundled-skills/gcp-compute/SKILL.md +319 -0
- package/bundled-skills/gcp-gke/SKILL.md +307 -0
- package/bundled-skills/gcp-networking/SKILL.md +293 -0
- package/bundled-skills/gcp-secret-manager/SKILL.md +421 -0
- package/bundled-skills/gcp-secret-manager/references/details.md +131 -0
- package/bundled-skills/gdpr-compliance/SKILL.md +451 -0
- package/bundled-skills/gdpr-compliance/references/details.md +145 -0
- package/bundled-skills/geo-audit/SKILL.md +368 -0
- package/bundled-skills/geo-brand-mentions/SKILL.md +68 -0
- package/bundled-skills/geo-brand-mentions/references/details.md +471 -0
- package/bundled-skills/geo-citability/SKILL.md +350 -0
- package/bundled-skills/geo-compare/SKILL.md +340 -0
- package/bundled-skills/geo-content/SKILL.md +383 -0
- package/bundled-skills/geo-crawlers/SKILL.md +408 -0
- package/bundled-skills/geo-llmstxt/SKILL.md +464 -0
- package/bundled-skills/geo-platform-optimizer/SKILL.md +314 -0
- package/bundled-skills/geo-proposal/SKILL.md +378 -0
- package/bundled-skills/geo-prospect/SKILL.md +225 -0
- package/bundled-skills/geo-report/SKILL.md +436 -0
- package/bundled-skills/geo-report-pdf/SKILL.md +157 -0
- package/bundled-skills/geo-schema/SKILL.md +408 -0
- package/bundled-skills/geo-technical/SKILL.md +78 -0
- package/bundled-skills/geo-technical/references/details.md +543 -0
- package/bundled-skills/git-workflow/SKILL.md +460 -0
- package/bundled-skills/github-actions/SKILL.md +368 -0
- package/bundled-skills/gitlab-ci/SKILL.md +340 -0
- package/bundled-skills/gpu-kubernetes-operations/SKILL.md +468 -0
- package/bundled-skills/gpu-server-management/SKILL.md +236 -0
- package/bundled-skills/hashicorp-vault/SKILL.md +408 -0
- package/bundled-skills/helm-charts/SKILL.md +469 -0
- package/bundled-skills/hipaa-compliance/SKILL.md +451 -0
- package/bundled-skills/hunt-aspnet/SKILL.md +321 -0
- package/bundled-skills/hunt-ato/SKILL.md +184 -0
- package/bundled-skills/hunt-auth-bypass/SKILL.md +426 -0
- package/bundled-skills/hunt-auth-bypass/references/details.md +80 -0
- package/bundled-skills/hunt-brute-force/SKILL.md +341 -0
- package/bundled-skills/hunt-business-logic/SKILL.md +281 -0
- package/bundled-skills/hunt-cache-poison/SKILL.md +382 -0
- package/bundled-skills/hunt-captcha-bypass/SKILL.md +136 -0
- package/bundled-skills/hunt-cicd/SKILL.md +311 -0
- package/bundled-skills/hunt-clickjacking/SKILL.md +110 -0
- package/bundled-skills/hunt-cors/SKILL.md +335 -0
- package/bundled-skills/hunt-dom/SKILL.md +323 -0
- package/bundled-skills/hunt-exceptional-conditions/SKILL.md +111 -0
- package/bundled-skills/hunt-file-upload/SKILL.md +202 -0
- package/bundled-skills/hunt-fintech-graphql/SKILL.md +289 -0
- package/bundled-skills/hunt-forgot-password/SKILL.md +114 -0
- package/bundled-skills/hunt-grpc/SKILL.md +317 -0
- package/bundled-skills/hunt-host-header/SKILL.md +309 -0
- package/bundled-skills/hunt-html-injection/SKILL.md +106 -0
- package/bundled-skills/hunt-http-smuggling/SKILL.md +129 -0
- package/bundled-skills/hunt-http-smuggling/references/phase2h-smuggling-cachepoison.md +177 -0
- package/bundled-skills/hunt-idor/SKILL.md +434 -0
- package/bundled-skills/hunt-jwt-crypto/SKILL.md +221 -0
- package/bundled-skills/hunt-k8s/SKILL.md +337 -0
- package/bundled-skills/hunt-laravel/SKILL.md +255 -0
- package/bundled-skills/hunt-ldap/SKILL.md +351 -0
- package/bundled-skills/hunt-lfi/SKILL.md +311 -0
- package/bundled-skills/hunt-llm-ai/SKILL.md +289 -0
- package/bundled-skills/hunt-mfa-bypass/SKILL.md +177 -0
- package/bundled-skills/hunt-misc/SKILL.md +378 -0
- package/bundled-skills/hunt-nextjs/SKILL.md +299 -0
- package/bundled-skills/hunt-nodejs/SKILL.md +263 -0
- package/bundled-skills/hunt-nosqli/SKILL.md +210 -0
- package/bundled-skills/hunt-ntlm-info/SKILL.md +314 -0
- package/bundled-skills/hunt-oauth/SKILL.md +459 -0
- package/bundled-skills/hunt-open-redirect/SKILL.md +223 -0
- package/bundled-skills/hunt-race-condition/SKILL.md +381 -0
- package/bundled-skills/hunt-race-condition/references/details.md +159 -0
- package/bundled-skills/hunt-rag-vector/SKILL.md +212 -0
- package/bundled-skills/hunt-rce/SKILL.md +444 -0
- package/bundled-skills/hunt-rce/references/details.md +110 -0
- package/bundled-skills/hunt-saml/SKILL.md +156 -0
- package/bundled-skills/hunt-session/SKILL.md +342 -0
- package/bundled-skills/hunt-shadow-api/SKILL.md +198 -0
- package/bundled-skills/hunt-source-leak/SKILL.md +345 -0
- package/bundled-skills/hunt-spa-api/SKILL.md +163 -0
- package/bundled-skills/hunt-springboot/SKILL.md +285 -0
- package/bundled-skills/hunt-sqli/SKILL.md +466 -0
- package/bundled-skills/hunt-ssrf/SKILL.md +396 -0
- package/bundled-skills/hunt-ssrf/references/details.md +179 -0
- package/bundled-skills/hunt-ssti/SKILL.md +163 -0
- package/bundled-skills/hunt-subdomain/SKILL.md +379 -0
- package/bundled-skills/hunt-tls-network/SKILL.md +399 -0
- package/bundled-skills/hunt-xxe/SKILL.md +466 -0
- package/bundled-skills/i-have-adhd/SKILL.md +170 -0
- package/bundled-skills/identity-access-management/SKILL.md +382 -0
- package/bundled-skills/identity-access-management/references/details.md +524 -0
- package/bundled-skills/incident-management/SKILL.md +484 -0
- package/bundled-skills/incident-response/SKILL.md +448 -0
- package/bundled-skills/incident-response/references/details.md +113 -0
- package/bundled-skills/interview-me/SKILL.md +248 -0
- package/bundled-skills/iso27001-compliance/SKILL.md +460 -0
- package/bundled-skills/jenkins/SKILL.md +462 -0
- package/bundled-skills/jev-use/SKILL.md +158 -0
- package/bundled-skills/kubernetes-hardening/SKILL.md +154 -0
- package/bundled-skills/kubernetes-ops/SKILL.md +449 -0
- package/bundled-skills/kubernetes-ops/references/details.md +108 -0
- package/bundled-skills/kustomize/SKILL.md +478 -0
- package/bundled-skills/linux-administration/SKILL.md +367 -0
- package/bundled-skills/linux-hardening/SKILL.md +154 -0
- package/bundled-skills/llm-app-security/SKILL.md +389 -0
- package/bundled-skills/llm-app-security/references/details.md +674 -0
- package/bundled-skills/llm-caching/SKILL.md +334 -0
- package/bundled-skills/llm-cost-optimization/SKILL.md +311 -0
- package/bundled-skills/llm-fine-tuning/SKILL.md +329 -0
- package/bundled-skills/llm-gateway/SKILL.md +282 -0
- package/bundled-skills/llm-inference-scaling/SKILL.md +286 -0
- package/bundled-skills/llmops-platform-engineering/SKILL.md +472 -0
- package/bundled-skills/load-balancing/SKILL.md +403 -0
- package/bundled-skills/loki-logging/SKILL.md +479 -0
- package/bundled-skills/m365-entra-attack/SKILL.md +423 -0
- package/bundled-skills/mac-mini-llm-lab/SKILL.md +350 -0
- package/bundled-skills/mcp-server-security/SKILL.md +356 -0
- package/bundled-skills/mcp-server-security/references/details.md +745 -0
- package/bundled-skills/mdm-device-management/SKILL.md +404 -0
- package/bundled-skills/mdm-device-management/references/details.md +410 -0
- package/bundled-skills/meme-coin-audit/SKILL.md +402 -0
- package/bundled-skills/mid-engagement-ir-detection/SKILL.md +377 -0
- package/bundled-skills/model-registry-governance/SKILL.md +452 -0
- package/bundled-skills/model-serving-kubernetes/SKILL.md +339 -0
- package/bundled-skills/model-supply-chain-security/SKILL.md +427 -0
- package/bundled-skills/mongodb/SKILL.md +436 -0
- package/bundled-skills/multi-tenant-llm-hosting/SKILL.md +435 -0
- package/bundled-skills/multi-tenant-llm-hosting/references/details.md +211 -0
- package/bundled-skills/mysql/SKILL.md +390 -0
- package/bundled-skills/new-relic/SKILL.md +472 -0
- package/bundled-skills/nfs-storage/SKILL.md +356 -0
- package/bundled-skills/object-storage/SKILL.md +378 -0
- package/bundled-skills/offensive-osint/SKILL.md +443 -0
- package/bundled-skills/okta-attack/SKILL.md +436 -0
- package/bundled-skills/ollama-stack/SKILL.md +379 -0
- package/bundled-skills/openclaw-deployment-hardening/SKILL.md +135 -0
- package/bundled-skills/openclaw-local-mac-mini/SKILL.md +426 -0
- package/bundled-skills/openclaw-local-mac-mini/references/details.md +221 -0
- package/bundled-skills/openclaw-security-hardening/SKILL.md +135 -0
- package/bundled-skills/openshift/SKILL.md +485 -0
- package/bundled-skills/opentelemetry/SKILL.md +438 -0
- package/bundled-skills/opentelemetry/references/details.md +78 -0
- package/bundled-skills/opentofu-migration/SKILL.md +349 -0
- package/bundled-skills/osint-methodology/SKILL.md +460 -0
- package/bundled-skills/osint-methodology/references/details.md +1350 -0
- package/bundled-skills/pci-dss-compliance/SKILL.md +446 -0
- package/bundled-skills/penetration-testing/SKILL.md +152 -0
- package/bundled-skills/performance-tuning/SKILL.md +381 -0
- package/bundled-skills/planetscale/SKILL.md +297 -0
- package/bundled-skills/platform-engineering/SKILL.md +348 -0
- package/bundled-skills/platform-engineering/references/details.md +944 -0
- package/bundled-skills/podman/SKILL.md +405 -0
- package/bundled-skills/policy-as-code/SKILL.md +434 -0
- package/bundled-skills/policy-as-code/references/details.md +204 -0
- package/bundled-skills/postgresql-devsec/SKILL.md +378 -0
- package/bundled-skills/prometheus-grafana/SKILL.md +469 -0
- package/bundled-skills/prompt-injection-defense/SKILL.md +483 -0
- package/bundled-skills/rag-infrastructure/SKILL.md +269 -0
- package/bundled-skills/rag-observability-evals/SKILL.md +444 -0
- package/bundled-skills/rag-observability-evals/references/details.md +92 -0
- package/bundled-skills/recon-scope-triage/SKILL.md +128 -0
- package/bundled-skills/redis/SKILL.md +421 -0
- package/bundled-skills/redteam-report-template/SKILL.md +370 -0
- package/bundled-skills/report-writing/SKILL.md +426 -0
- package/bundled-skills/report-writing/references/details.md +187 -0
- package/bundled-skills/reverse-proxy/SKILL.md +420 -0
- package/bundled-skills/runbook-creation/SKILL.md +438 -0
- package/bundled-skills/runbook-creation/references/details.md +71 -0
- package/bundled-skills/saas-security-posture/SKILL.md +415 -0
- package/bundled-skills/sast-scanning/SKILL.md +444 -0
- package/bundled-skills/sbom-supply-chain/SKILL.md +433 -0
- package/bundled-skills/security-arsenal/SKILL.md +446 -0
- package/bundled-skills/security-arsenal/references/details.md +540 -0
- package/bundled-skills/security-automation/SKILL.md +146 -0
- package/bundled-skills/semantic-versioning/SKILL.md +434 -0
- package/bundled-skills/semantic-versioning/references/details.md +83 -0
- package/bundled-skills/service-mesh/SKILL.md +422 -0
- package/bundled-skills/soc2-compliance/SKILL.md +409 -0
- package/bundled-skills/sops-encryption/SKILL.md +124 -0
- package/bundled-skills/sre-dashboards/SKILL.md +143 -0
- package/bundled-skills/ssh-configuration/SKILL.md +324 -0
- package/bundled-skills/ssl-tls-management/SKILL.md +428 -0
- package/bundled-skills/ssl-tls-management/references/details.md +99 -0
- package/bundled-skills/startup-it-troubleshooting/SKILL.md +415 -0
- package/bundled-skills/supply-chain-attack-recon/SKILL.md +453 -0
- package/bundled-skills/supply-chain-attack-recon/references/details.md +258 -0
- package/bundled-skills/systemd-services/SKILL.md +379 -0
- package/bundled-skills/terraform-aws/SKILL.md +125 -0
- package/bundled-skills/terraform-azure/SKILL.md +415 -0
- package/bundled-skills/terraform-azure/references/details.md +231 -0
- package/bundled-skills/terraform-gcp/SKILL.md +369 -0
- package/bundled-skills/threat-modeling/SKILL.md +487 -0
- package/bundled-skills/user-management/SKILL.md +383 -0
- package/bundled-skills/using-agent-skills/SKILL.md +220 -0
- package/bundled-skills/vector-database-ops/SKILL.md +300 -0
- package/bundled-skills/vendor-management/SKILL.md +439 -0
- package/bundled-skills/vendor-management/references/details.md +109 -0
- package/bundled-skills/vercel-deployments/SKILL.md +296 -0
- package/bundled-skills/vllm-server/SKILL.md +236 -0
- package/bundled-skills/vmware-vcenter-attack/SKILL.md +412 -0
- package/bundled-skills/vpn-setup/SKILL.md +452 -0
- package/bundled-skills/vulnerability-scanning/SKILL.md +448 -0
- package/bundled-skills/waf-setup/SKILL.md +354 -0
- package/bundled-skills/waf-setup/references/details.md +211 -0
- package/bundled-skills/web2-recon/SKILL.md +440 -0
- package/bundled-skills/web2-recon/references/details.md +319 -0
- package/bundled-skills/web3-audit/SKILL.md +445 -0
- package/bundled-skills/web3-audit/references/details.md +224 -0
- package/bundled-skills/windows-hardening/SKILL.md +454 -0
- package/bundled-skills/windows-hardening/references/details.md +204 -0
- package/bundled-skills/windows-server/SKILL.md +318 -0
- package/bundled-skills/zero-trust/SKILL.md +461 -0
- package/package.json +1 -1
- package/skills_index.json +6943 -323
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aws-iam
|
|
3
|
+
description: Manage IAM users, roles, and policies. Implement least-privilege access
|
|
4
|
+
and security best practices. Use when configuring AWS identity and access management.
|
|
5
|
+
category: devops
|
|
6
|
+
risk: critical
|
|
7
|
+
source: https://github.com/BagelHole/DevOps-Security-Agent-Skills
|
|
8
|
+
source_repo: BagelHole/DevOps-Security-Agent-Skills
|
|
9
|
+
source_type: community
|
|
10
|
+
date_added: '2026-09-20'
|
|
11
|
+
license: MIT
|
|
12
|
+
license_source: https://github.com/BagelHole/DevOps-Security-Agent-Skills/blob/main/LICENSE
|
|
13
|
+
compatibility: Requires the relevant OS/platform tooling and privileged access where
|
|
14
|
+
noted. Docs-only; helper scripts and templates not bundled.
|
|
15
|
+
metadata:
|
|
16
|
+
author: devops-skills
|
|
17
|
+
version: '1.0'
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# AWS IAM
|
|
21
|
+
|
|
22
|
+
Manage identity and access in AWS with least-privilege policies, roles, federation, and permission boundaries.
|
|
23
|
+
|
|
24
|
+
## When to Use This Skill
|
|
25
|
+
|
|
26
|
+
- Creating roles for EC2 instances, Lambda functions, or ECS tasks
|
|
27
|
+
- Writing custom IAM policies with least-privilege access
|
|
28
|
+
- Setting up OIDC federation for GitHub Actions or other CI/CD systems
|
|
29
|
+
- Implementing permission boundaries for delegated administration
|
|
30
|
+
- Auditing access with IAM Access Analyzer and credential reports
|
|
31
|
+
- Configuring cross-account access with assume-role patterns
|
|
32
|
+
- Enforcing MFA and session policies
|
|
33
|
+
|
|
34
|
+
## Prerequisites
|
|
35
|
+
|
|
36
|
+
- AWS CLI v2 installed and configured
|
|
37
|
+
- IAM permissions: `iam:*` (or scoped to specific actions for least privilege)
|
|
38
|
+
- For OIDC: ability to create identity providers (`iam:CreateOpenIDConnectProvider`)
|
|
39
|
+
- AWS Organizations access for Service Control Policies (SCPs)
|
|
40
|
+
|
|
41
|
+
## IAM Policy Structure
|
|
42
|
+
|
|
43
|
+
Every IAM policy follows the same JSON structure. Always specify the minimum actions and resources required.
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"Version": "2012-10-17",
|
|
48
|
+
"Statement": [
|
|
49
|
+
{
|
|
50
|
+
"Sid": "AllowS3ReadWrite",
|
|
51
|
+
"Effect": "Allow",
|
|
52
|
+
"Action": [
|
|
53
|
+
"s3:GetObject",
|
|
54
|
+
"s3:PutObject",
|
|
55
|
+
"s3:ListBucket"
|
|
56
|
+
],
|
|
57
|
+
"Resource": [
|
|
58
|
+
"arn:aws:s3:::my-app-bucket",
|
|
59
|
+
"arn:aws:s3:::my-app-bucket/*"
|
|
60
|
+
],
|
|
61
|
+
"Condition": {
|
|
62
|
+
"StringEquals": {
|
|
63
|
+
"s3:x-amz-server-side-encryption": "aws:kms"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"Sid": "DenyUnencryptedUploads",
|
|
69
|
+
"Effect": "Deny",
|
|
70
|
+
"Action": "s3:PutObject",
|
|
71
|
+
"Resource": "arn:aws:s3:::my-app-bucket/*",
|
|
72
|
+
"Condition": {
|
|
73
|
+
"StringNotEquals": {
|
|
74
|
+
"s3:x-amz-server-side-encryption": "aws:kms"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Create and Manage Roles
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Create an EC2 instance role with trust policy
|
|
86
|
+
aws iam create-role \
|
|
87
|
+
--role-name EC2AppRole \
|
|
88
|
+
--assume-role-policy-document '{
|
|
89
|
+
"Version": "2012-10-17",
|
|
90
|
+
"Statement": [{
|
|
91
|
+
"Effect": "Allow",
|
|
92
|
+
"Principal": {"Service": "ec2.amazonaws.com"},
|
|
93
|
+
"Action": "sts:AssumeRole"
|
|
94
|
+
}]
|
|
95
|
+
}' \
|
|
96
|
+
--tags '[{"Key":"Team","Value":"platform"},{"Key":"Environment","Value":"production"}]'
|
|
97
|
+
|
|
98
|
+
# Create and attach an inline policy
|
|
99
|
+
aws iam put-role-policy \
|
|
100
|
+
--role-name EC2AppRole \
|
|
101
|
+
--policy-name s3-access \
|
|
102
|
+
--policy-document '{
|
|
103
|
+
"Version": "2012-10-17",
|
|
104
|
+
"Statement": [{
|
|
105
|
+
"Effect": "Allow",
|
|
106
|
+
"Action": ["s3:GetObject", "s3:PutObject"],
|
|
107
|
+
"Resource": "arn:aws:s3:::my-app-bucket/*"
|
|
108
|
+
}]
|
|
109
|
+
}'
|
|
110
|
+
|
|
111
|
+
# Attach a managed policy
|
|
112
|
+
aws iam attach-role-policy \
|
|
113
|
+
--role-name EC2AppRole \
|
|
114
|
+
--policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy
|
|
115
|
+
|
|
116
|
+
# Create instance profile and associate the role
|
|
117
|
+
aws iam create-instance-profile --instance-profile-name EC2AppProfile
|
|
118
|
+
aws iam add-role-to-instance-profile \
|
|
119
|
+
--instance-profile-name EC2AppProfile \
|
|
120
|
+
--role-name EC2AppRole
|
|
121
|
+
|
|
122
|
+
# Create a Lambda execution role
|
|
123
|
+
aws iam create-role \
|
|
124
|
+
--role-name LambdaExecRole \
|
|
125
|
+
--assume-role-policy-document '{
|
|
126
|
+
"Version": "2012-10-17",
|
|
127
|
+
"Statement": [{
|
|
128
|
+
"Effect": "Allow",
|
|
129
|
+
"Principal": {"Service": "lambda.amazonaws.com"},
|
|
130
|
+
"Action": "sts:AssumeRole"
|
|
131
|
+
}]
|
|
132
|
+
}'
|
|
133
|
+
|
|
134
|
+
aws iam attach-role-policy \
|
|
135
|
+
--role-name LambdaExecRole \
|
|
136
|
+
--policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Cross-Account Access
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# In Account B: create role that Account A can assume
|
|
143
|
+
aws iam create-role \
|
|
144
|
+
--role-name CrossAccountReadRole \
|
|
145
|
+
--assume-role-policy-document '{
|
|
146
|
+
"Version": "2012-10-17",
|
|
147
|
+
"Statement": [{
|
|
148
|
+
"Effect": "Allow",
|
|
149
|
+
"Principal": {"AWS": "arn:aws:iam::111111111111:root"},
|
|
150
|
+
"Action": "sts:AssumeRole",
|
|
151
|
+
"Condition": {
|
|
152
|
+
"StringEquals": {"sts:ExternalId": "unique-external-id-12345"}
|
|
153
|
+
}
|
|
154
|
+
}]
|
|
155
|
+
}'
|
|
156
|
+
|
|
157
|
+
# In Account A: assume the role
|
|
158
|
+
aws sts assume-role \
|
|
159
|
+
--role-arn arn:aws:iam::222222222222:role/CrossAccountReadRole \
|
|
160
|
+
--role-session-name cross-account-session \
|
|
161
|
+
--external-id unique-external-id-12345
|
|
162
|
+
|
|
163
|
+
# Use the temporary credentials
|
|
164
|
+
export AWS_ACCESS_KEY_ID="ASIAXXX"
|
|
165
|
+
export AWS_SECRET_ACCESS_KEY="xxx"
|
|
166
|
+
export AWS_SESSION_TOKEN="xxx"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## OIDC Federation for GitHub Actions
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# Create the GitHub OIDC identity provider
|
|
173
|
+
aws iam create-open-id-connect-provider \
|
|
174
|
+
--url https://token.actions.githubusercontent.com \
|
|
175
|
+
--client-id-list sts.amazonaws.com \
|
|
176
|
+
--thumbprint-list "6938fd4d98bab03faadb97b34396831e3780aea1"
|
|
177
|
+
|
|
178
|
+
# Create a role for GitHub Actions with repo-scoped trust
|
|
179
|
+
aws iam create-role \
|
|
180
|
+
--role-name GitHubActionsDeployRole \
|
|
181
|
+
--assume-role-policy-document '{
|
|
182
|
+
"Version": "2012-10-17",
|
|
183
|
+
"Statement": [{
|
|
184
|
+
"Effect": "Allow",
|
|
185
|
+
"Principal": {
|
|
186
|
+
"Federated": "arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com"
|
|
187
|
+
},
|
|
188
|
+
"Action": "sts:AssumeRoleWithWebIdentity",
|
|
189
|
+
"Condition": {
|
|
190
|
+
"StringEquals": {
|
|
191
|
+
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
|
|
192
|
+
},
|
|
193
|
+
"StringLike": {
|
|
194
|
+
"token.actions.githubusercontent.com:sub": "repo:my-org/my-repo:ref:refs/heads/main"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}]
|
|
198
|
+
}'
|
|
199
|
+
|
|
200
|
+
# Attach deployment permissions to the role
|
|
201
|
+
aws iam attach-role-policy \
|
|
202
|
+
--role-name GitHubActionsDeployRole \
|
|
203
|
+
--policy-arn arn:aws:iam::123456789012:policy/DeploymentPolicy
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
GitHub Actions workflow usage:
|
|
207
|
+
|
|
208
|
+
```yaml
|
|
209
|
+
# .github/workflows/deploy.yml
|
|
210
|
+
permissions:
|
|
211
|
+
id-token: write
|
|
212
|
+
contents: read
|
|
213
|
+
|
|
214
|
+
jobs:
|
|
215
|
+
deploy:
|
|
216
|
+
runs-on: ubuntu-latest
|
|
217
|
+
steps:
|
|
218
|
+
- uses: aws-actions/configure-aws-credentials@v4
|
|
219
|
+
with:
|
|
220
|
+
role-to-assume: arn:aws:iam::123456789012:role/GitHubActionsDeployRole
|
|
221
|
+
aws-region: us-east-1
|
|
222
|
+
- run: aws sts get-caller-identity
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Permission Boundaries
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Create a permission boundary policy
|
|
229
|
+
aws iam create-policy \
|
|
230
|
+
--policy-name DeveloperBoundary \
|
|
231
|
+
--policy-document '{
|
|
232
|
+
"Version": "2012-10-17",
|
|
233
|
+
"Statement": [
|
|
234
|
+
{
|
|
235
|
+
"Sid": "AllowedServices",
|
|
236
|
+
"Effect": "Allow",
|
|
237
|
+
"Action": [
|
|
238
|
+
"s3:*",
|
|
239
|
+
"lambda:*",
|
|
240
|
+
"dynamodb:*",
|
|
241
|
+
"sqs:*",
|
|
242
|
+
"sns:*",
|
|
243
|
+
"logs:*",
|
|
244
|
+
"cloudwatch:*",
|
|
245
|
+
"ecr:*",
|
|
246
|
+
"ecs:*"
|
|
247
|
+
],
|
|
248
|
+
"Resource": "*"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"Sid": "DenyIAMChanges",
|
|
252
|
+
"Effect": "Deny",
|
|
253
|
+
"Action": [
|
|
254
|
+
"iam:CreateUser",
|
|
255
|
+
"iam:DeleteUser",
|
|
256
|
+
"iam:CreateRole",
|
|
257
|
+
"iam:DeleteRole",
|
|
258
|
+
"iam:AttachRolePolicy",
|
|
259
|
+
"iam:PutRolePermissionsBoundary",
|
|
260
|
+
"iam:DeleteRolePermissionsBoundary"
|
|
261
|
+
],
|
|
262
|
+
"Resource": "*"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"Sid": "DenyOutsideRegion",
|
|
266
|
+
"Effect": "Deny",
|
|
267
|
+
"Action": "*",
|
|
268
|
+
"Resource": "*",
|
|
269
|
+
"Condition": {
|
|
270
|
+
"StringNotEquals": {
|
|
271
|
+
"aws:RequestedRegion": ["us-east-1", "us-west-2"]
|
|
272
|
+
},
|
|
273
|
+
"ForAnyValue:StringNotLike": {
|
|
274
|
+
"aws:PrincipalArn": "arn:aws:iam::*:role/admin-*"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
}'
|
|
280
|
+
|
|
281
|
+
# Create a role with the permission boundary
|
|
282
|
+
aws iam create-role \
|
|
283
|
+
--role-name DeveloperRole \
|
|
284
|
+
--assume-role-policy-document file://trust-policy.json \
|
|
285
|
+
--permissions-boundary "arn:aws:iam::123456789012:policy/DeveloperBoundary"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## IAM Access Analyzer and Auditing
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Create an IAM Access Analyzer
|
|
292
|
+
aws accessanalyzer create-analyzer \
|
|
293
|
+
--analyzer-name account-analyzer \
|
|
294
|
+
--type ACCOUNT
|
|
295
|
+
|
|
296
|
+
# List findings (externally accessible resources)
|
|
297
|
+
aws accessanalyzer list-findings \
|
|
298
|
+
--analyzer-arn arn:aws:access-analyzer:us-east-1:123456789012:analyzer/account-analyzer
|
|
299
|
+
|
|
300
|
+
# Generate credential report
|
|
301
|
+
aws iam generate-credential-report
|
|
302
|
+
aws iam get-credential-report --output text --query Content | base64 -d > credential-report.csv
|
|
303
|
+
|
|
304
|
+
# Find users with console access but no MFA
|
|
305
|
+
aws iam list-users --query "Users[].UserName" --output text | while read user; do
|
|
306
|
+
mfa=$(aws iam list-mfa-devices --user-name "$user" --query "MFADevices" --output text)
|
|
307
|
+
if [ -z "$mfa" ]; then
|
|
308
|
+
echo "NO MFA: $user"
|
|
309
|
+
fi
|
|
310
|
+
done
|
|
311
|
+
|
|
312
|
+
# List all policies attached to a role
|
|
313
|
+
aws iam list-attached-role-policies --role-name EC2AppRole
|
|
314
|
+
aws iam list-role-policies --role-name EC2AppRole
|
|
315
|
+
|
|
316
|
+
# Get the last-accessed services for a role
|
|
317
|
+
aws iam generate-service-last-accessed-details --arn arn:aws:iam::123456789012:role/EC2AppRole
|
|
318
|
+
# Then retrieve results with the returned JobId
|
|
319
|
+
aws iam get-service-last-accessed-details --job-id "job-id-from-above"
|
|
320
|
+
|
|
321
|
+
# Simulate a policy to test access
|
|
322
|
+
aws iam simulate-principal-policy \
|
|
323
|
+
--policy-source-arn arn:aws:iam::123456789012:role/EC2AppRole \
|
|
324
|
+
--action-names s3:GetObject s3:PutObject \
|
|
325
|
+
--resource-arns arn:aws:s3:::my-app-bucket/data.json
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Terraform IAM Role with OIDC
|
|
329
|
+
|
|
330
|
+
```hcl
|
|
331
|
+
# OIDC provider for GitHub Actions
|
|
332
|
+
resource "aws_iam_openid_connect_provider" "github" {
|
|
333
|
+
url = "https://token.actions.githubusercontent.com"
|
|
334
|
+
client_id_list = ["sts.amazonaws.com"]
|
|
335
|
+
thumbprint_list = ["6938fd4d98bab03faadb97b34396831e3780aea1"]
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
# Role for GitHub Actions
|
|
339
|
+
resource "aws_iam_role" "github_actions" {
|
|
340
|
+
name = "GitHubActionsDeployRole"
|
|
341
|
+
|
|
342
|
+
assume_role_policy = jsonencode({
|
|
343
|
+
Version = "2012-10-17"
|
|
344
|
+
Statement = [{
|
|
345
|
+
Effect = "Allow"
|
|
346
|
+
Principal = {
|
|
347
|
+
Federated = aws_iam_openid_connect_provider.github.arn
|
|
348
|
+
}
|
|
349
|
+
Action = "sts:AssumeRoleWithWebIdentity"
|
|
350
|
+
Condition = {
|
|
351
|
+
StringEquals = {
|
|
352
|
+
"token.actions.githubusercontent.com:aud" = "sts.amazonaws.com"
|
|
353
|
+
}
|
|
354
|
+
StringLike = {
|
|
355
|
+
"token.actions.githubusercontent.com:sub" = "repo:my-org/my-repo:*"
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}]
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
permissions_boundary = aws_iam_policy.boundary.arn
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
resource "aws_iam_role_policy_attachment" "deploy" {
|
|
365
|
+
role = aws_iam_role.github_actions.name
|
|
366
|
+
policy_arn = aws_iam_policy.deployment.arn
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
# Permission boundary
|
|
370
|
+
resource "aws_iam_policy" "boundary" {
|
|
371
|
+
name = "DeveloperBoundary"
|
|
372
|
+
policy = jsonencode({
|
|
373
|
+
Version = "2012-10-17"
|
|
374
|
+
Statement = [
|
|
375
|
+
{
|
|
376
|
+
Sid = "AllowedServices"
|
|
377
|
+
Effect = "Allow"
|
|
378
|
+
Action = ["s3:*", "lambda:*", "dynamodb:*", "ecs:*", "logs:*"]
|
|
379
|
+
Resource = "*"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
Sid = "DenyIAMEscalation"
|
|
383
|
+
Effect = "Deny"
|
|
384
|
+
Action = ["iam:CreateUser", "iam:CreateRole", "iam:AttachRolePolicy"]
|
|
385
|
+
Resource = "*"
|
|
386
|
+
}
|
|
387
|
+
]
|
|
388
|
+
})
|
|
389
|
+
}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## Service Control Policies (Organizations)
|
|
393
|
+
|
|
394
|
+
```json
|
|
395
|
+
{
|
|
396
|
+
"Version": "2012-10-17",
|
|
397
|
+
"Statement": [
|
|
398
|
+
{
|
|
399
|
+
"Sid": "DenyRootAccount",
|
|
400
|
+
"Effect": "Deny",
|
|
401
|
+
"Action": "*",
|
|
402
|
+
"Resource": "*",
|
|
403
|
+
"Condition": {
|
|
404
|
+
"StringLike": {
|
|
405
|
+
"aws:PrincipalArn": "arn:aws:iam::*:root"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"Sid": "RequireIMDSv2",
|
|
411
|
+
"Effect": "Deny",
|
|
412
|
+
"Action": "ec2:RunInstances",
|
|
413
|
+
"Resource": "arn:aws:ec2:*:*:instance/*",
|
|
414
|
+
"Condition": {
|
|
415
|
+
"StringNotEquals": {
|
|
416
|
+
"ec2:MetadataHttpTokens": "required"
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"Sid": "DenyRegionsOutsideUS",
|
|
422
|
+
"Effect": "Deny",
|
|
423
|
+
"Action": "*",
|
|
424
|
+
"Resource": "*",
|
|
425
|
+
"Condition": {
|
|
426
|
+
"StringNotEquals": {
|
|
427
|
+
"aws:RequestedRegion": ["us-east-1", "us-west-2"]
|
|
428
|
+
},
|
|
429
|
+
"ForAnyValue:StringNotLike": {
|
|
430
|
+
"aws:PrincipalArn": ["arn:aws:iam::*:role/OrganizationAdmin"]
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
## Troubleshooting
|
|
439
|
+
|
|
440
|
+
| Problem | Cause | Fix |
|
|
441
|
+
|---|---|---|
|
|
442
|
+
| Access Denied on API call | Missing or incorrect policy | Use `simulate-principal-policy` to test; check resource ARN format |
|
|
443
|
+
| Role cannot be assumed | Trust policy does not include the caller | Verify Principal in trust policy matches caller ARN |
|
|
444
|
+
| OIDC federation fails | Thumbprint or audience mismatch | Verify OIDC provider URL, client ID list, and condition keys |
|
|
445
|
+
| Permission boundary blocks action | Boundary does not include the action | Add the action to the boundary; effective = identity AND boundary |
|
|
446
|
+
| Credential report shows stale keys | Keys not rotated in 90+ days | Rotate keys; disable unused access keys |
|
|
447
|
+
| Service-linked role creation fails | Organization SCP blocks iam:CreateServiceLinkedRole | Add exception in SCP for the specific service |
|
|
448
|
+
| Cross-account assume role fails | Missing ExternalId or wrong account | Verify ExternalId matches; check account number in Principal |
|
|
449
|
+
| MFA condition not enforced | Condition key not in policy | Add `aws:MultiFactorAuthPresent` condition |
|
|
450
|
+
|
|
451
|
+
## Related Skills
|
|
452
|
+
|
|
453
|
+
- terraform-aws (`terraform-aws`) - IaC deployment of IAM resources
|
|
454
|
+
- aws-ec2 (`aws-ec2`) - Instance profiles and roles
|
|
455
|
+
- aws-lambda (`aws-lambda`) - Lambda execution roles
|
|
456
|
+
- aws-ecs-fargate (`aws-ecs-fargate`) - ECS task and execution roles
|
|
457
|
+
- access-review (`access-review`) - Access auditing and governance
|
|
458
|
+
|
|
459
|
+
## Limitations
|
|
460
|
+
|
|
461
|
+
- Infrastructure commands can disrupt services: confirm target host/scope and have backups/snapshots before mutating state.
|
|
462
|
+
- Docs-only import: upstream scripts and templates not bundled.
|
|
463
|
+
|