kerberosmansour/hulumi / skills/hulumi-threat-model
hulumi-threat-model
FlaggedRun an AWS or GitHub cloud / platform threat model for a specific Hulumi scenario. Produces a structured markdown threat-model document at docs/threat-model-<scenario>-<date>.md in the user's working directory, citing CSA CCM v4.1, NIST SP 800-53 Rev 5, NIST SP 800-218A, MITRE ATLAS v5.1, CIS AWS Foundations v5.0.0, CIS GitHub Benchmark v1.2.0, NIST SSDF v1.1, OpenSSF Scorecard, MITRE ATT&CK T1195, and GitHub Well-Architected SSDF by framework ID only (no verbatim control text). Use when the user asks for a threat model for an AWS or GitHub scenario, wants to ground IaC design decisions in standard controls, or wants to see which @hulumi/baseline components apply.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.0 KB |
| package.json | manifest | 572 B |
| scenarios/aws-multi-account-baseline.json | config | 5.5 KB |
| scenarios/eks-cluster-baseline.json | config | 5.0 KB |
| scenarios/eks-runtime-and-backup.json | config | 4.6 KB |
| scenarios/github-actions-supply-chain.json | config | 5.9 KB |
| scenarios/github-app-token-exposure.json | config | 5.5 KB |
| scenarios/github-oidc-trust-cloud-account.json | config | 5.4 KB |
| scenarios/github-self-hosted-runner.json | config | 5.3 KB |
| scenarios/iam-least-privilege.json | config | 4.7 KB |
| scenarios/lambda-secrets-access.json | config | 5.0 KB |
| scenarios/operations-audit-pipeline-broken.json | config | 4.3 KB |
| scenarios/operations-detective-services-disabled.json | config | 4.1 KB |
| scenarios/operations-patch-compliance-lapse.json | config | 4.0 KB |
| scenarios/rds-encryption-at-rest.json | config | 4.7 KB |
| scenarios/s3-public-bucket-hardening.json | config | 4.9 KB |
| scripts/generate-threat-model.mjs | script | 22.7 KB |
| scripts/list-scenarios.mjs | script | 2.0 KB |
| templates/threat-model.template.md | markdown | 1.1 KB |
| tsconfig.json | config | 289 B |
scenarios/lambda-secrets-access.json
View on GitHub{
"id": "lambda-secrets-access",
"title": "Lambda Function Secrets Access — execution role scoping, Secrets Manager, KMS",
"description": "An engineer is writing a Lambda function that needs read access to a database password in Secrets Manager, encrypted by the `AccountFoundation.kmsRing.secrets` CMK. Target end state: the Lambda execution role has the narrowest possible grant (`secretsmanager:GetSecretValue` on exactly one ARN), KMS key policy grants `kms:Decrypt` to that role only, environment variables do not leak sensitive config, VPC execution is used when the Lambda needs to reach private resources, and dead-letter queues + X-Ray tracing are on for observability.",
"requiredFrameworks": ["CCM", "NIST-800-53-r5", "ATLAS", "CIS-AWS-v5.0.0"],
"actors": [
"Platform Engineer (trusted)",
"Lambda execution role (trusted within its narrow scope)",
"External Attacker (via RCE in the Lambda code or via Lambda URL)",
"Compromised upstream dependency (via supply-chain)"
],
"assets": [
"The database password stored in Secrets Manager",
"The KMS CMK that encrypts the secret",
"Lambda function code and layer contents",
"Lambda execution logs in CloudWatch"
],
"stride": [
{
"type": "E",
"name": "Over-scoped execution role",
"description": "An LLM-authored Lambda policy grants `secretsmanager:GetSecretValue` with `Resource: '*'` or `kms:Decrypt` on all keys. Any post-deployment compromise of the Lambda exposes every secret in the account. Mitigation: exact-ARN policy; HardeningPack rejects wildcard `Resource` outside narrow read namespaces.",
"controls": [
"CCM:IAM-07",
"CIS-AWS-v5.0.0:1.22",
"NIST-800-53-r5:AC-3",
"NIST-800-53-r5:AC-6"
]
},
{
"type": "I",
"name": "Secret leakage via environment variable",
"description": "Developers pass the raw secret into the Lambda's `environment.variables` instead of fetching it at invocation. The secret ends up in CloudFormation state, CloudTrail `UpdateFunctionConfiguration`, and Lambda console display. Mitigation: runtime fetch via SDK; CrossGuard rule rejecting env vars matching password/secret/key patterns.",
"controls": ["CCM:DSP-01", "NIST-800-53-r5:SC-28", "NIST-800-53-r5:IA-5"]
},
{
"type": "T",
"name": "Supply-chain dependency tampering",
"description": "A Node / Python dependency in the Lambda's `node_modules` / `site-packages` becomes malicious (Shai-Hulud-style npm account takeover). Mitigation: exact-version pinning + integrity hashes in `package-lock.json` / `poetry.lock`; SLSA provenance verification in the Lambda packaging pipeline.",
"controls": ["CCM:STA-07", "CCM:TVM-02", "NIST-800-53-r5:SI-7", "NIST-800-218:PS.2.1"]
},
{
"type": "T",
"name": "Prompt-injection-driven secret exfiltration",
"description": "If the Lambda handles user prompts for an LLM-backed workflow, a malicious user can craft a prompt that coerces the LLM to produce code that fetches and emits the Secret Manager secret — a direct exfil channel. Mitigation: strict output parsing, no `eval` of LLM output, deny-list on sensitive secret names.",
"controls": ["ATLAS:AML.T0051", "ATLAS:AML.T0080", "ATLAS:AML.T0099", "ATLAS:AML.T0102"]
},
{
"type": "R",
"name": "Repudiation via non-existent Lambda invocation logs",
"description": "Lambda is invoked from Lambda URL or API Gateway; without CloudWatch Logs + X-Ray, invocation-level attribution is impossible. Mitigation: CloudWatch Logs on, retention ≥ 90d, X-Ray tracing on.",
"controls": ["CCM:LOG-01", "NIST-800-53-r5:AU-2", "NIST-800-53-r5:AU-12"]
},
{
"type": "D",
"name": "Lambda cost-DoS via unthrottled concurrency",
"description": "An attacker with the Lambda URL triggers millions of invocations, exhausting Lambda concurrency and driving cost. Mitigation: reserved concurrency cap, API Gateway rate-limits, AWS WAF in front.",
"controls": ["CCM:LOG-04", "NIST-800-53-r5:SI-4"]
}
],
"recommendedComponents": [
{
"name": "hulumi.baseline.aws.SecureLambda",
"availability": "Planned for v1.1+ (post-v1.0.0; not yet shipped)",
"rationale": "Planned ComponentResource wrapping AWS Lambda with least-privilege execution role, VPC default, DLQ wiring, X-Ray tracing, reserved concurrency, and env-var secret-name denylist."
},
{
"name": "hulumi.baseline.aws.AccountFoundation.secretsManager + kmsRing.secrets",
"availability": "Shipped in M3 (v0.3)",
"rationale": "Hulumi's AccountFoundation scaffolds a Secrets Manager namespace + a `secrets` CMK with rotation. The Lambda's execution role policy references the specific secret ARN and the specific key ARN, not wildcards."
},
{
"name": "hulumi.policies.aws.HulumiHardeningPack",
"availability": "Shipped in M2 (v0.2)",
"rationale": "Blocks wildcard IAM and env-var secret exposure; rejects raw `aws.lambda.Function` without a supplied `role` that the pack can inspect."
}
]
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |