Skip to content
Tech Interview Prep
Technical interview guide

Cloud Security Posture Management (CSPM)

Continuously scanning cloud environments for misconfigurations before they're exploited.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: AWS Security Hub CSPM, Microsoft Defender for Cloud, Google Security Command Center, and NIST SP 800-137 guidance current 2026-09-01.

Interview Q&A

Treat each question like a live interview question: answer out loud first (structure, assumptions, tradeoffs), then open the model answer to spot gaps and rehearse a tighter follow-up.

Curated: · Written: · Reviewed:

25 questions

Q&A-7

Centralize AWS Security Hub CSPM across accounts and Regions.

Answer

What I'd say first

Assume an AWS Organization with all features enabled, Security Hub CSPM already on, and a goal of one place to define which standards and controls are enabled across accounts and Regions.

Designate a member account as the Security Hub delegated administrator: the management account can't hold that role. Pick one home Region. Create configuration policies in the home Region, then associate them to the organization root, to OUs, or to individual accounts. Anything you don't associate stays self-managed. Findings from linked Regions aggregate to the delegated administrator's home Region.

How it actually works

Central configuration splits what should be on from who it applies to. The delegated admin owns both halves.

A configuration policy names the standards to enable (AWS Foundational Security Best Practices, CIS AWS Foundations Benchmark, and so on), the controls to enable or disable, and parameters for the subset of controls that accept them. Policies live in the home Region; linked Regions receive the same policy, so you define it once instead of per Region.

Associations resolve by specificity: an account-level association beats an OU-level one, and the closest OU beats the root. That gives you a root policy as the default, OU policies to narrow it per business unit, and account policies for genuine exceptions.

The trade-off

Central management buys one definition and a single place to see drift. Self-managed is for accounts that must run their own standards: a regulated subsidiary, an acquisition still being migrated. You can mix the two: centrally manage most OUs and leave one self-managed. The cost is that self-managed accounts are invisible to your central policy, so you have to inventory them yourself.

Failure modes and how you catch them

  • A new account or a newly enabled Region lands self-managed because auto-enable wasn't configured. Catch it by listing accounts and Regions with no policy association.
  • Changing the delegated administrator orphans the policies and associations: they belong to the admin. Keep the designation in IaC so the change is a reviewed diff, not a console click.
  • An opt-in Region can't be added as a linked Region until it's enabled in every account, so a partial rollout leaves a gap.
  • A policy is a complete definition, not an overlay: an OU policy that omits a parameter uses the control's default rather than inheriting the root value.

Precedence trace

ScopePolicyStandards / controls
RootP-rootFSBP enabled
OU ProdP-prodFSBP + CIS; S3.1 disabled
Account 111122223333 (in Prod)P-acctFSBP only
Account 444455556666 (in Prod)——

Resolved:

  • 111122223333 → P-acct (account beats OU).
  • 444455556666 → P-prod (closest OU beats root).
  • An account directly under root with no OU policy → P-root.

Region axis: in the home Region and every linked Region, each account gets the policy above. A Region you never added as linked stays self-managed and keeps whatever it had.

Detection table

SignalMeaningWhere to look
Account has no associationSelf-managed, drifting from the standardAssociation list in the delegated admin
Region missing from linked listFindings never reach the home RegionCross-Region aggregation config
Control enabled centrally but off in an accountAccount-level policy overrides the OUAssociation precedence for that account

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-1

Design a CSPM program for a multi-account cloud organization.

Answer

Assumptions I'd state first: AWS-primary org, ~200 accounts under AWS Organizations, workloads in 6 regions, Security Hub + AWS Config as the native control plane, one dedicated security account registered as delegated administrator. On Azure or GCP the shape is identical with management groups + Azure Policy + Defender for Cloud, or org-level Security Command Center.

The answer in one breath: CSPM is three problems, not one. Coverage (do I see every account, region and resource?), normalization (is a finding one stable thing I can act on?), and response (does it get fixed and stay fixed?). Most programs fail at coverage, then drown at normalization.

Coverage. Register the security account as delegated administrator for Security Hub, GuardDuty and Config so findings land centrally without a role in every account. Enable Config recording and Security Hub in every region you actually use: Security Hub is regional, so an aggregator only helps if each region is enabled. Auto-enroll through Organizations: new accounts inherit the OU's SCPs and Config conformance pack. Then detect the gaps auto-enrollment misses.

GapDetection signal
New account not enrolledOrganizations ListAccounts diff vs. inventory; alert if account age > 24h and no Config recorder
Region not enabledSecurity Hub GetEnabledStandards per region vs. regions with EC2/RDS activity in CloudTrail
Recorder stoppedCloudTrail StopConfigurationRecorder / DeleteConfigurationRecorder
Opt-outSCP denies config:StopConfigurationRecorder and securityhub:DisableSecurityHub; alert on the attempt

Normalization. Dedup on a stable key: control ID + resource ARN + account + region. Security Hub's ASFF already carries this; third-party tools (Wiz, Prisma, Prowler) need mapping into it. Without dedup, one public S3 bucket reported by three tools across two regions is six tickets.

Arithmetic: 200 accounts × ~40 controls × ~500 resources ≈ 4M raw evaluations per sweep. Change-triggered Config rules fire on the API event rather than a sweep, and periodic rules run as often as hourly, so the actionable queue is the delta: typically a few hundred. Triage the delta, not the total.

Response. Enrich with owner (from tags), criticality, public exposure, and attack path: a public bucket is only critical if a role that can read it is assumable from outside. Example SLA policy: public-exposure critical 24h, high 7d, medium 30d, low 90d. Exceptions are time-boxed (max 90d), owner-named, auto-reopen on expiry.

Trade-offs. Native (Security Hub/Defender/SCC) is cheap and integrated but weak on cross-cloud graph and custom controls. Third-party buys attack-path graph and multi-cloud normalization at per-resource cost and data egress. Delegated admin gives one pane but concentrates blast radius in one account's role trust. Pick native when you're single-cloud and mostly want hygiene; pick third-party when you need attack-path prioritization across clouds. Score-based ranking is wrong when a handful of public, exploitable findings hide behind thousands of low-severity ones: rank by exposure and reachability, not count.

Failure modes. Stale assessment: recorder stopped, findings freeze, dashboard looks green. Detect via last-config-change timestamp. Connector gap: account created outside Organizations, invisible for weeks. Detect via the ListAccounts diff. Alert fatigue: 10k findings, 90% dupes, engineers mute the channel. Detect via exception age and recurrence rate climbing. And if you have no remediation authority, CSPM is a report generator; fix that before buying tooling.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-9

Prove CSPM asset and control coverage.

Answer

Core answer (60-120 seconds)

Coverage has three parts that fail independently, so I'd prove them separately: the asset inventory is complete per account and region; every control that should run actually evaluated rather than sitting disabled or returning no data; and a real misconfiguration reaches a routed alert in bounded time.

Assumptions: ~120 AWS accounts in one organization across 18 enabled regions, Security Hub as the aggregator, Config as the recording dependency, Terraform managing most resources but not console-created ones. Terraform state can only corroborate: it proves what IaC manages still matches, and can never tell you what IaC doesn't know about.

Assets: two oracles with opposite blind spots

sourceseesblind spot
CUR 2.0, grouped by SERVICE and REGIONevery account/region with spend, including the account created last week and never enrolledeverything at $0: security groups, IAM roles, VPCs, S3 buckets, idle Lambda
per-region API enumeration (Cloud Control list-resources; Resource Explorer where the type is supported)the $0 resourcestypes outside the CloudFormation registry, and anything shorter-lived than the enumeration

Join them on ARN, never on name:

SQL
SELECT coalesce(a.arn, c.arn) AS arn,
       CASE WHEN c.arn IS NULL THEN 'enumerated, missing from CSPM'
            WHEN a.arn IS NULL THEN 'in CSPM, gone upstream'
       END AS verdict
FROM inventory_api a FULL OUTER JOIN cspm_assets c ON a.arn = c.arn
WHERE a.arn IS NULL OR c.arn IS NULL;

Then trend the counts and alert when per-(account, region, service) cardinality drops while that service's spend is flat. A connector that loses permission often returns an empty or truncated list rather than a hard error, so the falling count is the only signal you get.

Controls: evaluated beats enabled

Read Compliance.Status on findings, not the enablement flag:

statusmeaningaction
PASSED / FAILEDevaluated: this is the signalnone
NOT_AVAILABLEevaluator couldn't run; StatusReasons says why, usually no Config recorder in that region or RecordingStrategy EXCLUDE dropping the typepage
DISABLEDoff centrally or by account overridereconcile against baseline
no findings for an account+regionSecurity Hub was never enabled; it's regional, so us-east-1 being on proves nothing about eu-west-1enrollment gap

120 accounts x 18 regions = 2,160 cells. Enabled in 2,100 is 97.2%, and those 60 named cells are the whole answer to "prove coverage".

Canaries

Create the misconfiguration for real in one dedicated, data-free account. Record four timestamps: Terraform apply, CloudTrail eventTime, Security Hub finding CreatedAt, ticket created. A hypothetical run, measure your own, reads 0s / 3s / 11s / 48s, which is what makes "p95 detection-to-route under 60 seconds" defensible where "within objectives" is not. The cost is real: for those four hours the canary account has a public bucket, so cap it with a TTL, automated teardown, and an alarm if teardown fails.

Alternate monitoring or accepted risk

Accept only when you can enumerate exactly what's unmonitored and it holds no customer data; if you can't produce the list you have an unknown, not an accepted gap. Otherwise add detection, and for anything shorter-lived than your scan interval use CloudTrail event rules rather than scans: ECS tasks and EKS pods live minutes and no snapshot scanner sees them. One trap: an SCP that blocks public buckets also stops the canary being created, so it fails for the opposite reason you intended. Test detection where the preventive control is deliberately off, or you're proving the SCP, not the CSPM.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-8

Operate CSPM consistently across three cloud providers.

Answer

Core answer. No single CSPM sees AWS, Azure and GCP equally well, so don't buy one and expect parity. Run the three native engines (AWS Security Hub, Microsoft Defender for Cloud, Google Security Command Center) as evidence sources behind one operating model. State your assumptions: you have org-level read (AWS Organizations, Azure management groups, GCP organization/folders), you own the posture function but not the accounts, and you can't force every team onto one cloud. Four parts: one ownership map, one set of provider-neutral outcomes mapped to native controls, one normalized finding schema, one SLA and remediation path. Keep the provider's control ID and raw finding on every normalized record: that's what makes the mapping auditable when a provider changes a control.

Ownership map. AWS Organizations OUs → accounts; Azure management groups → subscriptions; GCP organization → folders → projects. Enforce a tag/label contract (owner, env, data-classification) with SCPs, Azure Policy and GCP org policy. A finding with no owner is a finding nobody fixes.

