Skip to content
Calcrivo

Infrastructure as Code Risk Calculator

Score infrastructure-as-code risk from scan coverage, weighted template findings, hardcoded secrets, configuration drift and pre-merge gating.

Inputs

templates
templates
findings
findings
findings
findings
templates
resources
resources
%

IaC Risk Score

82.9/ 100

Risk Level

Critical

Template Scan Coverage

85.7%

Severity-Weighted Findings

820points

Weighted Findings per 100 Templates

195.2

Raw Findings per Scanned Template

1.20

Configuration Drift Rate

2.29%

Templates Not Scanned

60templates

Highest-Value Fix

Strip the hardcoded credentials and rotate them — they are in git history now, whatever the template says today

Step by step

  1. Values used

    IaC templates or modules = 420 templates; Templates covered by IaC scanning = 360 templates; Critical IaC findings = 14 findings; High IaC findings = 58 findings; Medium IaC findings = 140 findings; Low IaC findings = 220 findings; Templates with a hardcoded credential = 7 templates; Resources drifted from code = 96 resources; Resources managed by IaC = 4,200 resources; Changes gated by a pre-merge scan = 65 %

  2. Infrastructure as Code Risk

    Risk = min(50, 0.25 × weighted findings per 100 templates) + 0.3 × uncovered percentage + min(15, 2 × drift rate) + min(20, 3 × templates with secrets) + 0.15 × ungated percentage.

  3. Finding density

    Weighted findings per 100 templates normalises finding load by codebase size, so a growing module library does not automatically look worse.

  4. IaC Risk Score

    = 82.9 / 100

  5. Risk Level

    = Critical

  6. Template Scan Coverage

    = 85.7

  7. Severity-Weighted Findings

    = 820 points

  8. Weighted Findings per 100 Templates

    = 195.2

  9. Raw Findings per Scanned Template

    = 1.20

How it works

IaC risk is scored on where the finding is caught rather than only on how many there are: a critical finding blocked on a pull request costs a review comment, while the same finding found after apply is a live misconfiguration. Hardcoded secrets carry a disproportionate 3 points each because the template is only the visible copy — the real one is in git history forever. One template is applied hundreds of times, so a single insecure default in a shared module is a fleet-wide misconfiguration, and it is far cheaper to fix in the module than in four hundred deployed resources.

Formulas

Infrastructure as Code Risk

Risk = min(50, 0.25 × weighted findings per 100 templates) + 0.3 × uncovered percentage + min(15, 2 × drift rate) + min(20, 3 × templates with secrets) + 0.15 × ungated percentage.

weightedFindings
Critical × 10 + high × 5 + medium × 2 + low × 0.5
scanCoverage
Scanned templates ÷ all templates × 100
driftRate
Drifted resources ÷ IaC-managed resources × 100

Finding density

Weighted findings per 100 templates normalises finding load by codebase size, so a growing module library does not automatically look worse.

findingsPer100Templates
Weighted findings ÷ templates × 100
findingsPerTemplate
Raw finding count per scanned template

Frequently Asked Questions

How is Infrastructure as Code Risk calculated?

Risk = min(50, 0.25 × weighted findings per 100 templates) + 0.3 × uncovered percentage + min(15, 2 × drift rate) + min(20, 3 × templates with secrets) + 0.15 × ungated percentage. IaC risk is scored on where the finding is caught rather than only on how many there are: a critical finding blocked on a pull request costs a review comment, while the same finding found after apply is a live misconfiguration. Hardcoded secrets carry a disproportionate 3 points each because the template is only the visible copy — the real one is in git history forever.

Why does Infrastructure as Code Risk matter?

One template is applied hundreds of times, so a single insecure default in a shared module is a fleet-wide misconfiguration, and it is far cheaper to fix in the module than in four hundred deployed resources.

What values do I need to enter?

This calculator takes 10 inputs: IaC templates or modules, Templates covered by IaC scanning, Critical IaC findings, High IaC findings, Medium IaC findings, Low IaC findings, Templates with a hardcoded credential, Resources drifted from code, Resources managed by IaC, Changes gated by a pre-merge scan. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

Does IaC scanning replace runtime posture management?

No — they catch different things. IaC scanning finds what the code says before it exists; CSPM finds what the cloud actually contains, including everything created by hand, by another team, or by a resource the code does not own. Drift rate is the number that tells you how far apart those two views have grown.

Where should the gate live?

On the pull request, failing the check. A scan that runs after apply and files a ticket has already let the misconfiguration into the account, and the fix now needs a change window rather than a commit. Reserve the post-apply scan for drift detection, which is genuinely a different job.

You might also need