{
  "$schema": "https://ce.rodeo/schema/rubric.v1.json",
  "version": "cerodeo-v2",
  "effective_from": "2026-10-26T00:00:00Z",
  "deprecated_at": null,
  "supersedes": "cerodeo-v1",
  "summary": "v2 adds severe-exposure caps and a small medium_unfixable penalty. The 100-point base, penalty/bonus signals, and grade bands stay unchanged; after the normal clamp, three caps lower the ceiling when the image carries real exposure (any open critical → C, 10+ open highs → D, 100+ open mediums → C).",
  "formula": "s0 = max(0, min(100, 100 + sum(penalties) + sum(bonuses))); s1 = apply_caps(s0); grade = band(s1)",
  "grade_bands": [
    {"grade": "A", "min_score": 85},
    {"grade": "B", "min_score": 70},
    {"grade": "C", "min_score": 55},
    {"grade": "D", "min_score": 40},
    {"grade": "F", "min_score": 0}
  ],
  "penalties": [
    {
      "id": "critical_fixable",
      "per_occurrence": -25,
      "input": "Count of grype_matches where canonicalSeverity='Critical' AND vulnerability.fix.state='fixed'",
      "data_source": "grype sbom:<sbom.json>"
    },
    {
      "id": "high_fixable",
      "per_occurrence": -10,
      "input": "Count of grype_matches where canonicalSeverity='High' AND vulnerability.fix.state='fixed'",
      "data_source": "grype sbom:<sbom.json>"
    },
    {
      "id": "medium_fixable",
      "per_occurrence": -3,
      "input": "Count of grype_matches where canonicalSeverity='Medium' AND vulnerability.fix.state='fixed'",
      "data_source": "grype sbom:<sbom.json>"
    },
    {
      "id": "critical_unfixable",
      "per_occurrence": -8,
      "input": "Count of grype_matches where canonicalSeverity='Critical' AND vulnerability.fix.state!='fixed'",
      "data_source": "grype sbom:<sbom.json>"
    },
    {
      "id": "high_unfixable",
      "per_occurrence": -3,
      "input": "Count of grype_matches where canonicalSeverity='High' AND vulnerability.fix.state!='fixed'",
      "data_source": "grype sbom:<sbom.json>"
    },
    {
      "id": "medium_unfixable",
      "per_occurrence": -1,
      "input": "Count of grype_matches where canonicalSeverity='Medium' AND vulnerability.fix.state!='fixed'. New in v2 — v1 let a 134-medium image ride every bonus to A.",
      "data_source": "grype sbom:<sbom.json>"
    }
  ],
  "caps": [
    {
      "id": "cap_any_critical",
      "ceiling": 69,
      "when": "canonicalSeverity='Critical' count >= 1 AND score > 69",
      "note": "An image with any open critical CVE cannot land above C/69."
    },
    {
      "id": "cap_ten_plus_high",
      "ceiling": 54,
      "when": "canonicalSeverity='High' count >= 10 AND score > 54",
      "note": "A wall of highs caps at D/54."
    },
    {
      "id": "cap_hundred_plus_medium",
      "ceiling": 69,
      "when": "canonicalSeverity='Medium' count >= 100 AND score > 69",
      "note": "A flood of mediums caps at C/69."
    }
  ],
  "canonical_severity": {
    "note": "v2 rebuckets severity by CVSS v3 base score (NVD thresholds) when available: Critical >= 9.0, High >= 7.0, Medium >= 4.0, Low < 4.0. Falls back to the grype-provided per-source severity when the match has no CVSS v3 record. Fixes the 2026-10-21-flagged inconsistency where Ubuntu Security Tracker's and NVD's bands produced different penalties for the same CVE.",
    "tool": "canonicalSeverity() in packages/scanner/src/rubric.ts"
  },
  "bonuses": [
    {
      "id": "non_root_default",
      "value": 10,
      "input": "manifest.config.User is set and not one of ['', 'root', '0', '0:*']",
      "data_source": "skopeo inspect --config"
    },
    {
      "id": "rebuilt_lt_90d",
      "value": 10,
      "input": "image was first seen on ce.rodeo within the last 90 days (uses first_seen_at_cerodeo, not config.Created — reproducible-build publishers who pin Created to a source-commit date would otherwise look stale)",
      "data_source": "images.first_seen_at_cerodeo"
    },
    {
      "id": "cosign_signed",
      "value": 5,
      "input": "cosign triangulate succeeds AND skopeo can resolve the resulting signature tag",
      "data_source": "cosign triangulate; skopeo inspect"
    },
    {
      "id": "slsa_provenance_attached",
      "value": 5,
      "input": "cosign download attestation --predicate-type=https://slsa.dev/provenance/v1 returns a DSSE envelope",
      "data_source": "cosign download attestation"
    },
    {
      "id": "sha256_subject_matches_manifest",
      "value": 5,
      "input": "The SLSA provenance's subject[].digest.sha256 equals the image's manifest digest",
      "data_source": "parsed from the SLSA attestation above"
    },
    {
      "id": "healthcheck_defined",
      "value": 3,
      "input": "manifest.config.Healthcheck is non-empty",
      "data_source": "skopeo inspect --config"
    },
    {
      "id": "oci_standard_labels",
      "value": 3,
      "input": "manifest.config.Labels contains >= 4 of {org.opencontainers.image.title, .description, .source, .version, .revision}",
      "data_source": "skopeo inspect --config"
    },
    {
      "id": "multi_arch",
      "value": 3,
      "value_2_arch": 2,
      "input": "manifest list contains >= 3 distinct architectures (+3). If exactly 2, award +2 instead.",
      "data_source": "skopeo inspect --raw"
    },
    {
      "id": "upstream_github_release",
      "value": 3,
      "input": "If projects.upstream_url is set: GET api.github.com/repos/<owner>/<repo>/releases/tags/<tag> returns 200",
      "data_source": "GitHub API"
    },
    {
      "id": "sbom_attested",
      "value": 3,
      "input": "cosign download attestation --predicate-type=https://spdx.dev/Document returns a DSSE envelope",
      "data_source": "cosign download attestation"
    },
    {
      "id": "readme_has_example",
      "value": 2,
      "input": "Docker Hub /v2/repositories/<ns>/<repo> full_description matches /docker (run|pull|compose)/ (case-insensitive) OR contains a fenced code block mentioning the image ref",
      "data_source": "hub.docker.com/v2/repositories API"
    }
  ],
  "inputs": {
    "sbom_tool": "syft",
    "sbom_command": "syft <image_ref> -o syft-json",
    "vulnerability_tool": "grype",
    "vulnerability_command": "grype sbom:<sbom.json> -o json",
    "vulnerability_db_sources": [
      "GitHub Security Advisories (GHSA)",
      "NIST National Vulnerability Database (NVD)",
      "Red Hat Security Data",
      "Debian Security Tracker",
      "Ubuntu CVE Tracker",
      "Alpine secdb",
      "PyPA advisory DB",
      "npm advisory DB"
    ],
    "manifest_tool": "skopeo",
    "manifest_commands": [
      "skopeo inspect docker://<image_ref>",
      "skopeo inspect --raw docker://<image_ref>",
      "skopeo inspect --config docker://<image_ref>"
    ],
    "signature_tool": "cosign",
    "signature_commands": [
      "cosign triangulate --type signature <image_ref>",
      "cosign download attestation --predicate-type=https://slsa.dev/provenance/v1 <image_ref>",
      "cosign download attestation --predicate-type=https://spdx.dev/Document <image_ref>"
    ]
  },
  "reproducibility": {
    "required_pins_for_bit_identical": [
      "image manifest digest (ensures SBOM is identical)",
      "grype DB version (ensures CVE matching produces identical results)"
    ],
    "verify_script": "https://ce.rodeo/verify-score.sh",
    "notes": "Running the verify-score.sh script with the same (image_digest, grype_db_version) pair should produce a bit-identical score. If grype_db_version has moved on, CVE counts can drift; use the --grype-db flag to pin to the version recorded on the snapshot you want to reproduce."
  },
  "changelog": [
    {
      "version": "cerodeo-v2",
      "shipped": "2026-10-26",
      "notes": "Added medium_unfixable penalty (-1 per) and three severe-exposure caps (cap_any_critical=69, cap_ten_plus_high=54, cap_hundred_plus_medium=69). Rebucketed severity by CVSS v3 base score when available. Per the 2026-10-21 governance pass — v1 let an image with 1 critical, 9 highs, or 134 mediums still read as A."
    },
    {
      "version": "cerodeo-v1",
      "shipped": "2026-10-06",
      "notes": "Initial published rubric. 5 penalty tiers, 11 bonus signals, grade bands at 85/70/55/40/0."
    }
  ]
}
