fix(iac): close latent Terraform audit findings (IaC-1..4) + executable trivy gate - #213
Merged
Merged
Conversation
…C gate IaC-1: MSK accepts TLS-only client traffic with SASL/IAM auth; Flink wired to the SASL/IAM bootstrap with SigV4 client properties and a scoped kafka-cluster data-plane policy; broker SG narrowed from 10.0.0.0/8 to the cluster subnets' CIDRs. IaC-2: deploy role now carries a permissions boundary that excludes role mutation on its own name pattern and denies boundary detach/rewrite; service-role create/policy writes require the boundary attached; the role can no longer mutate itself (out-of-band admin operation). IaC-3: iam:*OpenIDConnectProvider* on * split into List-on-* plus explicit verbs pinned to the one provider this module manages. IaC-4: kafka:*Cluster*/kinesisanalytics:*Application* wildcards replaced with explicit verbs scoped to project ARN patterns; cluster/application/ workspace/SG/KMS deletion gated on the Project resource tag. Also raised by the scanner and fixed: CMKs with rotation for MSK and lake bucket at-rest encryption, SG egress restricted, remaining deliberate wildcards suppressed inline with justification. New security.yml job `iac`: trivy config scan of infrastructure/terraform, MEDIUM+ severity, exit-code 1 (fails on the old MSK plaintext config, verified locally: baseline exit 1, fixed tree exit 0). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DORA Metrics
|
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
This was referenced Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the four latent findings of the 2026-07-18 IaC audit addendum (P4.1–P4.4 of the audit plan). All of this Terraform is currently unapplied (
terraform-apply.ymlplan/apply areif: false), so these are configuration fixes to land before AWS apply is ever re-enabled — no live infrastructure changes.IaC-1 (P2) — MSK plaintext + no client auth
client_broker = "TLS"andclient_authentication { sasl { iam = true } }on the MSK cluster.kafka-cluster:*data-plane policy on the Flink service role (cluster/topic/group ARNs derived from the cluster ARN).10.0.0.0/8to the CIDRs of the cluster's own subnets (data-sourced from the passed subnet ids).IaC-2 (P2) — deploy-role self-escalation
iam:PermissionsBoundarycondition) on any role it creates or re-policies. Flink/Grafana service roles now carry the boundary.agentflow-terraform-*pattern (read-only state refresh kept). Changes to the deploy role/policy and the boundary itself become out-of-band admin operations (noCreatePolicyVersion/SetDefaultPolicyVersion/DeletePolicyon the boundary; explicit denies on boundary detach).IaC-3 (P3) — OIDC provider wildcard verbs
iam:*OpenIDConnectProvider*on*split intoListon*plus explicit verbs pinned to the single provider ARN this module manages.IaC-4 (P3) — service-scope wildcard verbs
kafka:*Cluster*,kafka:*Configuration*,kinesisanalytics:*Application*replaced with explicit verb lists scoped to project ARN patterns; destructive operations (cluster/application/workspace/SG/KMS-key deletion) additionally gated on theProjectresource tag. CloudWatch alarm verbs scoped to theagentflow-*alarm pattern.Raised by the scanner while getting the gate green, also fixed
Describe*/generated-id resources, boundary ceiling) suppressed inline with per-statement justification comments.P4.4 — executable gate
New
iacjob insecurity.yml(runs on PR + push to main, same pinnedtrivy-action):trivy configoverinfrastructure/terraform, severity MEDIUM+,exit-code: 1, SARIF uploaded under its own category.Verified locally:
terraform validateclean; trivy onmain's tree exits 1 (flagsclient_broker = "TLS_PLAINTEXT", CRITICAL), on this branch exits 0.Note:
terraform planagainst real AWS is impossible here (apply lane disabled, no credentials) — placeholder tfvars only. IAM verb lists follow the AWS provider's documented call patterns; if a verb is missing it surfaces at the first real plan/apply, which is already gated behindworkflow_dispatch+ environment review.🤖 Generated with Claude Code