playbook-cloud
Cloud IAM privesc paths and metadata endpoints per provider. Load when the target is cloud or you obtain cloud creds/metadata. Triggers - AWS/GCP/Azure, IAM, S3/blob, 169.254.169.254, access key.
- Star
- 1,278
- 分类
- 运维与云
- 许可证
- MIT
- 最近提交
- 2026年11月30日
skills/playbooks/cloud/SKILL.md
在 GitHub 上查看Cloud — Privesc Paths & Metadata
Metadata endpoints (different per cloud!)
AWS IMDSv1 (no header): curl http://169.254.169.254/latest/meta-data/iam/security-credentials/
AWS IMDSv2 (requires token):
TOKEN=$(curl -X PUT -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" http://169.254.169.254/latest/api/token)
curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/
GCP (requires header): curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
Azure (requires header): curl -H "Metadata: true" "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/"
IMDSv1 vs v2 matters: v1 = any SSRF gives cloud creds. v2 requires PUT first (harder via SSRF).
AWS IAM privesc — dangerous permission combos
iam:CreatePolicyVersion→ attach admin policy to selfiam:AttachUserPolicy→ attach AdministratorAccesslambda:CreateFunction+iam:PassRole→ execute as privileged rolests:AssumeRole→ pivot to cross-account rolesec2:RunInstances+iam:PassRole→ launch instance with admin role Tools:pacu(automated),pmapper(permission graph)
GCP privesc
- Default compute SA often has
editor(overprivileged) iam.serviceAccountKeys.create→ generate key for any SAcloudfunctions.functions.create+iam.serviceAccounts.actAs→ RCE as SA- Check for
allUsers/allAuthenticatedUsersbindings (public access)
Azure privesc
- Managed Identity with broad role assignments
Contributor→ deploy resources, potentially read Key Vault- App Registration with high API permissions + admin consent
- Automation account runbooks → execute as automation identity
What to check everywhere
- Public storage (S3/GCS/Blob) —
--no-sign-request/ anonymous - Secrets in repos / CI variables / build logs
- User-data scripts (bootstrap credentials)
- MFA not enforced on admin accounts
- Audit logging disabled or misconfigured
Post-creds audit tools
- AWS:
pacu(exploitation framework, modular),pmapper(privesc graph) - Multi-cloud posture:
scoutsuite(inventory + misconfig report per provider),prowler(AWS/GCP/Azure compliance checks, CIS benchmarks) - Run posture scan FIRST after getting creds — misconfig findings often beat privesc chains.
2024-2025 cloud-specific additions
AWS
- IMDSv2 enforcement: Check
aws ec2 describe-instances --query 'Reservations[].Instances[].MetadataOptions.HttpTokens'—required= v2 enforced,optional= v1 fallback possible. - IAM Condition keys bypass:
aws:SourceVpce/aws:SourceVpcconditions can be bypassed if VPC endpoint allows.pacu module run iam__enum_permissions. - Lambda URL function URL auth bypass:
FunctionUrlAuthType: NONE→ public invoke.aws lambda list-function-url-configs. - STS AssumeRole chain: Cross-account role trust with
sts:ExternalIdmissing → confusion.pacu module run iam__enum_roles. - EC2 Instance Metadata Service (IMDS) v1 disable check:
aws ec2 describe-instances --filters Name=metadata-options.http-tokens,Values=optional.
GCP
- Default Compute SA overprivilege: Default SA often
Editor(primitive role) →roles/editor=storage.objects.*,compute.*,iam.serviceAccounts.actAs. Checkgcloud projects get-iam-policy. - Workload Identity Federation misconfig: OIDC pool allows untrusted issuers → token impersonation. Check
gcloud iam workload-identity-pools describe. - Cloud Functions / Cloud Run unauthenticated invoke:
gcloud functions describe --region=...→httpsTrigger.ingressSettings/serviceConfig.ingress. Allow unauthenticated = public endpoint. - Secret Manager version access:
secretmanager.versions.accessonlatest+ IAMroles/secretmanager.secretAccessor→ secrets.
Azure
- Managed Identity with Contributor/Owner:
az role assignment list --assignee <mi-principal-id>→ broad assignments. - Key Vault purge protection / soft delete disabled:
az keyvault show --name <kv>→enablePurgeProtection: false→ secrets recoverable after delete. - App Service / Function App SCM (Kudu) exposure:
scm.azurewebsites.netaccessible → file read, env vars, console.az webapp config show --name <app> --resource-group <rg> --query scmType. - Azure Arc / Hybrid Identity: On-prem machines joined to Azure AD with excessive roles.
az connectedmachine list.
Kubernetes (EKS/GKE/AKS)
- Node IAM role overprivilege: EC2 NodeInstanceRole often has
AmazonEKSWorkerNodePolicy+AmazonEC2ContainerRegistryReadOnly+AmazonEKS_CNI_Policy→ can list all secrets in cluster.kubectl auth can-i get secrets --all-namespaces. - Admission webhook bypass: Mutating/Validating webhook timeout/failure open →
kubectl apply --dry-run=servervs live. - Service Account token volume projection:
kube-systemSA tokens in pods →kubectl get sa -A -o jsonpath='{.items[*].secrets}'. - Cilium/Calico/NetworkPolicy misconfig: Default deny missing → lateral movement.
kubectl get networkpolicy -A.
相似的 Skill
canary
GAgarrytan/gstack143k近 7 天新增 524 个 star
observability-and-instrumentation
ADaddyosmani/agent-skills122k近 7 天新增 1,421 个 star
paperclip-board
PApaperclipai/paperclip119k近 7 天新增 1,727 个 star
ruview-configure
RUruvnet/RuView106k近 7 天新增 596 个 star