Map outcomes, not controls. Pick a dozen outcomes and map each to the native control per cloud:

OutcomeAWSAzureGCP
No public data storeSecurity Hub S3.1 (Block Public Access), S3.2/S3.3 (public read/write)Defender for Cloud "Storage accounts should restrict network access"SCC PUBLIC_BUCKET_ACL
No open ingressSecurity Hub EC2.2 (default security group)Defender for Cloud "Management ports of virtual machines should be protected with just-in-time network access control"SCC OPEN_FIREWALL
Admin MFACIS AWS Foundations Benchmark (v1.5.0 numbering) 1.5 root MFA, 1.4 no root access keyAzure Policy "Accounts with owner permissions on Azure resources should be MFA enabled"SCC MFA_NOT_ENFORCED
Encryption at restSecurity Hub RDS.3Azure Policy "Virtual machines should encrypt temp disks, caches, and data flows between Compute and Storage resources"SCC KMS_KEY_NOT_ROTATED

Normalize the finding. One record per (resource, outcome), not per vendor finding. Fields: resource ID (ARN, Azure resource ID, GCP full resource name), provider, native control ID, native severity, normalized severity, internet-facing yes/no, data classification, owner, first-seen, last-seen, exception. Don't trust the vendor severity label: Defender for Cloud and SCC both emit Low/Medium/High but score different things. Derive normalized severity from exposure × data classification and keep the native label beside it.

Worked arithmetic (hypothetical). 1,200 accounts/subscriptions/projects, ~40,000 resources. Raw monthly findings: Security Hub 9,000, Defender for Cloud 6,000, SCC 3,000. 18,000. Collapsed to (resource, outcome) pairs: 4,100. Of those, 380 are internet-facing data stores and 22 have owner=unknown. Report 4,100 and 380, not 18,000.

Connector health. Check the connector is alive before trusting silence: AWS Config recorder running in every region you use, Security Hub enabled in every account or via delegated admin; Defender for Cloud auto-provisioning on for every subscription; SCC enabled at the organization level, not per project. Alert when a connector's last assessment is older than 24 hours: a quiet dashboard is usually a broken connector, not a clean estate.

Failure modes.

  • Mapping drift: a provider retires or renames a control and your mapping matches nothing. Detect with findings-per-control-ID per week; a control dropping to zero is a signal, not a win.
  • Orphaned resources: no owner tag, default queue, nobody fixes it. Detect with the share of findings where owner=unknown.
  • Exception rot: exceptions with no expiry. Detect with exceptions older than 90 days.
  • One logical app split across three clouds producing three findings. Detect by grouping on owner + app tag across providers.

What would change my decision. If 90%+ of workloads sit on one provider, run that provider's CSPM as primary and treat the other two as read-only feeds. If a regulator names a framework (PCI DSS, SOC 2), map outcomes to it once and let the native compliance dashboards be the evidence. If the team is one or two people, buy a CNAPP that already normalizes the three: the mapping is the ongoing cost, and it's the part that rots.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-15

Onboard an acquired cloud environment into CSPM.

Answer

Assumptions to state in the first 20 seconds: the acquisition runs its own AWS Organizations (120 accounts, two regions) plus three Azure subscriptions; the parent already runs one CSPM; the first consolidated board report is due in 45 days. If the acquired company keeps its own control plane, step 2 changes, not step 5.

Do not bulk-remediate an environment you do not yet operate. Connect read-only, prove the scanner sees everything, then widen trust: connector, then standards, then remediation. Phase 1 is a cross-account read role per provider, scoped with an ExternalId. Phase 2 reconciles what the CSPM sees against the CMDB and counts "unable to assess" as a failure, not a pass. Phase 3 fixes only reversible, account-scoped items - public access blocks, IMDSv2, log delivery - and hands destructive changes to the resource owner. Phase 4 maps the acquisition's control IDs to the parent's once, instead of adding their scores to yours.

Phase 1: the connector. Start from AWS's managed SecurityAudit policy rather than AdministratorAccess, then add only what the scanner reports denied; organizations:ListAccounts is a common first add. Leave Secrets Manager and SSM out unless the scanner needs them - a read role that can read secrets is not low-privilege. The trust policy on each member-account role pins the vendor's scanner principal and an ExternalId:

