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)
| Factor | Value | Points |
|---|---|---|
| Base severity | critical | 85 |
| high | 65 | |
| medium | 45 | |
| low | 20 | |
| Exposure: who can reach the resource | public (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 do | admin (*:* or equivalent) | +10 |
| privileged (can modify IAM or escalate) | +5 | |
| standard | 0 | |
| 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
| Finding | Severity | Exposure | Privilege | Credential | Score |
|---|---|---|---|---|---|
Role trusts Principal: "*" and has admin | critical | public | admin | — | 100 (110, clamped) |
| Root user has no MFA | critical | internal | admin | — | 95 |
| Cross-account trust without ExternalId, external account, privileged role | high | external | privileged | — | 80 |
| Access key 400 days old, last used 200 days ago | medium | internal | standard | 400 / 200 days | 53 |
| Unused role with read-only permissions | low | internal | limited | — | 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 scores | Account score |
|---|---|
| none | 0 |
| 100 | 100 |
| 95 | 86 |
| 50 | 13 |
| 25 × 10 | 15 |
| 85, 65 | 72 |
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:
| Score | Band |
|---|---|
| 75–100 | critical |
| 50–74 | high |
| 25–49 | medium |
| 0–24 | low |
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.