Distribuée
Cloud & AI Security
← All insights

Cloud posture

Security Hub reports 3,000 findings: fix 40, not 3,000

Triage Security Hub and Inspector by exploitability: EPSS, CISA KEV, real exposure, Terraform automation rules and a reproducible triage script for SMBs.

· 5 min · #security-hub#inspector#epss#cisa-kev#vulnerability-management#automation-rules#terraform

Day one of Security Hub in a twenty-account organisation: 3,000 findings, 400 of them “High”. The team opens one ticket per finding, closes thirty in two weeks, then the dashboard turns red again and nobody looks at it. The tool is not the problem; the missing triage rule is. This article gives a method and two artefacts: a triage script and Terraform automation rules.

Threat: attackers don’t read your CVSS score

A CVSS score measures theoretical severity, not the likelihood of exploitation in your environment. Three public signals discriminate far better:

  • CISA KEV: the Known Exploited Vulnerabilities catalog, published as JSON. A CVE listed there is exploited in the wild.
  • EPSS: the FIRST score estimates the probability of exploitation in the next 30 days (0 to 1). Amazon Inspector exposes it on every finding (EpssDetails).
  • Real exposure: a network-exploitable flaw on an instance with no open network path is a different risk. Inspector factors this into its own score, which can be lower than the base score when no open network path exists.

The realistic scenario: a critical CVE with no public exploit on an internal service can wait; a “Medium” CVE listed in KEV on a public load balancer is the one that becomes the entry point.

Control 1: four filters, in order

From most to least discriminating:

  1. Internet-exposed? Security Hub exposure findings correlate signals from GuardDuty, Inspector, Security Hub CSPM and Macie to surface combined risks (exposed + vulnerable + permissive). Start there.
  2. In KEV? Fix within 7 days, no debate.
  3. High EPSS? A threshold of 0.1 (10% probability) is a common starting point; tune it to the volume your team can absorb.
  4. Fix available? If not, mitigate (remove exposure, WAF, isolate) rather than wait.

The rest is not ignored: it goes into the normal patch cycle (30/90 days), out of the urgent queue.

Inspector + KEV triage script

ListFindings supports the epssScore, exploitAvailable and fixAvailable filters; KEV is not filterable in Inspector, so we join it from the CISA JSON.

#!/usr/bin/env python3
"""Tri Inspector : KEV ou EPSS >= seuil, finding actif. Usage: triage.py [seuil_epss]"""
import json, sys, urllib.request
import boto3

KEV_URL = "https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json"
seuil = float(sys.argv[1]) if len(sys.argv) > 1 else 0.1

with urllib.request.urlopen(KEV_URL, timeout=30) as r:
    kev = {v["cveID"] for v in json.load(r)["vulnerabilities"]}

inspector = boto3.client("inspector2")
filtre = {
    "findingStatus": [{"comparison": "EQUALS", "value": "ACTIVE"}],
    "findingType": [{"comparison": "EQUALS", "value": "PACKAGE_VULNERABILITY"}],
}

urgent = []
for page in inspector.get_paginator("list_findings").paginate(filterCriteria=filtre):
    for f in page["findings"]:
        cve = f.get("packageVulnerabilityDetails", {}).get("vulnerabilityId", "")
        epss = f.get("epss", {}).get("score", 0.0)
        if cve in kev or epss >= seuil:
            urgent.append({
                "cve": cve,
                "kev": cve in kev,
                "epss": round(epss, 4),
                "fix": f.get("fixAvailable"),
                "resource": f["resources"][0]["id"],
                "account": f["awsAccountId"],
            })

urgent.sort(key=lambda x: (not x["kev"], -x["epss"]))
print(json.dumps(urgent, indent=2))
print(f"{len(urgent)} findings urgents", file=sys.stderr)

Run it from the Inspector delegated administrator account. The JSON output feeds a ticket, a report or audit evidence directly.

Control 2: Security Hub automation rules

Security Hub CSPM automation rules modify findings at ingestion: severity, workflow status, notes. Constraints: created from the administrator account only, 100 rules maximum, per Region, and they apply only to findings created or updated after the rule exists. They run in ascending rule_order.

resource "aws_securityhub_automation_rule" "elevate_prod" {
  rule_name   = "elevate-high-on-prod"
  description = "HIGH sur ressource taguée env=prod -> CRITICAL"
  rule_order  = 1

  actions {
    type = "FINDING_FIELDS_UPDATE"
    finding_fields_update {
      severity {
        label = "CRITICAL"
      }
      note {
        text       = "Elevé automatiquement : ressource de production"
        updated_by = "automation-rule"
      }
    }
  }

  criteria {
    severity_label {
      comparison = "EQUALS"
      value      = "HIGH"
    }
    resource_tags {
      comparison = "EQUALS"
      key        = "env"
      value      = "prod"
    }
    record_state {
      comparison = "EQUALS"
      value      = "ACTIVE"
    }
  }
}

resource "aws_securityhub_automation_rule" "demote_sandbox" {
  rule_name   = "demote-medium-sandbox"
  description = "MEDIUM sur comptes sandbox -> LOW"
  rule_order  = 2

  actions {
    type = "FINDING_FIELDS_UPDATE"
    finding_fields_update {
      severity {
        label = "LOW"
      }
      note {
        text       = "Abaissé : compte sandbox sans donnée"
        updated_by = "automation-rule"
      }
    }
  }

  criteria {
    severity_label {
      comparison = "EQUALS"
      value      = "MEDIUM"
    }
    aws_account_id {
      comparison = "EQUALS"
      value      = "111111111111"
    }
  }
}

Replace the account ID with your sandbox account. Two rules of thumb: never suppress a finding without a justifying note, and prefer disabling a control over suppressing its findings when it makes no sense for you (AWS recommends this, and it also avoids paying for useless checks).

Evidence: what you show the auditor

A SOC 2 or ISO 27001 auditor does not ask for zero findings; they ask for a defined, applied process. Keep:

  • the SLA policy (for example KEV or exposed: 7 days; high EPSS: 30 days; rest: 90 days) signed off by engineering leadership;
  • the monthly triage.py export and observed time-to-fix per finding;
  • the automation rules versioned in Git, with review history;
  • the accepted-exceptions list, with owner and expiry date.

This traceability beats a green dashboard: it shows that not fixing something was a conscious decision.

Takeaways

A three-tier SLA plus exploitability triage shrinks the urgent queue by an order of magnitude without lowering the security bar. On an SMB scope you typically end up with a few dozen truly urgent findings; the exact number depends on your exposure and is measured with the script above, not asserted.

If you want this triage running across your AWS organisation, it is the core of the cloud security audit and the retainer that follows.

Found this useful? Share it.

Go further

A topic, a project, a question?

Distribuée supports demanding SMBs on cloud security, CI/CD supply chain and AI security.

Book 15 min