{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111122223333:role/cspm-scanner"},"Action":"sts:AssumeRole","Condition":{"StringEquals":{"sts:ExternalId":"cspm-8f2c"}}}]}

Azure gets Reader at management-group scope (Azure Lighthouse if the tenants stay separate); GCP gets roles/securitycenter.adminViewer at organization scope.

Phase 2: coverage, then one traced run.

CollectWhy it changes the plan
organizations:ListAccounts plus OU layoutDelegated-admin inheritance vs per-account roles
IAM credential report, root MFA statusRoot without MFA is the first fix, and it blocks nothing
CloudTrail trails, and whether they deliverA trail that exists but is not delivering is not coverage
Peering/Transit Gateway/VPN attachmentsWhether the scanner needs public egress at all
Whether scanning reads snapshots or calls APIsSettles residency, not the vendor's marketing page

Trace one scanner run: it assumes the role in each account, which CloudTrail records; calls Describe/List per service, where a denied or throttled call becomes "unable to assess", never a pass; normalises findings to account plus region plus resource ARN; and emits control-level findings with no ARN - no org trail, for example - which belong to the platform team, not an app owner.

Phase 3: dedupe before you report. Hypothetical: 120 accounts, 24,000 resources the cloud APIs report against 21,000 in the CMDB, three scanners flagging the same public bucket. 900 raw criticals collapse to roughly 300 unique findings. Staff against 300, or a 7-day critical SLA means nothing.

Trade-offs. Delegated admin gives inheritance and one integration, but Security Hub delegated administration covers only accounts inside your own AWS Organization - a separately purchased company has to be invited in first, or it runs its own delegated admin. Auto-remediation from day one is right for a tuck-in already inside your org boundary with your change control, and only for reversible, account-scoped controls; never for delete or revoke on a legacy estate mid-integration. One parent tenant is right when regulators read the parent's risk model; regional or self-hosted scanning is right when the connector's control plane sits outside the region.

Failure modes and how they surface. Silent coverage loss: CloudTrail metric filter on AssumeRole for the scanner role, alarm if the 24-hour count is zero. New accounts not inheriting: daily diff of organizations:ListAccounts against accounts with a connector healthy in the last 24 hours. Duplicate findings: group on resource ARN plus control family, count distinct tool IDs, keep anything unmappable out of the risk score. Remediation blast radius: notify-mode first, then diff the would-change set against open change tickets. Lost pre-close evidence: export findings to a retention-locked store before the first fix. Data egress: verify the connector's endpoint region and the vendor's subprocessor list.

Steady state. Test connector revocation once - role, ExternalId, shared snapshots - before you need it, and alert when a new account goes 24 hours without coverage.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-11

Create a custom CSPM control for an internal requirement.

Answer

Assume the accounts are already onboarded to a CSPM and the requirement is a configuration property, not runtime behaviour. A custom control is three artefacts that must be versioned together: the query, the mapping from query output to a finding (severity, owner, remediation text), and a fixture suite that proves the query. Write the query in the CSPM's own language: Rego over the Wiz graph, RQL in Prisma Cloud, KQL over Azure Resource Graph in Defender for Cloud, so you inherit the vendor's inventory, identity and network context. A cloud-native rule (an AWS Config custom rule plus a Security Hub ASFF import) is cheaper and evaluates closer to the resource, but you rebuild the graph yourself.

Requirement to encode: every S3 bucket uses SSE-KMS with a customer-managed key in the same account, unless tagged data-classification=public.

REGO
package cspm.internal.s3_cmk

deny[msg] {
  b := input.resources[_]
  b.type == "aws_s3_bucket"
  not is_exempt(b)
  msg := sprintf("%s (%s): %s", [b.id, b.account_id, violation(b)])
}

is_exempt(b) {
  b.tags["data-classification"] == "public"
}

violation(b) = "no server-side encryption configured" {
  not b.config.server_side_encryption_configuration
}

violation(b) = sprintf("SSE algorithm is %s, not aws:kms", [alg]) {
  d := default_rule(b)
  alg := d.sse_algorithm
  alg != "aws:kms"
}

violation(b) = sprintf("KMS key %s is not in account %s", [key, b.account_id]) {
  d := default_rule(b)
  d.sse_algorithm == "aws:kms"
  key := d.kms_master_key_id
  not contains(key, b.account_id)
}

default_rule(b) = d {
  d := b.config.server_side_encryption_configuration.rule[_].apply_server_side_encryption_by_default[_]
}

Four buckets in account 111122223333:

bucketconfigtagsresult
logs-prodSSE aws:kms, key arn:aws:kms:us-east-1:111122223333:key/abc—compliant, no finding
public-assetsSSE AES256data-classification=publicexempt, no finding
app-dataSSE aws:kms, key arn:aws:kms:us-east-1:999988887777:key/xyz—deny: key not in account
tmp-scratchno encryption block—deny: no SSE configured

Two findings. tmp-scratch is the case worth arguing about: the not b.config.server_side_encryption_configuration branch makes the control fail-closed on missing data. That is a choice, not a default.

Trade-offs. Fail-closed versus fail-open on missing data is the first decision. Fail-closed is right when absence of the field is the violation: here, no encryption block means SSE-S3, which is not SSE-KMS, so it fails. Fail-closed is wrong when the field is merely uncollected: a read role missing s3:GetBucketEncryption returns nothing for all 40,000 buckets, and you get 40,000 findings that all say "no encryption configured" when the real fault is one IAM policy. Decide by asking whether the collector can distinguish "absent" from "unread".

Native query versus cloud-native rule turns on whether you need graph context. If the requirement is "no bucket is reachable by an unauthenticated principal", the CSPM already computes effective exposure and you should not rebuild it. If it is "this bucket has this property", an AWS Config change-triggered rule fires within minutes of the config item changing, while a periodic Config rule is capped at a 24-hour maximum execution frequency, so a 15-minute requirement cannot be met by a periodic rule at all.

Report-only versus enforce is a blast-radius decision, not a maturity one. Ship report-only, diff against a manual review of 50 sampled resources, and only attach enforcement once the diff is empty.

Failure modes. Silent coverage loss: the collector loses an API permission and the control evaluates zero resources. Detect by tracking evaluated-resource count per control per day and alerting on a drop over 10%; in AWS Config the same fault surfaces as NOT_APPLICABLE rather than NON_COMPLIANT, which no finding dashboard shows. Schema drift: the vendor renames server_side_encryption_configuration, the Rego path goes undefined, and fail-closed flips every bucket to noncompliant overnight. Detect a step change in finding count over 20% with no corresponding cloud change, and run the fixture suite in CI on every vendor release. Exception drift: 200 expiring exceptions with no enforced expiry leave the control at 60% effective coverage. Report exception count and mean age weekly.

Operating it. Severity comes from the requirement, not the tool default: no SSE at all is high, a cross-account CMK is medium because it is a regulatory finding, not an exposure. Remediation text names the call: aws s3api put-bucket-encryption with the SSE-KMS configuration. Owner is the team that owns the buckets, not the security team. When the requirement changes, supersede with a new version and leave the old control report-only for one cycle so you can diff the two.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-19

Manage a provider change to CSPM controls and scoring.

Answer

Assume you own CSPM for a multi-account AWS org on Security Hub with CIS AWS Foundations Benchmark v1.4.0, and the provider is moving to v1.5.0 in 30 days. The score is passed/(passed+failed)*100 over evaluated controls. The job is not to keep the number stable; it is to keep the number meaningful.

First 90 seconds: freeze the current score as a baseline, diff the control set, and decide whether to re-baseline or dual-report. I would not let the provider's new score overwrite the old one without a versioned denominator.

Score moves because denominator and numerator change. Old set: 200 controls, 150 pass -> 75%. New set retires 20, adds 15, and changes applicability for 10. If 140 old passes remain and 5 new controls pass, new score = 145/(200-20+15)=145/195=74.4%. That 0.6-point drop is denominator churn, not risk increase. If you merge a retired control "S3 bucket ACL not public" into new "S3 bucket ACL and policy not public", you may close 30 findings that the new control would still fail.

Old (v1.4.0)New (v1.5.0)ChangeAction
S3 bucket ACL not publicS3 bucket ACL and policy not publicAdds policy checkKeep separate; re-scan; do not auto-close
MFA for rootMFA for all IAM usersScope widenedNew backlog; owner IAM
CloudTrail enabled in all regionsCloudTrail enabled with multi-region trail and log validationParameter addedRe-evaluate existing passes

Trade-off: freeze scoring vs re-baseline. Freeze keeps v1.4.0 score for audit and runs v1.5.0 in shadow. Use it when audit is under 30 days or evidence retention requires old control IDs. Cost: two dashboards and manual mapping. Re-baseline switches to v1.5.0, accepts discontinuity, and re-scans all resources. Use it when the provider deprecates old controls and backlog is manageable. Cost: trend break and exec explanation. Deciding criteria: provider retirement date, audit date, backlog size, whether old evidence is admissible.

Failure modes. Silent merge: mapping old to new by title only. Detect by diffing control metadata: ID, parameters, resource types, remediation. Cost: false compliance, failed audit, rework. Stale exemptions: exemptions keyed to old control ID. Detect by joining exemption table to new control IDs and counting orphans. Cost: exempt resources become unmonitored. Automation drift: auto-remediation tied to old control ID. Detect by running a canary resource in non-prod and checking ticket creation. Cost: silent non-remediation.

Stage enablement: enable v1.5.0 in one OU or 10 accounts for 14 days. Snapshot coverage: count evaluated resources per control before and after. Validate detection: seed a known-bad S3 bucket and an IAM user without MFA; confirm new control fails. Validate remediation: run auto-remediation, confirm bucket policy fixed. Update policy mappings and dashboards with versioned denominators. Keep raw counts: passed, failed, not applicable, no findings. Reassess previously exempt or unsupported resources.

If new score drops more than 5 points and backlog increases more than 20%, pause rollout and re-baseline with dual reporting. If drop is under 2 points and no semantic merges, switch and document the version change.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-17

How do you prove a CSPM tool actually detects what it claims: deliberately introducing known misconfigurations in a test account and confirming the tool flags them, so you know its findings are trustworthy and where its detection gaps are?

Answer

Core. Test control by control, not "the tool". Pull the vendor's control catalogue (Security Hub CSPM controls reference, Defender for Cloud security policies, SCC detectors), pick the controls that map to your top risks and to anything you cite as compliance evidence, and for each write a canary: a deliberately misconfigured resource deployed as IaC into a dedicated account with no production data. Per canary measure three things: a finding appeared, it names the right resource, and how long it took. A control the catalogue claims that the canary doesn't trip is a false negative, and that's the number that matters.

The canary estate. One account/subscription/project per cloud, created by Terraform, tagged cspm_canary=true with the expected control ID. The tag matters twice: it's how you correlate findings back to the test, and it's how you exclude canaries from auto-remediation and suppression. Security Hub automation rules, Defender governance rules and SCC mute rules will otherwise resolve or hide the finding, and you'll be measuring suppression, not detection.

hcl resource "aws_security_group" "canary_ssh" { name = "cspm-canary-ssh-${var.run_id}" vpc_id = var.vpc_id ingress { from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } tags = { cspm_canary = "true" expected_control = "EC2.19" } }

Reading the result. Check the finding in the default view, not just via API. Security Hub workflow status (NEW/NOTIFIED/RESOLVED/SUPPRESSED), Defender exemptions and SCC mute rules all leave the finding present but invisible; a canary that "detects" into SUPPRESSED is a gap in your operating picture. Then confirm the resource ARN matches the canary: a finding on the wrong resource is as bad as a miss.

CanaryExpected controlFindingLatency
SG 22 open to 0.0.0.0/0EC2.19yes, correct ARN42 min
IAM user, console access, no MFAIAM.5none— gap
RDS instance, storage unencryptedRDS.3yes1 h 10 m
S3 bucket policy Principal: "*"S3.2yes38 min

Coverage 3/4 = 75%. The IAM.5 miss goes on a gap register with the vendor, and I stop citing IAM.5 as evidence until it's fixed.

Latency is half the answer. If the scan cadence is hourly, worst-case detection is ~60 min plus processing; a resource that lives 20 minutes is invisible no matter how good the control is. Measure p50/p95 creation-to-finding and compare against the mean lifetime of your ephemeral resources (short-lived CI roles, autoscaled instances). NIST SP 800-137 frames this as the monitoring frequency you chose versus the change rate you have to keep up with.

Where it breaks. Canary drift: someone "fixes" the misconfiguration and the test silently passes. The canary account falling outside the connector scope, so you're testing nothing. Central configuration aggregation: create the canary in a member account and confirm it reaches the admin view, or you've only proven single-account detection. Provider control changes (renames, retirements, scoring) turn a passing canary into a false alarm: pin the control ID and re-baseline on release. And a canary set that only covers resources you create via Terraform misses the console and API paths your teams actually use.

Cost trade-off. Don't canary all ~400 controls weekly. Canary the controls that would change a decision: top-risk mappings, compliance evidence, anything feeding an automated block. Run the full set on vendor release and on new control adoption; run the critical subset nightly. Store results as a time series so a control that detected last month and doesn't today shows as a regression, not a gap you rediscover in an audit.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-4

Investigate a claimed CSPM false positive.

Answer

The 90-second answer. A claimed CSPM false positive is a claim about the detector's evidence, not about the resource. Before you accept or dismiss it, reproduce the finding from the provider's own API at the finding's assessment timestamp. Then classify it into one of three outcomes, because they have different fixes: the resource is genuinely out of scope, the control is enforced by a layer the detector doesn't model, or the detector's query is wrong. Only the third is a detector bug.

Assumptions. You have read-only provider access, the finding carries a resource ID and an assessment time, and the CSPM is Wiz, Prisma Cloud, or AWS Security Hub. If the connector role is missing a read permission, the finding may be wrong in either direction: check that first.

1. Pin the finding. Record the control/policy ID and version, the query text, resource ID, account/subscription/project, region, and assessment timestamp. In Security Hub, aws securityhub get-findings returns CreatedAt, UpdatedAt, Compliance.Status, ProductFields, and Resources[].Id; ProductFields carry the original control ID and version. In Wiz, open the issue's evidence graph; in Prisma, the policy's RQL.

2. Reproduce at the timestamp, not now. Live state answers a different question. AWS: aws configservice get-resource-config-history --resource-type AWS::S3::Bucket --resource-id <bucket> --start-time <t-1h> --end-time <t+1h> returns the configuration item as recorded, and aws cloudtrail lookup-events --lookup-attributes AttributeKey=ResourceName,AttributeValue=<bucket> shows any PutBucketPolicy or PutBucketAcl around the assessment time. Config's recorder is not instantaneous, so widen the window rather than trusting a single point. Azure: az monitor activity-log list --resource-id <id> for history, az graph query -q "Resources | where id =~ '<id>'" for current state. GCP: gcloud asset get-history --asset-names=<name> --content-type=resource --start-time=... --end-time=....

3. Model inheritance and defaults. A detector that reads only the bucket policy will flag a bucket that cannot be public. Since April 2023 new S3 buckets have Block Public Access enabled and ACLs disabled (BucketOwnerEnforced) by default, and an account-level PutPublicAccessBlock overrides the bucket. Azure storage accounts default allowBlobPublicAccess to false. GCP org policy storage.publicAccessPrevention blocks public grants at the org. SCPs and Azure Policy Deny assignments do the same. If any of these apply, the finding is mitigated, not false.

4. Classify and act.

  • Out of scope → fix the scope or tagging, not the detector.
  • Mitigated elsewhere → the detector's evidence model is incomplete; file that as the bug.
  • Detector wrong → e.g. it treats Principal: "*" with a Condition on aws:SourceVpce as public. File detector feedback with the resource ID, timestamp, the API response, and the control version.

5. Suppress narrowly, with an expiry. Security Hub: aws securityhub batch-update-findings with Workflow.Status=SUPPRESSED and a Note naming the ticket. In Wiz, scope an ignore rule to the resource, not the control, and set an expiry. Never suppress a whole control.

6. If valid, remediate and look for siblings. Run the same query across the account or org. If ten buckets share the pattern, the fix is the custom control or the mapping, not ten tickets.

What would change my decision. If CloudTrail shows a PutBucketPolicy after the assessment time, the finding was true when it fired and is now stale: that's a remediation, not a false positive. If the connector role lacks s3:GetBucketPolicy, the detector may have failed open; fix the permission and re-run before trusting either verdict.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-3

Respond to a CSPM finding for a public storage resource.

Answer

First 90 seconds

Three things decide this: which control flagged it, whether the grant is read-only or includes write, and whether the data is regulated. Assume AWS S3: the reasoning transfers to GCS allUsers bindings and Azure allowBlobPublicAccess.

CSPM reads control-plane configuration on a schedule: bucket policy, ACL, Block Public Access settings. It never sees a GetObject. So the finding says the door was unlocked at the last evaluation; it says nothing about whether anyone walked through. Contain the door, then go find the footprints.

Default to containing first. If the policy grants s3:PutObject or s3:DeleteObject to *, or the bucket holds regulated data, apply account-level Block Public Access now: one call, reversible. If it's read-only and low-sensitivity, spend ten minutes snapshotting the policy JSON first. Never revoke before snapshotting: the policy document is the evidence of what was exposed.

Snapshot

aws s3api get-bucket-policy --bucket prod-reports > prod-reports-policy.json
aws s3api get-bucket-acl --bucket prod-reports > prod-reports-acl.json
aws s3api get-bucket-policy-status --bucket prod-reports   # {"PolicyStatus":{"IsPublic":true}}

get-bucket-policy-status is cheap triage: IsPublic: true means the policy grants access outside the account without a restrictive condition. It doesn't separate read from write; read the JSON for that.

Contain

aws s3control put-public-access-block --account-id 123456789012 \
  --public-access-block-configuration \
  BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true

Account-level covers buckets you haven't found yet. The four settings differ, and the difference scopes your blast radius:

SettingBlocks
BlockPublicAclsNew public ACLs; PUTs carrying one fail
IgnorePublicAclsExisting public ACLs stop granting access
BlockPublicPolicyNew bucket policies granting public access
RestrictPublicBucketsExisting public policies serve only same-account and AWS service principals

Two gaps: BPA does not block presigned URLs (SigV4, up to 7 days), and it does not block cross-account access granted to a named account ID. That isn't "public", so RestrictPublicBuckets ignores it. If the policy names a foreign account, revoke the statement; BPA isn't your containment.

Investigate

The window starts when the policy changed, not when the finding arrived:

aws configservice get-resource-config-history --resource-type AWS::S3::Bucket --resource-name prod-reports

CloudTrail management events exclude GetObject, so lookup-events returns nothing useful here. Query data events in CloudTrail Lake or Athena:

SQL
SELECT useridentity.type, useridentity.principalid, sourceipaddress, count(*) AS n
FROM cloudtrail_logs
WHERE eventsource = 's3.amazonaws.com'
  AND eventname IN ('GetObject','PutObject')
  AND requestparameters LIKE '%prod-reports%'
  AND useridentity.type = 'Anonymous'
GROUP BY 1,2,3 ORDER BY n DESC;

Anonymous calls log as useridentity.type = 'Anonymous', principalid = 'anonymous'; in S3 server access logs the requester field is -. If neither data events nor access logs were enabled, you cannot bound the window: write that down and treat the data as exposed.

Worked arithmetic: policy changed 2024-06-03T02:14Z (Config timeline), finding delivered 2024-06-04T06:00Z, BPA applied 06:22Z. Exposure 28h08m, 3h48m of it post-detection. If the query returns 41 anonymous GetObject calls from 3 IPs between 02:31Z and 02:47Z and nothing after, you have a bounded incident you can describe in numbers.

Failure modes

  • Bucket-level BPA only. Anyone with s3:PutBucketPublicAccessBlock flips it back. Detect with Config rule S3_ACCOUNT_LEVEL_PUBLIC_ACCESS_BLOCKS_PERIODIC and alert on drift, not on the next scan.
  • Presigned URLs outliving containment. A 7-day URL minted before BPA still works. Grep app logs for X-Amz-Expires and rotate the signing credentials.
  • Re-applying the same IaC module to restore. If the module produced the public policy, you've scheduled the next incident. Fix the module or add an SCP denying s3:PutBucketPolicy with a public principal.

Close

Restore only intended access, verify with an independent probe, curl the object URL from outside the VPC and confirm 403, confirm the finding clears, and record the exposure window, the query you ran, and residual risk where logs were missing.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-2

Prioritize thousands of CSPM findings after initial rollout.

Answer

Let me start with assumptions. You've rolled out a CSPM tool like Wiz, Prisma Cloud, or AWS Security Hub across, say, 50 AWS accounts and 10 Azure subscriptions. You have 10,000 findings. The first thing I'd do is not sort by severity. That's the trap.

First, make the denominator credible. Deduplicate: the same misconfiguration often appears per resource, per region, per account. In a typical rollout, 20–30% are duplicates or setup artifacts: like a Config recorder that isn't enabled, or a connector that's still onboarding. I'd filter those out with a rule: if a finding's resource is tagged onboarding or the control is not applicable, suppress it, but log the suppression so you can audit. Also check coverage: are all accounts, regions, and services actually being scanned? If not, your backlog is understated.

Now, for the real findings, I'd score by exploitability and blast radius, not CVSS alone. The key is attack path analysis. Tools like Wiz and Orca build a graph of your cloud. A chokepoint is a node that, if fixed, breaks many attack paths. For example, an IAM role with *:* that's assumable by a public-facing EC2 instance. Fixing that one role might resolve 200 findings. Per-finding scoring would have you fix 200 separate S3 bucket policies. So chokepoints beat per-finding scoring because they collapse the graph.

How do you detect toxic combinations? You look for intersections: public exposure + privileged identity + sensitive data. A concrete trace: Finding 1: S3 bucket prod-pii is public. Finding 2: IAM role app-role has s3:GetObject on that bucket. Finding 3: app-role is attached to an EC2 instance with a public IP and no MFA. That's a toxic combination: data exfiltration path. That goes straight to incident response, not the backlog.

For the rest, group by root cause. If 500 findings are 'security group allows 0.0.0.0/0 on port 22', that's one module or one Terraform policy. Assign an owner, the platform team, with an SLA. Typical SLAs:

Risk tierSLAExample
Toxic / critical24 hoursPublic S3 with PII + privileged role
High7 daysPublic SSH, unencrypted prod DB
Medium30 daysMissing MFA on non-prod admin
Low90 daysUnused security group rule

But you need a lane for oldest/high-risk: anything older than 90 days and high risk gets escalated weekly.

Trade-offs: The chokepoint approach fails if your graph is incomplete. E.g., you haven't onboarded all accounts, or you lack identity data. Then you fall back to per-finding scoring with compensating controls. Also, fixing a chokepoint can be risky: if that IAM role is used by production, you need a change window. So you weigh blast radius of the fix against blast radius of the finding.

Finally, report exposure-weighted debt, not raw count. That means: sum of (risk score × number of affected resources) over time. Track recurrence, if the same finding reappears after fix, that's a process failure. And track unassigned work. A dashboard showing 'we reduced findings by 50%' is useless if the remaining 50% are all toxic.

That's how I'd prioritize.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-14

Assign owners and remediation SLAs to posture findings.

Answer

Clarify first. I'd ask three things before designing this: which scanner produces the findings (Security Hub, Wiz, Prisma, GCP SCC), whether there's a CMDB or service catalog I can trust, and what the org's tolerance is for a finding sitting unowned. My assumption for the rest: cloud posture findings, a service catalog exists but is incomplete, and the goal is that every finding has a named accountable human and a clock.

Ownership resolution, in order. I resolve an owner in four steps and stop at the first hit:

  1. An owner tag on the resource, validated against the catalog: a tag pointing at a team that no longer exists is treated as no tag.
  2. Catalog lookup by resource ARN, or by account plus resource ID when the ARN is unstable.
  3. The account or OU owner from the account registry.
  4. Escalation to the platform team with a five-business-day clock to name an owner. Unowned findings stay in a tracked metric; they are never dropped.

SLA derivation. Base clock by severity, then an exposure modifier. Hypothetical tiers:

ClassBaseModifier
Internet-facing + privileged or data-bearing24h—
Critical (CVSS ≥ 9.0)7d×0.5 if internet-facing
High (7.0–8.9)30d×0.5 if internet-facing
Medium (4.0–6.9)90d—
Low180d—

Grace semantics are explicit: a finding goes due-soon at 80% of its window, overdue at 100%, and escalates to the owner's manager at 100% plus three days. A risk acceptance is allowed but must carry an expiry of 90 days or less; an expired acceptance reopens the finding.

Python
# Python 3.12
from datetime import datetime, timedelta

BASE_DAYS = {"critical": 7, "high": 30, "medium": 90, "low": 180}

def due_date(severity, internet_facing, has_data, created):
    days = BASE_DAYS[severity]
    if internet_facing and has_data:
        days = min(days, 1)          # toxic combination
    elif internet_facing:
        days = days / 2
    return created + timedelta(days=days)

Trace it: a critical finding on an internet-facing bucket holding data, created 2025-03-01, takes the min(7, 1) branch and is due 2025-03-02. The same critical finding on an internal host, no data, gets 7 days. A high finding that is internet-facing but data-free gets 30/2 = 15 days.

Trade-offs. Tags are self-service and exist at deploy time, but they drift, get typos, and are spoofable: anyone can write owner=platform. A catalog is authoritative and carries the org hierarchy and on-call rotation, but it goes stale on reorgs and needs onboarding work. I use tags as the fast path and the catalog as the source of truth, reconciled nightly. Auto-assignment is the wrong call for shared resources (VPCs, transit gateways, shared KMS keys) where it just creates ticket ping-pong; those route to the platform team with one named accountable owner.

Failure modes and detection. Tag drift is the big one: a team renames itself, the tag points at a dead alias, and findings silently pile up. A nightly reconciliation comparing tag owners to catalog entries catches it; alert when unowned findings exceed 2% of the total. A subtler break is a Terraform module shipping a default owner=platform tag, misattributing hundreds of resources: you see it as a distribution shift, one team's finding count jumping well outside its normal weekly range. And an SLA clock with no escalation ladder just produces overdue findings nobody acts on.

Closure. A finding closes only on resource evidence, a re-scan showing the config is now compliant, not on a ticket being marked done.

What would change my answer: no catalog at all means starting with tags plus account-owner fallback; low finding volume means manual triage beats building any of this.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-18

Handle a finding that reopens after being marked resolved.

Answer

What I'd say first

Before touching the ticket, pin down what "reopened" means, because it decides everything. Two different events get called a reopen:

  1. The same finding ID flips from RESOLVED back to NEW/NOTIFIED: the fingerprint (control + resource + account + region) is unchanged.
  2. A new finding ID appears on the same resource: the fingerprint changed, usually because the resource was recreated or the control version bumped.

Assumption I'd state out loud: findings come from an automated control evaluation (AWS Security Hub / Config, or a scanner) where the finding ID is derived from control ID plus resource identifier, and Workflow.Status is a separate field from Compliance.Status.

The core answer: a reopen is usually not "the fix failed." It's that the closure was workflow-only. Someone set Workflow.Status = RESOLVED while Compliance.Status stayed FAILED and RecordState stayed ACTIVE. The next evaluation re-emits the finding. So the first move is to compare the two states, not to re-close.

Mechanism

In ASFF, Workflow.Status (NEW, NOTIFIED, RESOLVED, SUPPRESSED) is independent of Compliance.Status (PASSED, FAILED, WARNING, NOT_AVAILABLE) and RecordState (ACTIVE, ARCHIVED). Setting workflow to RESOLVED does not stop the control from evaluating. If the resource is still non-compliant, the next evaluation writes FAILED again and the finding looks reopened. Genuine regression looks different: the resource was compliant, then a change (a Terraform apply, a manual console edit) made it non-compliant again.

Cause → evidence → action

CauseEvidenceAction
Workflow-only closureCompliance.Status=FAILED throughout; UpdatedAt only moved on the workflow fieldFix the resource, then re-verify
Real regressionCompliance.Status went PASSED→FAILED; a Config configuration-change event on the resourceFind the change source (IaC vs console)
Resource recreatedNew resource ARN/ID, new finding IDRe-apply the baseline to the new resource
Stale assessmentUpdatedAt older than the fix; no new evaluation ranTrigger a re-evaluation (Config periodic rule or a config change)
Suppression expiredWorkflow.Status=SUPPRESSED with an expiry that lapsedDecide whether suppression is still justified

Trade-offs

Two ways to handle reopens: treat each as a fresh incident (safe, noisy. A flapping control can page daily) or dedupe by fingerprint and only escalate on state transitions (quiet, but a workflow-only closure hides a real regression). The deciding criterion is whether the fingerprint includes the resource's config hash. If it does, a reopen means the config changed and you can trust dedupe. If it doesn't, you must read Compliance.Status history before trusting any closure.

Failure modes

  • Automation that sets RESOLVED when the ticket closes: makes workflow state look like remediation.
  • Suppression rules with no expiry: the finding never re-emits, so a real regression stays invisible.
  • Resource recreation under the same name: new ARN, new finding, old one archived; looks like a fix.

Close

Fix the resource and the IaC/module that provisioned it, trigger the next evaluation, confirm Compliance.Status=PASSED on a fresh UpdatedAt, then close. Add recurrence detection: alert when a finding ID transitions RESOLVED→FAILED more than once in 30 days.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-21

Reduce CSPM alert fatigue without weakening visibility.

Answer

Assumptions. A multi-account AWS organization, call it 200 accounts across three regions, with Security Hub aggregating Config-backed controls and findings landing in a ticketing queue. The numbers below are illustrative for that shape; substitute your own before quoting them.

Core answer. CSPM alert fatigue is a cardinality problem before it is a severity problem. A single misconfiguration arrives as hundreds of findings, because the control is evaluated once per resource, once per account, once per region, and again for every standard that contains an overlapping control. AWS Config re-evaluates on configuration change, so a bucket touched by a deployment pipeline emits a fresh finding each time. The fix is to collapse findings onto a stable identity, enrich them so triage doesn't require three consoles, and only then route by urgency. Nothing is deleted, deduplicated and suppressed findings stay queryable, and that is what keeps visibility intact.

Where the volume comes from. Take one control: "S3 bucket allows public read." In an account with 400 buckets it fires 400 times. Enable CIS AWS Foundations Benchmark and PCI DSS alongside your internal standard and the same underlying fact appears under three control IDs, so 1,200 findings describe one condition. Security Hub's consolidated control findings collapse the per-standard duplication into one finding per control per resource, which helps, but it does not touch the per-resource fan-out. That fan-out is the thing you have to group.

The funnel. Dedup key: control ID + resource ARN + account + region. Group key: root cause, usually the IaC module or the owning-team tag that produced the resources. Illustrative daily numbers for the 200-account org:

stagekeyfindings/day
rawnone180,000
dedupcontrol + resource ARN + account + region22,000
grouproot cause (IaC module or owner tag)3,100
ranktoxic combination140 paged

How toxic combinations are computed. Not by severity. Build a graph: findings are nodes keyed by resource ARN and IAM principal; edges are network reachability and IAM permissions. A combination is a path: public ingress exists, the resource carries a sensitive-data tag, and a principal with write access can reach it. That is a join over the graph, and it is why enrichment has to happen before ranking: severity alone cannot separate a public bucket holding access logs from a public bucket holding customer records.

Routing. The 140 go to paging. The 3,100 go to queues with SLAs measured in days, grouped by owner so one team gets one ticket for one root cause. Suppression is a workflow status, not a delete, the finding stays searchable, but it drops out of the security score, so every suppression rule carries an expiry and a review date.

Failure modes. Over-broad suppression hides a real regression: keep a known-bad canary resource and assert weekly that it still alerts. A dedup key that omits the account or ARN collapses genuinely different resources: assert the key's cardinality against the raw count. Stale assets keep findings open after termination: Security Hub archives findings that have not been updated in 90 days, so anything older than that sitting in your queue is either a real long-lived issue or a broken inventory join. Enrichment gaps are silent: if fewer than roughly 90% of findings resolve to an owner, fix tagging before trusting the ranking, because untagged resources default to low priority.

When not to. Under roughly 50 accounts and a few thousand findings, dedup tooling costs more than it saves: tune the ten noisiest controls directly. And never suppress a control that carries audit evidence; route it to a compliance queue with a longer SLA instead, so the record still exists at assessment time.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-10

Build an exposure-aware CSPM risk model.

Answer

First 60-120 seconds

Clarify before modelling: does exposure mean network reachability, or effective reach after identity and control-plane trust are followed? Default to the second, because it reorders the queue.

Then answer directly: the score is a gated product, not a weighted sum.

Risk = E * I * K, where E (exploitability) and I (impact) are 0-10, K discounts for mitigations that survive this exact path, and the output is 0-100.

E = 10 * R * P * M and I = 10 * D * B * C.

FactorWhat it answersScale
Rcan the request arriveinternet 1.0; peered or shared VPC 0.6; private-only 0.2
Pwhat the attacker must already holdnothing, no interaction 1.0; any authenticated principal 0.6; admin role or victim interaction 0.3
Mwhat tooling existsKEV-listed or public exploit 1.0; EPSS at or above a house threshold of 0.10 0.7; public PoC 0.6; nothing public 0.2
Dwhat data the path reachesregulated PII, PCI or PHI 1.0; confidential internal 0.6; public 0.2
Bhow far compromise spreadsshared control plane or chokepoint 1.0; workload plus everything its role can read 0.5; single resource 0.3
Cbusiness weightrevenue path 1.0; internal tool 0.5; dev or sandbox 0.2
Kwhich mitigations survive this path0.8 per verified control, floor 0.4

Why multiply instead of adding

An additive weighted sum lets a private, credential-less dev host climb the queue on the volume of weak factors. Multiplication makes each barrier compound and forces reachability to be answered before anything else. CVSS v3.1 environmental metrics (FIRST, June 2019) already solve the single-host version of this credit assignment, so map R, P and M onto its AV, PR and UI axes rather than inventing parallel vocabulary.

Worked trace: two findings from the same hour

Finding A. An API route with no authorizer in front of a Lambda whose execution role can s3:GetObject the customer PII bucket. R = 1.0 internet; P = 1.0 nothing required; M = 1.0 a single curl; D = 1.0 regulated; B = 0.5 the workload plus the one bucket its role reads; C = 1.0 revenue path; K = 1.0 because the bucket policy's VPC-endpoint condition does not bind a Lambda running outside the VPC.

E = 10 * 1.0 * 1.0 * 1.0 = 10. I = 10 * 1.0 * 0.5 * 1.0 = 5. Risk = 10 * 5 * 1.0 = 50.

Finding B. A KEV-listed CVE on a dev instance in a private subnet with no instance role. R = 0.2; P = 1.0 unauthenticated exploit; M = 1.0 KEV; D = 0.6 internal logs; B = 0.3; C = 0.2 dev; K = 0.8 for one verified control, no cloud credentials on the host.

E = 10 * 0.2 * 1.0 * 1.0 = 2. I = 10 * 0.6 * 0.3 * 0.2 = 0.36. Risk = 2 * 0.36 * 0.8 = 0.58.

A scores 50 and B scores 0.58, yet B carries the known-exploited CVE and A carries no CVE at all. That inversion is the model working. If it does not survive your own incident list, the weights are wrong, not the finding.

Alternatives, and when this model is the wrong tool

ShapeBreaks when
Vendor severity passthroughunreachable assets dominate; KEV on an isolated dev host outranks an open production route
Additive weighted sumno single gate can zero a score, so every input needs a cap and scores drift upward
Gated product, aboveone dimension at zero flattens real risk; chokepoints that are not internet-facing get under-scored

Skip the model for compliance drift that is not an exploit path (encryption at rest off on a bucket that is private and unreachable, missing tags) and for invariants you cannot price (root account without MFA, org trail disabled). Those route to a rule lane that pages regardless of score. When the graph cannot resolve reachability, emit unknown exposure and queue it; never emit a low score for an unanswered question.

Gaming, staleness, recalibration

Owners edit exactly one input: business criticality. It is versioned with an approver and a 90-day expiry, and any change forces a re-score with an audit line. Reachability, preconditions and controls come from the config graph, never from owner tags. Detect gaming as a distribution shift in that tag per owner against the org default. Detect saturation when a chokepoint holds rank 1 for 8 weeks with no change on the asset itself. Replay the last 20 real incidents monthly; fewer than 16 landing in the top 200 means the weighting has drifted. EPSS is a probability, so carry it as a band and publish the score range, not a point.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-16

Use CSPM attack paths to reduce risk.

Answer

Assumptions. AWS, a CSPM that does attack-path analysis (Wiz, Orca, Prisma Cloud all ship it; Security Hub + Config gives you the raw graph but not the path ranking), and a goal of breaking the most plausible paths per unit of change risk, not zeroing out the graph.

Core answer. An attack path is a chain of edges (network reachability, IAM permission, trust, credential exposure) from an entry point to a high-value target. The graph is a directed multigraph, and the fix that matters is the node or edge with the highest betweenness, because it is the chokepoint every path funnels through. So: pick the path, verify its edges are real and current, find the chokepoint, fix that instead of the leaf.

Worked example. A path Wiz-style tooling would surface:

0.0.0.0/0:22 on sg-0a1b → i-0abc (public EC2, unpatched OpenSSH) → instance profile role app-runner with s3:GetObject on arn:aws:s3:::* → bucket customer-exports (PII).

Four candidate fixes and what each actually breaks:

fixedge removedpaths broken
drop 0.0.0.0/0:22 from sg-0a1bnetworkonly paths entering via that SG
scope app-runner to customer-exportspermissionevery path using that role, from any instance
patch OpenSSH on i-0abcexploitonly exploit-based paths through that host
bucket policy denying non-VPCE accesspermissionevery path to the bucket

If app-runner is attached to 40 instances, scoping it breaks 40 entry points at once. That is the chokepoint.

Why one fix dominates. Betweenness. If the role sits on 40 of 60 paths to the bucket, removing its wildcard kills 40 paths; the SG rule kills 3. Same effort, roughly 13x the risk reduction. Don't stop there, though: the bucket policy is worth doing too, because it holds even if a new role appears tomorrow. That is what defense in depth buys you here.

Failure modes.

  • Stale graph. CSPM graphs rebuild on a scan cadence, commonly hours to 24h, plus change-triggered updates for some resource types. A path in the console may already be closed. Detect by diffing the finding's timestamp against CloudTrail/Config change events for those resources. Cost: you remediate something already fixed and stop trusting the tool.
  • Over-broad fix. Scoping app-runner breaks a nightly batch job that reads a different bucket. Detect with IAM Access Analyzer unused-access findings and a pre-change dependency query. Cost: silent job failure at 02:00.
  • Alternate path. You close the SG, but the host is SSM-managed and the same role is reachable through Session Manager. Detect by rerunning path analysis after the change, not just checking the finding cleared. Cost: false all-clear.
  • Score drift. The vendor reweights severity and the path drops out of the top 20 without being fixed. Track finding IDs and path hashes, not scores.

Close. Apply through the resource owner with a reviewed change, rerun the graph, then confirm with a direct test (aws s3 ls from the instance profile, or a reachability probe) because the graph is a model, not the truth. Route any evidence of active use (CloudTrail showing that role assumed from that instance) to incident response.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-5

Accept risk for a posture finding responsibly.

Answer

What I'd say in the first 90 seconds

Accepting a risk is not muting a finding. It moves the decision from whoever runs the scanner to a named owner who is accountable for the loss, and it always carries an expiry and a monitor. My default test: estimate the annualized loss and the cost to remediate. If remediation costs more than the exposure and no regulator requires that control, I accept it in writing for a fixed period, backed by at least one compensating control whose evidence I can see every week. If the resource is internet-reachable, or the data is regulated, or the weakness maps to something on CISA's known-exploited list, I don't accept it: I compensate and schedule the fix.

Assumptions I'd state out loud: this is a real posture gap, not a false positive (a false positive is suppression for a different reason. The detection itself is wrong, and I write that down). The resource owner is known. The CSPM is the system of record for the finding, so the acceptance has to live there, not only in a ticket.

The four options and the deciding criteria

Remediate, accept, transfer (insurance, contractual cap), or avoid (turn the service off). Deciding criteria in order: is the exposure reachable from the internet; is the data regulated or customer-owned; does the control map to a contractual or framework requirement; what is the remediation cost versus annualized loss. That ordering matters: a $2k/yr exposure on a throwaway dev bucket is an easy accept, the same number on a PCI-scoped store is not, because the compliance cost of a failed audit dwarfs the technical loss.

Hypothetical arithmetic I'd put in the record: public S3 bucket, no PII, scanning plus egress and IR costs about $20k if abused, rough exploit probability 0.1/yr, so annualized loss 0.1 * $20k = $2k. Fixing it properly requires a three-week app change at roughly $30k plus $4k/yr. Accept for 12 months with CloudTrail, S3 access logging and a Macie job as monitors.

The record

FieldExample
Scopearn:aws:s3:::acme-dev-assets, rule S3.1
Failed controlBlock Public Access off at bucket level
Compensating controlWAF not applicable; CloudTrail to immutable log + Macie weekly
Monitor and evidenceMacie job ID, weekly result saved to the ticket
Owner / approverService owner + CISO delegate, not the scanner operator
Start / expiry / trigger2026-01-01 / 2026-07-01 / asset, exposure, threat or provider change, or renewal
Rejected alternativesFull remediation (cost), disable bucket (breaks CI)

Making it stick in the tool

In Security Hub that is a workflow status plus a note, so the finding leaves the human queue but stays queryable:

aws securityhub batch-update-findings \
  --finding-identifiers Id="arn:...:finding/abc",ProductArn="arn:aws:securityhub:us-east-1::product/aws/securityhub" \
  --workflow Status=SUPPRESSED \
  --note Text="RISK-4821 accepted by service-owner until 2026-07-01; monitor macie-weekly",UpdatedBy="risk-bot"

The console's default findings view excludes suppressed findings, so the queue looks clean, which is exactly why the acceptance record, not the queue, is the report. Wiz and Prisma Cloud model the same thing as an accept-risk action with a mandatory expiry.

Failure modes and how I'd catch them

Waiver drift. Accepted risks quietly renew. Detect: alert 30 days before expiry, and count re-acceptances per finding ID. Anything accepted three times goes to the risk committee, not a bot.

Monitor rot. The compensating control stops emitting. Detect: if the weekly evidence artefact is missing for one cycle, the acceptance auto-revokes and the finding reopens as NEW.

Hidden regression. A tag-scoped waiver suppresses a new resource that reopened the same misconfiguration. Detect: scope waivers to explicit resource ARNs, and monthly diff suppressed findings against the waiver list.

Concentration. Ten silent accepts in one account is a systemic gap. Cap accepted risks at 10% of the internet-facing inventory and report accepted-risk age and concentration separately from resolved findings.

Accept only for medium and low severity with a working monitor; high and critical need a named executive and a 30-day ceiling.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-13

Design CSPM exception governance at scale.

Answer

The 90-second version

I'd treat an exception as a time-boxed, attributed record with an owner, not a mute button. Four dispositions, each with its own default expiry and approval authority. Every exception carries a filter, a reason, evidence, a requester, an approver who isn't the requester, and an end date. Expiry is the default; "indefinite" is the case that has to be argued and cited to policy.

Assumptions I'd state up front: multi-cloud, three providers, ~50k resources, ~12k findings a week, exceptions live in the CSPM tool and are mirrored into a ticketing system and the IdP so approver identity is real.

Dispositions and authority

DispositionMeaningDefault expiryApprover
False positiveControl logic is wrong for this resource90 days, auto-renews only if the control version is unchangedControl owner
Not applicableControl cannot apply to this resource classIndefinite, scoped to a resource type, never an instanceSecurity architect
MitigatedA compensating control covers the exposure180 daysControl owner + risk owner
Accepted riskBusiness accepts the exposure365 daysRisk owner, exec sign-off

Why expiring rules beat static mutes

A static mute is a predicate evaluated when the console renders a query. The finding still exists; it's filtered out of the view. Two consequences: it applies to resources that didn't exist when the rule was written, and it never comes back. An expiring rule writes an end date onto the exception, so on day 366 the finding returns to the queue at its original severity. The entire difference is what happens on day 366.

Precedence

Rule engines here are usually ordered and first-match-wins: verify in yours, because if it's last-match-wins your precedence design inverts. A broad rule ("ignore all public-ACL findings on S3") placed above a narrow one ("ignore bucket X") swallows the narrow one. Keep broad rules at the bottom, and run an overlap check that flags any resource matched by two rules.

Failure modes and how I'd detect them

  • Silent expiry. 200 exceptions expire in the same week, the queue floods, triage collapses. Detect: alert on exceptions expiring within 14 days that have no open renewal ticket.
  • Over-broad wildcard. A filter on a tag like env=prod matches every future resource. Blast radius is unbounded and grows. Detect: count resources matched per rule; alert when a rule matches resources created after the rule was written.
  • Rubber-stamp approval. One approver signs 90% of exceptions. Detect: approver distribution per quarter.
  • Orphaned exception. The resource is deleted, the finding never reappears, the exception never expires. Detect: join exceptions against live resource inventory monthly.

Trade-offs

Expiring rules cost review load. At 12k findings/week and a 3% exception rate, that's 360 new exceptions a week; at 10 minutes per renewal decision that's 60 hours a week, which is why auto-renewal for unchanged controls matters. Static mutes cost nothing to maintain and hide drift. The deciding question is whether the underlying condition is permanent or temporary. A disk-encryption control on a resource type that has no disks is permanent: static, scoped to the resource type. A mitigation in progress is temporary: expiring. Everything else defaults to expiring.

Tooling

Wiz ignore rules and Prisma Cloud suppression rules support expiry dates; GCP Security Command Center mute configs take an expiry time; Azure Defender for Cloud exemptions carry an expiry date and a waiver/mitigated category. AWS Security Hub suppression is a workflow status set via BatchUpdateFindings, which has no native expiry: there you need an external job to un-suppress on the date.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-6

Design safe automated remediation for a posture control.

Answer

First 90 seconds

Assumptions: the control is config-posture. A public S3 bucket, an unencrypted EBS volume, a 0.0.0.0/0 ingress rule. Findings re-evaluated on a schedule, the platform team owns the pipeline, application teams own the resources.

Filter: automate only controls that are deterministic (same finding, one desired state), reversible through an API, and narrow (one resource type, off the live path of an in-flight change). Controls that need intent you do not have stay manual. An open security group tells you the rule is wrong, not which CIDR replaces it: you can close port 22, you cannot invent the right source range, so that one pages a human.

Order of operations: snapshot the current config alongside the finding ID; assume a role scoped to that resource's ARN, not a wildcard; write the complete desired state in one call; read it back and verify; check workload health; close the finding with the snapshot attached. Rollback is mechanical only because that snapshot exists: without it, "roll back" means rebuilding from memory.

Alternatives, and where not to automate

pathfixesbreaks on
control-plane API: AWS Config + SSM Automation, Azure Policy deployIfNotExists/Modify with a remediation task, GCP SCC to a Cloud Functionresource config: bucket policy, encryption flags, SG rules, IAM policyblind inside the OS; needs a cross-account write role; acts on evaluation state that may be 30 s stale
host agent: SSM Agent, agent-based auto-fixpackages, local firewall, file permissionshost must be alive and patched; a stopped instance never converges
IaC reconciliation: fix the Terraform and let the pipeline applyroot cause, permanentlyPR review latency in minutes to hours; too slow for a critical finding

Auto-remediate additive, reversible changes: default encryption, versioning, logging, the four Block Public Access flags. Require one approval for anything that removes a permission, deletes a key, or rewrites reachability. Two traps: "enable encryption" on an existing EBS volume is a snapshot-copy-swap and host-visible, so it is not auto; and disabling an access key beats deleting it, because disable reverses in one call.

Idempotent remediation, traced

Python
# python3.12, boto3 1.34+
BLOCK = {"BlockPublicAcls": True, "IgnorePublicAcls": True,
         "BlockPublicPolicy": True, "RestrictPublicBuckets": True}

def remediate(s3, bucket):
    try:
        pre = s3.get_public_access_block(Bucket=bucket)["PublicAccessBlockConfiguration"]
    except s3.exceptions.ClientError as e:
        if e.response["Error"]["Code"] != "NoSuchPublicAccessBlockConfiguration":
            raise
        pre = {}
    if pre == BLOCK:
        return {"changed": False, "pre": pre}      # idempotency gate, no write
    s3.put_public_access_block(Bucket=bucket, PublicAccessBlockConfiguration=BLOCK)
    post = s3.get_public_access_block(Bucket=bucket)["PublicAccessBlockConfiguration"]
    if post != BLOCK:
        raise RuntimeError(f"verify failed: {post}")
    return {"changed": True, "pre": pre, "post": post}

Trace: no config present, so the get raises 404 NoSuchPublicAccessBlockConfiguration, pre stays {}, {} != BLOCK, one put writes all four flags atomically, the read-back equals BLOCK, so it returns changed=True with pre kept for rollback. Second run: pre == BLOCK, changed=False, zero writes. That equality gate is what makes retries safe, including retries under AWS Config automatic remediation, whose MaximumAutomaticAttempts is an integer from 1 to 25; leave it at 1 for IAM and network controls and do bounded retries inside the document, where they are logged.

Drift: if CI reapplies an old template with BlockPublicPolicy=false, the finding re-opens and the pipeline re-fixes it forever. Count repeat remediations per ARN over 24 h and escalate on the second one. Check your control's data source too: IgnorePublicAcls makes S3 ignore public ACL grants without deleting them, so a scanner that reads the ACL object keeps the finding open even though effective access is closed.

Failure modes and detection

  • Blanket control on a bucket that legitimately serves public assets, such as a CDN origin. Exclude by tag (public-by-design, reviewed quarterly) and dry-run in a non-prod account or against 3 named resources first.
  • Self-inflicted outage from closing live traffic. Pair each batch with a 10-minute health check (ALB target health, 5xx rate) and roll back from the snapshot on failure.
  • Stale provider API behind a document. Run the document against a known-bad fixture in non-prod on a schedule, and watch the automation's own error rate.
  • Suspend the rule on 3 failures in the last 20 runs that originated in the automation rather than the control. At a 2% benign API error rate that false-trips about 0.7% of windows; at a real 30% error rate it trips about 96% of the time, assuming independent errors.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-12

Feed CSPM findings back into infrastructure delivery.

Answer

Core answer (first 90 seconds)

A CSPM finding is a symptom of a module, not a resource. The job is to make the module stop producing it, then prove the fix holds. Map the finding to the code that created it, fix the module, add a policy test that fails on the old pattern, and gate the pipeline so the same plan can't merge again. Contain live exposure first only if the resource is reachable right now.

Map finding to code

CSPM scans deployed state, so a finding names a resource ID: an ARN, a GCP self-link, an Azure resource ID. That ID appears in Terraform state:

$ terraform state list | grep aws_security_group.web
module.web.aws_security_group.this

The state address gives you the module path, the repo, and the owner via CODEOWNERS. The deployment run is the CI job that last applied that workspace: read the apply log for the commit SHA. If the resource isn't in state, it was created out of band (console, CLI, another stack). That's a drift finding, not a code finding, and the fix is import or delete, not a module edit.

Fix the module, not the console

Editing the console fixes the finding until the next terraform apply reverts it. Fix the module, then encode the rule as a policy test so the pattern can't come back.

Artefact 1: the policy

Rego, run with Conftest against terraform show -json:

REGO
package terraform.sg

deny[msg] {
  r := input.resource_changes[_]
  r.type == "aws_security_group"
  r.change.actions[_] == "create"
  rule := r.change.after.ingress[_]
  rule.from_port <= 22
  rule.to_port >= 22
  rule.cidr_blocks[_] == "0.0.0.0/0"
  msg := sprintf("%s opens 22 to 0.0.0.0/0", [r.address])
}
terraform plan -out plan.out && terraform show -json plan.out > plan.json
conftest test plan.json --policy policy/

Artefact 2: trace of one finding

  1. A CSPM scan (Wiz, Prisma Cloud, Prowler) flags sg-0a1b in account 1234: SSH open to 0.0.0.0/0.
  2. terraform state list in infra/web → module.web.aws_security_group.this.
  3. git log -p on that module → the ingress block was added in commit a1b2c3.
  4. Fix: replace 0.0.0.0/0 with the bastion SG ID; add the Rego rule above.
  5. conftest test fails on the old plan, passes on the new one.
  6. Merge; the next apply closes the finding. Re-scan confirms.

Trade-offs

DecisionPreferWhen it's wrong
Block in CI vs warnBlock once the policy has run in warn mode for ~2 weeks with <5% false positivesNew policy, or a rule that fires on legitimate patterns: warn first
Contain prod vs fix codeContain first if the resource is internet-reachable nowA config smell with no exposure: fixing code first avoids a second change
Exception vs fixTime-boxed exception with resource ARN, ticket, expiryOpen-ended exceptions become permanent: they're the drift you find next quarter

Failure modes

  • Drift: someone re-opens the port in the console. Detect with terraform plan -refresh-only on a schedule, or AWS Config rules.
  • Alternate pipeline: a second workspace or a CloudFormation stack creates the same resource. Grep the org for the resource type before declaring done.
  • Policy checks create only: an update that adds the bad ingress slips through. Add update to actions.
  • Exception without expiry: the OPA exception file grows. Add a CI check that fails on expired entries.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-22

Integrate CSPM with incident response.

Answer

What I'd say first

CSPM tells you the cloud is misconfigured; it does not tell you someone used the misconfiguration. So the integration has one job: turn a posture change into an incident that carries enough evidence to answer "was this used?" and a containment path that doesn't wreck the posture team's workflow. Everything else is plumbing.

Assumptions I'd state up front: single cloud (AWS), CSPM findings land in Security Hub, CloudTrail and Config are the change sources, PagerDuty pages and Jira holds the record. Change any of those and the trigger list shifts, but the shape doesn't.

Triggers worth paging on

Not every finding. Five classes, because each is a plausible step in an attack rather than a hygiene gap:

TriggerSourceTypical latency
Bucket or object made publicCloudTrail PutBucketPolicy/PutBucketAcl, Config rule s3-bucket-public-read-prohibitedCloudTrail to EventBridge typically under 5 min, documented worst case 15
Logging disabledStopLogging, UpdateTrail, DeleteDetectorsame
New admin or cross-account trustIAM CreateRole/UpdateAssumeRolePolicy, Access Analyzer external-access findingConfig change, minutes
Security service disabled in a regionGuardDuty or Security Hub admin changesminutes
Toxic path to a crown jewelCSPM graph query, e.g. internet-facing ALB to an instance profile with read on the secrets bucketrecomputed per scan, so hours

Push vs pull, and when not to auto-contain

Push (EventBridge into the incident tool) gives minutes of latency and no dedupe. Pull (the incident tool polls Security Hub on a schedule) dedupes for free but can miss a change reverted before the poll. Decide by persistence: a public bucket reverted in 90 seconds still matters if anyone read it, so push the five classes above and pull the long tail. That's the volume trade: pushing every finding is thousands a day, pushing these five is tens.

Auto-containment is where integrations cause outages. Don't auto-revoke roles or delete resources in a shared account, on a break-glass identity, or on a production data plane. Do auto-apply reversible, low-blast-radius fixes: account-level S3 Block Public Access, disable a leaked access key.

Why the evidence matters

An immutable finding-plus-config timeline is the only proof of what the resource looked like at time T. If the finding record is mutable and the resource gets deleted, the evidence is gone; CloudTrail log file validation plus S3 Object Lock is what makes it tamper-evident. And CSPM reads control-plane config, not data-plane access: a public-bucket finding says the policy allowed reads, not that anyone read. CloudTrail data events are off by default, so the honest answer is often "cannot prove read", which is a containment decision, not a closing note.

Worked trace (hypothetical, AWS)

02:14:03 PutBucketPolicy sets Principal: "*" on prod-data-bucket. 02:16 the EventBridge rule matches, a PagerDuty incident opens, owner pulled from tag owner=payments. 02:17 the responder queries CloudTrail data events for the bucket. None configured, so no read proof; treat as potential exposure. 02:19 containment: apply account-level Block Public Access, rotate the key that made the call. 02:25 the posture owner reverts the policy and the ticket returns to the posture queue with the config fix.

Failure modes and how you'd see them

  • Alert storm, then responders mute the integration. Detect: incidents-per-day over findings-per-day, and MTTA climbing.
  • Duplicate incidents when two CSPM tools report the same resource. Detect: incidents per resource ARN per hour above 1.
  • Stale owner routes to someone who left. Detect: share of P1/P2 incidents unacked at 15 minutes.
  • Auto-containment causes an outage. Detect: change-failure rate on days with containment actions.

Test the handoff with a game day that fires a synthetic public-bucket event end to end, and check dedupe and after-hours ownership in the same run.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-20

Operate through a CSPM connector or service outage.

Answer

First 90 seconds

Split "outage" in two, because they fail differently. A connector outage is ours: the read-only role's trust policy changed, the external ID rotated, the service account was disabled, or egress to the CSPM SaaS broke. A CSP-side outage is the provider's: APIs return 5xx or throttle, and enumeration returns partial pages. The second is worse: a partial enumeration still produces a plausible asset count, so nothing looks broken.

Assumption to state: CSPM is a scheduled pull, not a stream. Assume role → enumerate per account and region → evaluate rules → write findings. So the goal isn't "keep it running"; it's stop the risk signal from lying, keep the controls that don't depend on the connector, and restore with proof of coverage.

Where it breaks

StageConnector outageCSP-side outage
assume role100% AccessDenied, immediateunaffected
enumerateno new inventory; counts frozenpartial pages, counts drift down
evaluateassessments stop; findings agesome rules error, others pass
exportSIEM/ticket feed goes quietduplicates or gaps

The stage tells you the blast radius. Assume-role failure is loud and total. Partial enumeration is quiet and partial: the one you must catch with a count check, not an error check.

Detection, with thresholds

Set freshness as a multiple of the expected interval, not a fixed number. If inventory syncs hourly, warn at 2 missed cycles and page at 4; if assessments run daily, warn at 26h. Alert on asset-count deltas: an account or region disappearing, or a >5% drop in total resources with no matching change event, is a coverage failure, not a cleanup.

Watch the control plane for tampering, not just the data plane: CloudTrail StopLogging, DeleteTrail, PutEventSelectors, DisableOrganizationAdminAccount, DeleteDetector, and any change to the CSPM role's trust policy. Most CSPM consoles expose a last-successful-sync or connector-health timestamp (Wiz connector health, Prisma Cloud asset last-seen, Defender for Cloud continuous export status): that timestamp is the primary signal; the dashboard's green is not.

Trade-offs

Native queries vs connector: AWS Config advanced queries and Security Hub are authoritative and unaffected by your connector, but narrow. Use them for the top handful of controls (public S3, open security groups, root MFA), not as a general replacement.

Restrict deploys vs continue: decide by whether the control is preventive or detective. If the outage takes out an admission controller or SCP that blocks a known-bad configuration, hold those deploys. If it only takes out detection, don't block: you've lost visibility, not safety, and blocking on stale data is the wrong trade. Restricting everything is the failure mode here.

Worked trace (hypothetical)

Hourly inventory sync. Last success 09:00. 11:00 warn, 13:00 page. Dashboard still shows 12,400 assets; an account added 09:30 with 40 resources is invisible, and a security group opened at 10:15 never appears. At 13:05 the connector log shows 100% AssumeRole AccessDenied for one OU. The role's trust policy was edited at 08:55. Coverage gap: 4h of inventory, 4h of assessments, one OU entirely. That's the number to put in the incident record.

Restore

Re-issue least-privilege credentials, then verify coverage before trusting output: compare the enumerated account list against Organizations ListAccounts and the region list against DescribeRegions; confirm the resource count returns to the pre-outage baseline plus known growth. Backfill the missed window, rerun assessments, and reconcile findings: expect a spike, so batch owner notifications rather than firing thousands at once. Record the gap and its duration in the risk register; a stale window is an accepted risk someone has to own.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-24

Secure the CSPM platform and its remediation identities.

Answer

Assumptions: multi-account AWS, SaaS CSPM (Wiz, Orca, AWS Security Hub with auto-remediation). The CSPM has a central service role that assumes remediation roles in target accounts.

The core answer: treat the CSPM as tier-0. Separate read from write. Give each remediation class its own role with only the permissions that class needs. Make every action short-lived and auditable. Concretely: inventory every connector, service principal, remediation role, API token, webhook, and human admin. Give the inventory collector a read-only role scoped to metadata (e.g., ec2:Describe*, s3:GetBucketPolicy, but not s3:GetObject). For remediation, create one role per class, e.g., CSPM-Remediate-S3PublicAccessBlock with only s3:PutBucketPublicAccessBlock. Use STS AssumeRole with a 15-minute session and an external ID. Separate the role that manages detectors from the role that deletes evidence. Export audit logs to a separate account with S3 Object Lock. Rotate credentials on a schedule and alert on drift.

Now the tradeoffs. Three designs for remediation identities: per-class static roles, JIT elevation with approval, human-in-the-loop for all. Per-class roles are simple and auditable but proliferate; if one is compromised, the blast radius is that class. JIT elevation (e.g., CSPM requests a role via ServiceNow, gets 1-hour credentials) reduces standing permissions but adds latency and a dependency on the approval system. Human-in-the-loop is safest but doesn't scale for auto-remediation. I'd use per-class roles for low-risk, well-understood fixes (enable encryption, block public access) and JIT for high-risk (delete security group, modify IAM).

Mechanism: short-lived credentials bound the attacker's window. If the CSPM's token leaks, the attacker can only assume roles until the session expires. With a 15-minute session, they have 15 minutes to act, and CloudTrail logs every AssumeRole and API call. Drift detection works by comparing the current policy against a baseline: AWS Config rule iam-policy-no-statements-with-admin-access flags any remediation role that gains *. You can also use CloudTrail to alert on AttachRolePolicy or PutRolePolicy for those roles. "Scoped to required metadata" means the read-only role can call ec2:DescribeInstances but not ec2:GetConsoleOutput; it can read S3 bucket policies but not objects.

Example trust policy for a remediation role:

JSON
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": {"AWS": "arn:aws:iam::123456789012:role/CSPM-ServiceRole"},
    "Action": "sts:AssumeRole",
    "Condition": {
      "StringEquals": {"sts:ExternalId": "cspm-tenant-abc123"},
      "IpAddress": {"aws:SourceIp": "203.0.113.0/24"}
    }
  }]
}

