Docs / Risk scoring

Risk scoring

The exact, deterministic formulas behind AccessLens risk scores: per finding, per account and overall, with worked examples and severity bands.

Updated

AccessLens computes three scores from 0 to 100: one per finding, one per account, and a global score. Higher means riskier. The formulas are deterministic: the same findings always produce the same scores. Table-driven unit tests in the app pin every number on this page.

Finding score

score = clamp(0, 100, base(severity) + exposure + privilege + credential)
FactorValuePoints
Base severitycritical85
high65
medium45
low20
Exposure: who can reach the resourcepublic (anyone on the internet or any AWS account)+15
cross-account, outside your organization+10
cross-account, inside your organization+3
internal (this account only)0
Privilege: what the affected principal or resource can doadmin (*:* or equivalent)+10
privileged (can modify IAM or escalate)+5
standard0
limited (read-only or empty)−5
Credential age and usage (only for findings about a credential)age ≥ 365 days+5
age ≥ 90 days+2
dormant: unused for ≥ 90 days, or never used and ≥ 90 days old+3

Analyzers set severity per rule (see the rule catalogue). They raise or lower it only when the evidence warrants, for example a cross-account trust on an admin role, or a GitHub OIDC trust without a sub condition. Analyzers also set exposure and privilege from what they observe. Privilege comes from the same effective-permission evaluation used for escalation analysis.

Examples

FindingSeverityExposurePrivilegeCredentialScore
Role trusts Principal: "*" and has admincriticalpublicadmin—100 (110, clamped)
Root user has no MFAcriticalinternaladmin—95
Cross-account trust without ExternalId, external account, privileged rolehighexternalprivileged—80
Access key 400 days old, last used 200 days agomediuminternalstandard400 / 200 days53
Unused role with read-only permissionslowinternallimited—15

Account score

An account's score combines its active findings (status open or investigating) with a "noisy-OR" formula. Each finding is weighted by the cube of its score:

p_i     = (score_i / 100)^3
account = round(100 × (1 − Π_i (1 − p_i)))

What this does:

  • One critical finding dominates: a single 95 alone gives an account score of 86.
  • Many low findings add up slowly rather than saturating: ten findings at 25 give 15.
  • The score never goes down when a finding is added, and order doesn't matter.
  • Resolved and false-positive findings don't count, so remediation shows up on the next scan.
Active finding scoresAccount score
none0
100100
9586
5013
25 × 1015
85, 6572

Global score

The global score is the average of the worst account and the mean account. It only counts accounts that have completed at least one scan:

global = round(0.5 × max(account scores) + 0.5 × mean(account scores))

This keeps one very risky account visible, without letting a single outlier hide how the rest of the estate looks. For example, accounts scoring 90, 10, 10 and 10 give a global score of 60.

Bands

The UI colors scores using the same bands as severities:

ScoreBand
75–100critical
50–74high
25–49medium
0–24low

History and trend

After every scan, the account score is stored in risk_history along with the number of active findings. The dashboard sparkline and the Trend report rebuild the global score for each day from the latest score of every account up to that day.