Architecture Note · Security & Compliance
Deterministic Multi-Cloud CSPM & CIEM: Attack-Path Traversal, 90-Day Least Privilege, and Human-Gated Remediation
Why naive AI security wrappers fail on cloud posture—and how deterministic BFS attack-path traversal, 90-day CIEM Terraform diffs, DevSecOps approval gates, and SHA-256 audit logs fix it.
The Operational Problem: Toxic Combinations and Entitlement Sprawl
Multi-cloud teams across AWS, Azure, and GCP routinely triage isolated posture alerts while missing the chained paths attackers actually exploit. In a flat scanner, an internet-facing Application Load Balancer lacking WAF attachment in us-east-1, an ECS task role carrying wildcard iam:PassRole and rds:ModifyDBSnapshotAttribute, and an unencrypted RDS snapshot look like three separate findings. Connected together, they form one toxic chain exposing 2.4M clearing records. Meanwhile, identity sprawl compounds the blast radius: across four production principals in our reference estate, 2,555 granted IAM permissions went unused over 90 days—including a GCP Workload Identity binding roles/editor with over 2,400 permissions when Cloud Audit Logs recorded only 14 exercised actions.
Why Naive AI Wrappers Fail
Piping cloud resource snapshots and IAM policies into generic language-model wrappers breaks down along three predictable operational fault lines:
- Infrastructure egress and credential exposure: Sending multi-cloud topologies, ARN inventories, and secret metadata to external model endpoints leaks sensitive architecture context before remediation even starts.
- Nondeterministic graph traversal and policy hallucination: Probabilistic models cannot reliably expand IAM wildcards such as
s3:*oriam:*, trace transitive trust edges across VPC and identity boundaries, or guarantee valid Terraform HCL. One hallucinated action or dropped condition key can silently break production traffic or leave an ingress route exposed. - Ungated auto-remediation and silent drift: Wrappers that emit unverified CLI patches bypass change-management tickets and risk revoking permissions needed by quarterly batch jobs or break-glass responders.
The Deterministic Architecture That Fixes It
A production CSPM and CIEM control plane confines computation to a local FastAPI and SQLite (WAL mode) boundary, reserving human judgment for infrastructure mutation:
- Deterministic BFS attack-path and benchmark engine (
POST /api/cloud/scan): Uploaded AWS, Azure, and GCP resource and IAM JSON snapshots feed a directed resource-and-entitlement graph. Deterministic breadth-first search (BFS) traces multi-hop toxic combinations from public ingress to crown-jewel storage or vaults, assigning0–100blast-radius scores while evaluating CIS Benchmarks (v3.0/v2.0) and NIST 800-53 controls across global regions such asus-east-1,eu-central-1,ap-northeast-1, andap-southeast-2. - 90-day telemetry CIEM rightsizing (
POST /api/ciem/rightsize): The entitlement engine expands policy wildcards against 90-day CloudTrail, Azure Activity, and GCP Audit Log execution records to compute utilization ratios and synthesize scoped IAM JSON and Terraform HCL diffs (aws_iam_policy,azurerm_role_definition,google_project_iam_custom_role). AnOfflineDeterministicAdapterruns by default with zero external API keys required. - Fail-closed DevSecOps approval gate (
POST /api/findings/{id}/remediate): Remediation patches in Terraform HCL and Cloud CLI (aws,az,gcloud) enterpending_approvalstatus. Callingapply=Truewithout explicit DevSecOps sign-off (approved_byandapproval_confirmed=True) fails closed with HTTP409 Conflict. - Immutable audit chain and 1-hour snapshot wipe: Approved changes append to a SHA-256-chained
remediation_audit_logprotected by SQLiteBEFORE UPDATEandBEFORE DELETEtriggers (GET /api/findings/{id}/audit). Scoped SHA-256 invite tokens (scripts/mint_invite.py) enforce sliding-window rate limits,GET /api/posture/summaryserves blast-radius and compliance metrics verified across 12pytestchecks, andapp/cleanup.py(POST /api/wipe) deletes uploaded raw snapshots older than 3,600 seconds while preserving SHA-256 digests.
Operational Takeaway
Cloud security posture does not improve by trusting fluent summaries over live IAM state. When attack paths are computed by deterministic BFS, least-privilege Terraform diffs derive strictly from 90-day audit telemetry, raw snapshots auto-wipe within one hour, and remediation blocks at HTTP 409 until a DevSecOps Lead signs off against a change ticket, platform teams eliminate toxic chains without surrendering auditability or uptime.