The IP condition only works if the CSPM has static egress IPs.

Failure modes:

  • Over-permissioned role: someone adds s3:DeleteBucket to CSPM-Remediate-S3PublicAccessBlock. Detection: Config rule or CloudTrail alert on PutRolePolicy. Cost: false positives from legitimate changes; need a change management process.
  • Credential leak: CSPM API token stolen. Detection: GuardDuty UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration or anomalous AssumeRole from a new IP. Mitigation: short session, IP allowlist if static, rotate token.
  • Audit tampering: attacker deletes CloudTrail trail. Detection: CloudTrail log file validation, S3 MFA delete, alert on StopLogging. Mitigation: immutable export to separate account with Object Lock.
  • Remediation loop: CSPM auto-remediates a finding, but the fix is reverted by a misconfigured automation. Detection: finding recurrence, CloudTrail shows repeated PutBucketPublicAccessBlock and DeleteBucketPublicAccessBlock. Cost: API throttling, alert fatigue.

Artefact: table comparing alternatives.

ApproachStanding permissionsLatencyBlast radiusOperational cost
Per-class static rolesOne role per class, always assumableLow (seconds)Limited to that classRole proliferation, policy drift
JIT elevationNo standing write; request per actionHigh (minutes to hours)Limited to approved actionApproval system dependency, on-call burden
Human-in-the-loopNoneVery highNoneDoesn't scale, defeats auto-remediation

