# Wiz reports, `.reviewed-cves`, and the dev wizard's Vulnerability Checker

Wiz is the security office's cloud scanner. It scans our deployed container images (and
Lambda functions) and exports findings as CSV. dce-dev-wizard already understands that CSV
(`src/types/WizCSVRow.ts`, `src/screens/reviewCVEs.ts`); AvoSecurity's `wiz-merge.mjs` uses the
same column names, so one export serves both tools.

## Columns (exactly as exported)

`ID, WizURL, Name, CVSSSeverity, HasExploit, HasCisaKevExploit, FindingStatus, Score, Severity,
VendorSeverity, NvdSeverity, FirstDetected, LastDetected, ResolvedAt, ResolutionReason,
Remediation, LocationPath, DetailedName, Version, FixedVersion, DetectionMethod, Link, Projects,
AssetID, AssetName, AssetRegion, ProviderUniqueId, CloudProviderURL, CloudPlatform, Status,
SubscriptionExternalId, SubscriptionId, SubscriptionName, Tags, ExecutionControllers,
ExecutionControllersSubscriptionExternalIds, ExecutionControllersSubscriptionNames,
ExecutionControllersKubernetesClusterNames, CriticalRelatedIssuesCount, HighRelatedIssuesCount,
MediumRelatedIssuesCount, LowRelatedIssuesCount, InfoRelatedIssuesCount, ImageId`

The ones that matter:

| Column | Meaning | Used for |
| --- | --- | --- |
| `Name` | the CVE id | the finding's identity; goes in `.reviewed-cves` titles |
| `DetailedName`, `Version`, `FixedVersion` | package, installed version, first fixed version | joining to the npm audit row; the target version |
| `LocationPath` | path inside the image (`/app/client/node_modules/qs/package.json`) | mapping to a lockfile folder, or to the base image |
| `Severity` (Critical/High/Medium/Low), `Score` (CVSS), `NvdSeverity`, `VendorSeverity` | severities from three sources | prioritize by the highest; record disagreements |
| `HasExploit`, `HasCisaKevExploit` | known exploit / on CISA's KEV list | these go first, whatever the severity says |
| `FindingStatus` / `Status`, `FirstDetected`, `LastDetected`, `ResolvedAt`, `ResolutionReason` | lifecycle | "Resolved" rows are history, not work; `FirstDetected` tells you how long it has been open |
| `Remediation`, `Link` | Wiz's suggested fix; the advisory URL (GitHub GHSA for npm packages) | research |
| `AssetName`, `ImageId`, `Projects`, `Tags`, `SubscriptionName` | which image / account the row belongs to | filtering one export to one app (`--asset`) |
| `ID`, `WizURL` | Wiz's finding id and deep link | closing the loop: these go in the SecurityUpdates entry |

Separators vary by export (`,`, `;`, tab); the parser guesses from the header line. Quoted
fields may contain commas and newlines (Remediation often does).

## Path → location mapping

Our Dockerfiles `COPY ./ /app`, so `/app/<folder>/node_modules/...` belongs to the lockfile
folder `<folder>` (`/app/node_modules/...` is the root lockfile). For Cryo the build context
is `./app`, so `/app/...` *is* the `app` folder; `wiz-merge` uses the inventory's Docker
context to get this right. Paths under `/usr`, `/lib`, `/bin`, `/etc`, `/opt`, or apk
packages (`openssl`, `busybox`, `zlib`, ...) are **base image**; `/usr/local/bin/node` and
`/usr/local/lib/node_modules/npm` are the Node runtime. Those are fixed by rebuilding on a
refreshed `node:24-alpine`, never by npm.

## Reading `wiz.md`

- **Matched**: Wiz and `npm audit` agree a package is vulnerable in that location. Work it on
  the ladder; the Wiz id rides along into the SecurityUpdates entry. `VERSION DIFFERS` means
  the scanned image was built from a different lockfile than the one you hold (stale image or
  un-deployed branch): say so in the entry.
- **In Wiz but not in npm audit**: a different advisory feed, a newer scan than the npm
  database, or a package that the lockfile no longer has. Research each; do not dismiss.
- **In npm audit but not in Wiz**: usually dev tooling that is not in the image, or findings
  newer than the last scan. Still in scope for the npm side.
- **Base image**: rebuild. Check the base image tag the pull-through cache serves and whether
  the Node major is still the current even LTS (the wizard's Node check does this).

## `.reviewed-cves`

A file in the project root that records CVEs the team has reviewed and accepted. Two shapes
exist in our repos today, and `wiz-merge` reads both:

1. **Ignore-list lines** (Gather's committed template; the shape scanners consume, same as a
   Trivy ignore file): one id per line, optional expiry, optional comment. An uncommented id
   is an active ignore until its `exp:` date passes; a line starting with `#` is inert.

   ```
   # NOTE: always include comments explaining why something is being ignored
   CVE-2025-0005 exp:2026-12-31 # build-time only (vite devDependency); not in the shipped bundle
   ```

2. **Vulnerability Checker notes** (what dce-dev-wizard's `reviewCVEs` screen appends after
   you mark a finding "Reviewed (Not a problem)"): two comment lines, title then note. Because
   both lines start with `#`, a scanner reading shape 1 treats them as comments, so they
   document a decision without enforcing it.

   ```
   # <advisory title>
   # Note: <why it can be ignored>
   ```

AvoSecurity writes shape 2 (Gabe's call: one format, the one the wizard writes), with the
CVE id at the front of the title line so the match is exact and the revisit date in the
note:

```
# CVE-2025-0005 — left-pad padding overflow (GHSA-aaaa-bbbb-cccc)
# Note: build-time only (vite devDependency); not in the shipped bundle; revisit 2026-12-31
```

The same ids go in the SecurityUpdates entry's accepted-risk table. In `wiz.md`, a Wiz row
whose CVE (or the GHSA id from its link) appears in the file is flagged `reviewed (note
only)`; if a repo still carries shape-1 lines they show as `ignored until <date>` or
`reviewed (ignore EXPIRED)`. A reviewed finding is not re-litigated, but confirm in one
sentence that the original reason still holds (same exposure, same usage). Commit the file
with the security PR; it is part of the record. Never put secrets or internal hostnames in it.
