/devsecops-skills:security-posture-metrics-and-trend-analysisfrom devsecops-skills
Guides tracking security posture trends over time — MTTR by severity, backlog age distribution, false-positive rate, exception-list growth, and gate pass/override rate — to answer whether a DevSecOps program is actually improving.
Ships in devsecops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
"How many open findings do we have right now" is a snapshot, and a misleading one on its own — a security program with 3,000 open findings that has cut its median time-to-fix from 60 days to 12 days over the last two quarters is improving; a program with 300 open findings that has quietly grown from 50 over the same period is not, even though the raw count looks better in absolute terms. This skill covers turning the raw output of security-finding-backlog-triage, secure-cicd-gates, and security-gate-exception-management into trend data that actually answers whether a DevSecOps program is working: mean/median time-to-remediate by severity, backlog age distribution (not just size), false-positive rate per tool/rule, exception-list growth and renewal frequency, and gate override/bypass frequency. Done well, this becomes the evidence base for both internal prioritization decisions and external reporting (leadership updates, audit/compliance evidence); done poorly (vanity metrics like raw finding count, or metrics collected but never reviewed), it becomes a dashboard nobody trusts or acts on.
Capture a durable historical record on every scan run, not just the latest snapshot — the single most common blocker to trend analysis is that only the current finding state was ever kept:
# Archive every scan's raw output with a timestamp, regardless of
# whether the tool's own UI retains history
trivy fs --format json -o "scans/$(date +%Y%m%d)-trivy.json" .
Land these into a queryable store (even an append-only table of
finding_id, tool, severity, status, first_seen, resolved_at is
sufficient to start) rather than only ever looking at the tool's own
live dashboard.
Track mean and median time-to-remediate (MTTR) by severity, against the SLA target, not just as an abstract number:
-- illustrative query against an archived findings table
SELECT
severity,
AVG(resolved_at - first_seen) AS mean_ttr,
PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY resolved_at - first_seen) AS median_ttr
FROM findings
WHERE resolved_at IS NOT NULL
AND first_seen >= NOW() - INTERVAL '90 days'
GROUP BY severity;
Report median alongside mean — a handful of very old, very slow remediations can skew a mean upward (or, if closed as false positives right before a report, downward) in a way median is more robust against.
Track backlog age distribution, not just backlog size:
SELECT
severity,
CASE
WHEN NOW() - first_seen < INTERVAL '30 days' THEN '0-30d'
WHEN NOW() - first_seen < INTERVAL '90 days' THEN '30-90d'
WHEN NOW() - first_seen < INTERVAL '180 days' THEN '90-180d'
ELSE '180d+'
END AS age_bucket,
COUNT(*) AS finding_count
FROM findings
WHERE status = 'open'
GROUP BY severity, age_bucket
ORDER BY severity, age_bucket;
A backlog of 500 findings where 480 are under 30 days old (working as expected through a normal SLA) is a fundamentally different situation from 500 findings where 200 are over 180 days old — same headline count, very different risk picture.
Track false-positive rate per tool/rule as its own trend, feeding back into triage weighting (security-finding-backlog-triage) and tuning decisions:
SELECT
tool, rule_id,
COUNT(*) FILTER (WHERE disposition = 'false_positive') * 1.0 / COUNT(*) AS fp_rate,
COUNT(*) AS total_findings
FROM findings
GROUP BY tool, rule_id
HAVING COUNT(*) >= 20 -- ignore low-volume rules; rate is noisy on small samples
ORDER BY fp_rate DESC;
A rising false-positive rate for a specific rule over successive quarters is a concrete, actionable signal to retune or disable that rule — a static point-in-time rate doesn't show whether it's getting better or worse.
Track exception-list size, age, and renewal frequency as a trend, sourced from the exception registry in security-gate-exception-management:
SELECT
DATE_TRUNC('month', granted) AS month,
COUNT(*) AS exceptions_granted,
COUNT(*) FILTER (WHERE renewal_of IS NOT NULL) AS renewals,
AVG(EXTRACT(day FROM expires - granted)) AS avg_duration_days
FROM exceptions
GROUP BY month
ORDER BY month;
A steadily growing count of active exceptions, or a rising share of multi-renewal entries, is itself a posture regression worth surfacing — even if every individual exception was properly approved.
Track gate override/bypass frequency — how often a required
check was overridden by an admin, or a Constraint's
enforcementAction was patched back to non-blocking under pressure —
as a trend indicating whether gates are actually respected:
SELECT DATE_TRUNC('month', occurred_at) AS month, gate_name, COUNT(*) AS override_count
FROM gate_overrides
GROUP BY month, gate_name
ORDER BY month, override_count DESC;
A gate with a persistently high or rising override rate is functionally advisory, not blocking — surface this explicitly rather than letting the raw "gate exists and is marked required" status imply it's actually working, per the guidance in secure-cicd-gates.
Present trend, not just current value, in every report — a line chart over the last 2-4 quarters for each metric above, not a single current-state table. A report showing only "MTTR for critical: 6 days" tells a reader nothing about whether that's an improvement, a regression, or steady state without the trailing trend alongside it.
Segment by team/service where volume justifies it, not only an org-wide aggregate — an org-wide MTTR that looks acceptable can mask one team or one legacy service dragging the average while everyone else is well within SLA, and the aggregate view hides exactly where intervention is needed.
Symptom: A quarterly security report shows only the current open finding count, and leadership can't tell whether the program is improving, stagnant, or regressing. Fix: Report MTTR by severity, backlog age distribution, and exception-list trend alongside (or instead of) the raw count, with at least 2-3 prior periods shown for comparison, not a single point-in- time number.
Symptom: MTTR looks artificially good because a handful of very old findings were bulk-closed as "false positive" or "accepted risk" right before the reporting period, without individual review. Fix: Cross-check MTTR trend against the false-positive-rate and exception-count trends in the same period — a sudden MTTR improvement paired with a spike in either is a signal to audit the underlying dispositions rather than take the improved MTTR at face value.
Symptom: The team wants to backfill six months of trend data and discovers the scanning tool's dashboard only retains the current state; historical scan results were never archived. Fix: This confirms the need to start archiving raw scan output going forward (step 1) — there is no way to reconstruct genuinely lost history; treat "start the archive now" as the actionable fix rather than attempting an unreliable reconstruction from partial logs.
Symptom: A specific SAST rule has a high false-positive rate every quarter, but nobody has retuned or disabled it because the rate is only ever looked at as a point-in-time snapshot, not tracked as a persistent trend. Fix: Surface per-rule false-positive rate as a standing item in the recurring metrics review (not just computed once when someone asks), and set a threshold above which a rule is automatically flagged for tuning review.
Symptom: A dashboard exists and is technically up to date, but no one has reviewed it in two quarters, and several metrics have quietly regressed (rising exception count, rising override rate) without triggering any action. Fix: Metrics with no review cadence are equivalent to no metrics — put the dashboard review on the same recurring agenda as the finding-triage meeting in security-finding-backlog-triage, with an explicit owner responsible for flagging regressions.
A platform security team builds a quarterly posture report from archived scan data and the exception registry.
Archived findings table (illustrative excerpt):
finding_id | tool | severity | first_seen | resolved_at | disposition
F-0231 | trivy | critical | 2026-04-02 | 2026-04-04 | fixed
F-0894 | semgrep | high | 2026-02-11 | 2026-05-01 | fixed
F-1042 | trivy | high | 2025-11-20 | NULL | (open)
F-1103 | zap | medium | 2026-01-04 | 2026-01-10 | false_positive
MTTR by severity, Q2 2026 (illustrative):
| Severity | Median TTR | Mean TTR | SLA target | Status |
|----------|-----------|----------|------------|---------------|
| Critical | 2 days | 3 days | 2 days | At target |
| High | 9 days | 14 days | 14 days | At target |
| Medium | 41 days | 58 days | 90 days | Within SLA |
Backlog age distribution, current snapshot:
| Severity | 0-30d | 30-90d | 90-180d | 180d+ |
|----------|-------|--------|---------|-------|
| Critical | 2 | 0 | 0 | 0 |
| High | 18 | 11 | 4 | 1 |
| Medium | 140 | 210 | 95 | 60 |
The report flags the 1 high-severity finding over 180 days old by name for individual follow-up, rather than letting it blend into the aggregate high-severity count.
Exception trend (from the registry in security-gate-exception-management):
| Quarter | Active exceptions | New this quarter | Renewed >1x |
|---------|--------------------|--------------------|--------------|
| Q4 2025 | 22 | 9 | 1 |
| Q1 2026 | 31 | 12 | 3 |
| Q2 2026 | 44 | 15 | 6 |
The rising trend and increasing renewal count is called out explicitly in the report as a regression worth investigating, even though every individual exception was properly approved — leading to a follow-up review of which exceptions are being repeatedly renewed and why, per the guidance in security-gate-exception-management.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
security-metrics, devsecops, trend-analysis, mttr, security-dashboard
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin devsecops-skills17 skills in this plugin
/checkov-and-tfsec-iac-security-scanningConfigures Checkov and tfsec to scan Terraform/CloudFormation/Kubernetes IaC source for misconfigurations — hardcoded secrets, overly permissive IAM policies, unencrypted storage, open security groups — before `terraform apply` or `aws cloudformation deploy` ever runs. Use when a user asks to "scan my Terraform for security issues," "add Checkov/tfsec to CI," "find overly permissive IAM in my IaC," "write a Checkov suppression," "compare Checkov and tfsec," or "catch misconfigured cloud resources before they're provisioned."
/complete-devsecops-pipeline-for-kubernetes-from-scratchBuilds the complete security-gate sequence for a Kubernetes-targeted DevSecOps pipeline from scratch — SAST, SCA, container image scanning, a policy-as-code (OPA/Kyverno) admission gate placed before the GitOps handoff, and a secrets model where plaintext credentials never touch the pipeline because an External Secrets Operator pulls them cluster-side instead. Use when the user asks to "build a DevSecOps pipeline for Kubernetes from scratch," "add a policy gate before our GitOps commit," "make sure secrets never touch CI for our K8s deploys," or "sequence SAST/SCA/image-scan/policy gates for a container pipeline end-to-end."
/complete-devsecops-pipeline-for-serverless-from-scratchBuilds the complete security-gate sequence for a serverless (Lambda- style) DevSecOps pipeline from scratch — SAST, SCA against a much larger bundled transitive-dependency surface, package/artifact signing, and least-privilege execution-role scoping as the primary release gate (rather than a Kubernetes-style admission policy), with runtime secrets fetched from a managed secrets service instead of baked into the deployment package. Use when the user asks to "build a DevSecOps pipeline for a Lambda function from scratch," "gate a serverless release on execution-role scope instead of admission policy," "sign a Lambda deployment package," or "make sure a Lambda function's secrets aren't baked into its zip."
/complete-devsecops-pipeline-for-vm-based-workloads-from-scratchBuilds the complete security-gate sequence for a VM-based DevSecOps pipeline from scratch — SAST, SCA, golden-image scanning and CIS benchmark hardening baked into the machine image itself, config- management-applied secrets via Ansible Vault (never plaintext), and an ongoing patch/drift-detection gate that runs independently of any single deploy, distinct from the per-deploy scanning in the Kubernetes and serverless variants. Use when the user asks to "build a DevSecOps pipeline for EC2/VM workloads from scratch," "harden a golden AMI to CIS benchmarks in the pipeline," "apply secrets with Ansible Vault instead of plaintext," or "add ongoing patch/drift detection for a VM fleet."
/container-image-hardeningGuides building minimal, non-root, hardened container images — multi-stage builds, distroless/minimal base images, non-root users, read-only root filesystems, dropped Linux capabilities, and pinned/ digest-referenced base images. Use when the user asks to "harden this Dockerfile", "reduce container image attack surface/size", "make our container run as non-root", "switch to a distroless base image", "fix a container security scan finding about running as root or having a shell", or "set Kubernetes securityContext restrictions for a pod".
/critical-vulnerability-emergency-responseGuides the accelerated, out-of-band response when a critical CVE is publicly disclosed in a widely-used dependency, library, or platform component — rapid exposure assessment across the fleet, patch or temporary mitigation, verification, and closeout. Use when the user says "a critical CVE just dropped in X", "we need to check if we're affected by CVE-YYYY-NNNNN", "log4shell-style emergency patching", "zero-day just disclosed in our dependency", or "run an emergency vulnerability response". Distinct from the steady-state finding-queue management in security-finding-backlog-triage — this is the fire-drill process for one urgent, time-critical disclosure.
Other plugins' skills for the same job