What would change my decision: if the CSPM cannot support per-class roles, or if the cloud provider lacks STS-style short-lived credentials, I'd fall back to JIT with a strong approval workflow. If the environment is small and static, human-in-the-loop might be acceptable.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-23

Measure whether CSPM is reducing risk.

Answer

CSPM reduces risk only if it changes the odds or the blast radius of a real incident. So I'd measure it in three layers: is the data trustworthy, is exposure actually shrinking, and does the trend predict incidents.

Layer one is validity, and it's a gate, if coverage is 70%, everything downstream is noise. I'd want at least 98% of accounts reporting, with a freshness SLA of 24 hours for standard accounts and 4 hours for accounts holding production data. Connector gaps are the usual culprit: a new account spun up by Terraform without the read role shows as covered in the console and silent in the findings. Track onboarding lag as its own metric, because that's the mechanism behind a coverage dip: provisioning outran the scanner, not a scanner failure.

Layer two is exposure-weighted trend. Raw finding counts are useless: 40,000 findings where 3,100 are internet-reachable is a different org from 40,000 where 900 are. Weight by internet exposure, identity privilege and data classification, then plot open weighted exposure against newly opened exposure. If you close 800 internet-exposed findings this month but a new region onboards 900, net risk went up while the dashboard went green. That's the causal story: the metric moves on remediation throughput minus new surface, and new surface is dominated by provisioning, not by attackers.

