All tutorials
You are reading the tutorials for Cordon 0.4 (0.4.1). Read this for 0.7, the current release.

Reachability, cut noise without hiding anything

Cordon 0.4.14 sections · 2 diagramsView this tutorial on GitHub

The loudest complaint about scanners: a CVE in a package three levels down that your code never touches, screaming at the same volume as one you call constantly.

   cordon-scanner scan . --reachability
Reachability, cut noise without hiding anything, figure 1
                    ANNOTATE, NEVER SUPPRESS
   ┌─────────────────────────────────────────────────────────────┐
   │  An unreached finding is LOWERED and TAGGED — never dropped.│
   │  Gate on "reached only" if you want; the rest stay in the   │
   │  report where a reviewer can still see them.                │
   └─────────────────────────────────────────────────────────────┘
Reachability, cut noise without hiding anything, figure 2
   vulnerable dependency
          │
          ▼
   does first-party code import it?
          │
   ┌──────┴───────┐
   YES            NO
   │              │
   │        is it a DIRECT dependency?
   │          │            │
   │        YES            NO (transitive)
   │          │            │
   ▼          ▼            ▼
 IMPORTED   UNKNOWN     NOT_IMPORTED
 (severity  (severity   (severity LOWERED
  kept)      kept)       one step + tagged)
   UNKNOWN ≠ UNREACHED   ───────────────────   A direct dep you don't see imported may be loaded dynamically, or under a name   the distribution doesn't publish (beautifulsoup4 → bs4). Import-checking can't   rule that out, so it stays UNKNOWN and its severity does NOT move.   MALWARE never moves   ───────────────────   A compromised release must not be installed whether or not it is called.   Reachability only ever lowers a VULNERABILITY, never a malicious package.
   BEFORE                                  AFTER  --reachability   ──────                                  ──────────────────────   HIGH   CVE in leftpad (transitive)  ──▶ MEDIUM  CVE in leftpad                                              "…not imported by first-party code,                                               lowered rather than dropped"   HIGH   CVE in requests (you import) ──▶ HIGH    CVE in requests                                              "…imported by first-party code"

This is the cheap, always-available import tier. The precise call-graph tier, is the vulnerable symbol on a path you actually reach, builds on the AST providers (tutorial 13) and is a later layer.

Next: 05 · Provenance & attestation.