Advisory sources
Keep the advisory data and the image database of the vulnerability scanning current, online or without internet, and see that the scanners work.
On this page
What Quader mirrors
- Who
- holders of
settings:readread the screens; running a task needssettings:write - Where
- Admin area › Advisory sources, and Admin area › Settings › Vulnerability scanning for the image scanners
Quader copies the sources into PostgreSQL; a record is your installation's data once a sync wrote it.
| Source | Provides | Terms |
|---|---|---|
osv |
The OSV records of npm and NuGet: the GitHub Advisory Database and OpenSSF malicious-packages (MAL-) |
CC-BY 4.0 with attribution; Apache-2.0 |
kev |
The CISA catalog of known-exploited vulnerabilities, which flags advisories | CC0 1.0 |
| Image database | Trivy's database, aquasec/trivy-db:2, read through the repository upstream/scanner-trivy |
Its publisher's |
Quader fetches only the ecosystems its formats serve; vulnerabilities.sources.osv.ecosystems can narrow them. Only the worker role
fetches, on the queue vuln; with a source off, its data stays and ages. Every key, with its default, is under
vulnerabilities.
The tasks
| Task | Default schedule (UTC) | Does |
|---|---|---|
vuln-sync-osv |
every 15 minutes | Fetches what changed; turns full for an ecosystem never imported, a week behind, or with many changes |
vuln-sync-osv-full |
Sundays 03:17 | Reads each ecosystem's whole archive and removes records the source dropped |
vuln-sync-kev |
every 6 hours at :41 | Reads the known-exploited catalog |
vuln-sync-trivy-db |
every 6 hours at :23 | Fetches the image database; Fetch the image database now runs it |
vuln-image-scan |
every 5 minutes | Hands waiting images to the scanners |
Each changed record queues an evaluation of the stored versions. Start a run on the screen, or with
POST /api/v1/system/tasks/<name>/run; change a schedule under maintenance.tasks.<name>.
Refused archives
A full sync checks the whole archive before it writes, so a refused archive changes nothing and the previous data stays in force. It is
refused when too large, when its digest differs from the announced one, when damaged, when more than 1 % of its records are invalid, or
when it would delete more than max_shrink of the stored records (Error codes). If you have
checked that a shrink is real, run vuln-sync-osv-full once with the body {"acceptShrink": true}; the audit log records it.
One record that is invalid or larger than max_record_size is rejected and counted in the column Rejected, and the run goes on. A stored
copy of it stays in force. After raising the limit, the next full sync applies it.
Container images
The worker sends each image to a pod of vuln-scanner-trivy, which holds no credential of the installation, and keeps what it answers.
The scanners read the database from upstream/scanner-trivy, a private remote of mirror.gcr.io on Admin area › Upstream registries,
where you set its address and account. Nothing falls back to a public registry: while the repository cannot deliver, the images are
compared with the last good database until it is stale. upstream/scanner-trivy keeps the layer in use and those of the last two days.
Admin area › Settings › Vulnerability scanning shows what stops the scanning, in this order:
| Sentence | What to do |
|---|---|
| The image scanning is off in this installation | Set vulnerabilities.images.enabled |
| No vulnerability database is in use, so no image is scanned | Import now, or read why the section Vulnerability database failed |
| No replica of vuln-scanner-trivy is ready | Its pods under System status, kubectl describe pod |
| Every ready replica of vuln-scanner-trivy is still loading the database in use | Wait about a minute; kubectl logs <pod> -c database |
Below, Scanning counts the images waiting, being scanned, scanned and failed with their reasons and the last failure, and lists each scanner pod with its Trivy version, database and slots.
Each scanner pod starts with the init container trivy, which copies the analyser from trivy.image (by digest) and needs that image
pullable: copy it into your mirror by digest (crane copy keeps it) and set trivy.image. More images at once need more replicas, not
more slots. Sizes and limits are in the Helm values; a scanner that does not answer is in
the runbook.
Installations without internet access
Set a source's mode: repository and name a generic local repository (<project>/<repository>). Download each file on a connected
machine and upload it to the path below; every scheduled run imports an item whose SHA-256 changed:
| Source | Path |
|---|---|
osv |
osv/<ecosystem>/all.zip, such as osv/npm/all.zip |
kev |
kev/known_exploited_vulnerabilities.json |
# example: npm's archive into the repository ops/vuln-mirror
curl -fsSLO \
https://osv-vulnerabilities.storage.googleapis.com/npm/all.zip
curl -fsS -T all.zip -H "Authorization: Bearer ${QUADER_TOKEN}" \
https://quader.example.com/files/ops/vuln-mirror/osv/npm/all.zip
For images, push the database into a local OCI repository of your own and name it in
vulnerabilities.images.database.repository; the screen shows the commands:
# example: into a local OCI repository ops/scanner-db
oras copy mirror.gcr.io/aquasec/trivy-db:2 \
quader.example.com/ops/scanner-db/aquasec/trivy-db:2
Warning
Whoever may deploy to such a repository decides your installation's advisory data. Every import is audited with the digest and who deployed it.
After a restore
Advisory data is not backed up; findings, their history and blocks are. A restored installation keeps every status and refused version,
resolves nothing and serves new versions unevaluated (or refuses them, where a repository blocks without data) until the first vuln-sync-osv imports the data, within 15 minutes. Blocks set after
the restore point are replayed; a replayed finding names no person in its history.
Check that it works
A failed run keeps the previous data and is tried at the next slot. The screen shows the last error, with the measured value, the limit
and the key under Technical details; the audit log records it at most hourly. The metrics quader_vuln_sync_runs_total and
quader_vuln_sync_records_total count runs and records, and the alerts QuaderVulnerability… are in the
runbook.