Layer three is time and durability. Mean time to contain hides the tail that matters, so report p50 and p95 separately: p50 under 7 days for internet-exposed, p95 under 30. If p50 is 3 days and p95 is 90, you have a queue-depth problem, not a triage problem, and it's usually unassigned findings or one team owning most of the backlog. Recurrence is the durability check: a finding that reopens within 30 days of being marked fixed means the fix was manual and the next deploy reverted it. Above roughly 10% recurrence, stop counting closures and start counting IaC patches.

Then validate against reality. Sample 20 incidents from the last quarter and ask whether CSPM had flagged the contributing misconfiguration beforehand. If fewer than half did, the tool is measuring compliance, not risk, and the weighting is wrong. Pair that with a manual assessment of 30 random accounts to catch false negatives the scanner can't see.

Two traps. Secure score is a vendor composite with versioned controls and hidden exemptions: usable as a trend only if you pin the control version and publish the denominator. And exemptions rot: an accepted risk with no expiry is a permanent blind spot, so cap exception age at 90 days with a named owner and automatic reopen.

metrictargetbad reading means
coverage / freshness≥98% accounts, ≤24hnew accounts onboarded without the read role
exposure-weighted openfalling month over monthnew surface outpaces remediation
MTTC p50 / p95, internet-exposed≤7d / ≤30dp95 blowout is queue depth, not triage
recurrence within 30d<10%fixes are manual, IaC never patched
exception age≤90d, owner namedpermanent blind spot
incident overlap≥50% had a prior findingweighting measures compliance, not risk

For an exec, lead with one number, exposure-weighted open risk, plus the top five actionable items and the decision each one needs. Everything else is supporting detail.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-25

Retire a CSPM integration or monitored cloud scope safely.

Answer

Assumptions I'd state up front. AWS as the monitored cloud; a third-party CSPM (Wiz, Prisma Cloud, Orca) that assumes a read-only role in each account via a trust policy with an sts:ExternalId condition; auto-remediation running under a separate write role. Azure swaps in an enterprise app + service principal with Reader at management-group scope, GCP a service account or workload-identity-federation pool: different nouns, same ordering.

The 90-second answer. Retire in this order: stop the writes, stop the reads, then remove the trust. Disable auto-remediation and the ticketing/webhook fan-out; pause the connector so no new scans start; export the findings and exceptions you're obliged to keep; revoke the cross-account role and delete the connector; then prove nothing is left unmonitored. The step people get wrong is the first one: the remediation role is a different principal from the read role, so revoking the read role does not stop it.

#ActionWhy this order
1Disable auto-remediation, EventBridge schedules, Slack webhook, Jira/ServiceNow integrationThe write role is separate; revoking the read role leaves it firing on stale findings
2Pause the connector (stop scheduled scans)Freezes the finding set so step 3 exports a stable snapshot
3Export findings, exceptions, control config to your retention storeExports are async; deleting the connector first loses the last scan
4Revoke the cross-account role / service principal, delete the connectorRemoves the vendor's ability to assume into the account
5Reconcile monitored accounts against cloud asset inventoryProves no blind spot

Three ways to end a scope, and what picks one. Full retirement: delete the connector, revoke the role. Right when the account is closing or a replacement already produces findings for it. Scope reduction: drop accounts from the connector, keep the connector. Right when only part of the estate moves. Downgrade: keep read, drop remediation. Right when you still want findings but not automated writes. Block retirement outright when the account holds regulated data and no replacement covers it, when open critical findings have no owner, or when a retention obligation hasn't expired: SOC 2 evidence retention is commonly 12 months, PCI DSS requires 12.

Failure modes, with detection.

  1. Blind spot: the account left the connector but still runs workloads. Detect by diffing AWS Resource Explorer or a Config aggregator account list against the CSPM's monitored-account list; alert on any account with resources and no connector.
  2. Orphaned trust: the role is gone from the console but the trust policy still names the vendor account. Detect with the loop below, or IAM Access Analyzer external-access findings.
  3. Zombie remediation: CloudTrail shows the remediation role assuming in after the cutover timestamp. Filter AssumeRole events on that role name and alert on anything post-retirement. A concrete trace: at t0 you pause scanning, t1 you revoke the read role, t2 the remediation Lambda still holds its own write role and an EventBridge schedule, t3 it fires on a stale finding and calls s3:PutBucketPublicAccessBlock on a bucket that was deliberately public for static hosting. Prod breaks after you declared the integration retired.
  4. Evidence loss: findings deleted before the retention window closes. Cost is a failed audit plus re-collection from raw CloudTrail, which is slow and expensive.
Shell
# Every role still trusting the CSPM vendor account (replace 123456789012)
aws iam list-roles --query 'Roles[].RoleName' --output text | tr '\t' '\n' | while read -r r; do
  aws iam get-role --role-name "$r" \
    --query 'Role.AssumeRolePolicyDocument' --output json \
    | grep -q '123456789012' && echo "STILL TRUSTS VENDOR: $r"
done

Trace: list-roles returns every role name; the loop calls get-role per name and greps the trust-policy JSON for the vendor account ID. A role whose policy contains "AWS": "arn:aws:iam::123456789012:root" prints STILL TRUSTS VENDOR: AcmeCSPMReadOnly. Empty output means the trust is gone.

Curated: · Written: · Reviewed:

Difficulty: Hard