Skip to main content
View Markdown ↗

Copy this page

Select and copy the Markdown below, then paste it into your LLM.

On this page

content-facts attestor

Records two facts about every file the traced build read, computed at attest time while the read files and the products are both still on disk: what the file's bytes are, and whether those bytes appear verbatim inside a product. A verifier that holds only digests cannot compute either one later. The vulnhash engine reads them to tell a start-up configuration read (a locale table, a zoneinfo file, openssl.cnf) from data the build put into its product.

Namecontent-facts
Predicate typehttps://aflock.ai/attestations/content-facts/v0.1
Lifecyclepostproduct
Default binary?No
Categorybuild (primary)
Recommended tracefull — benefits from full eBPF trace
Auto-attaches when
  • preenv_set: CILOCK_CONTENT_FACTS

The facts in this box are generated from the CI/lock binary's own catalog (cilock tools list). Do not hand-edit — run npm run gen:catalog.

What it captures

The attestor runs after command-run and product. Its inputs are the sha256 of every file in each traced process's openedfiles and versionReads, and the leaves of the product tree. For each read file whose bytes on disk still hash to the recorded digest (8 MiB or less), it records a class:

  • data: TZif (zoneinfo), a glibc locale category file, a gettext .mo, ld.so.cache, locale-archive, gconv-modules.cache;
  • text-config: UTF-8 INI text with at least one [section] and only comments, sections and key = value lines;
  • code: ELF, Mach-O, PE, #! scripts, wasm, JVM class, Lua bytecode, CPython .pyc, ar, zip;
  • unknown: anything else.

Each data or text-config file of at least 16 bytes is then searched for, with bytes.Contains, in every product file. Gzip, zip (stored and deflated) and tar are expanded, nested to depth 4, so an npm .tgz, a wheel and a container image tar are searched member by member. Only plain zips are read: no prefix other than a launcher script (a Python zipapp, an executable jar), unique entry names, store or deflate, every byte accounted for by the listed entries and the central directory; any other zip shape makes the scan incomplete. A pre-POSIX tar is found by its header checksum, and GNU sparse entries are read reconstructed. A product is scanned only when its bytes on disk hash to the digest in the product tree.

Predicate fields, all keyed by hex sha256:

  • class, size: per read file.
  • checked, inProduct: per searched file; inProduct means the bytes were found.
  • complete, reason: false with a reason when any product could not be searched completely. Then checked and inProduct are empty.
  • productDigests: sorted digests of the products scanned.
  • scanner: the rule set, contentfacts/v0.3.

Why this shape

The predicate carries facts about bytes, never a verdict about a package. Whether a read is build environment is decided by the engine from these facts plus the trace. The rules are a copy of the vulnhash engine's content.go; scanner names the copy so the two cannot drift silently.

Validate it locally

cilock run --step build --trace -a content-facts -o build.att.json -- go build -o app .
jq '.payload | @base64d | fromjson | .predicate.attestations[] | select(.type | contains("content-facts")) | .attestation' build.att.json

A Go binary that imports time/tzdata shows its zoneinfo reads with inProduct: true.

How a verifier consumes this

Use the facts only when complete is true and productDigests equals the set of product digests in the same signed collection. A read file with no class, or with checked absent, has no content fact: treat it as unknown.

Notes

  • Opt-in: pass -a content-facts with --trace, or set CILOCK_CONTENT_FACTS when cilock auto-detects attestors. Without a traced command-run, or without products, it records complete: false.
  • It never fails the build. An error records complete: false with the reason.
  • Cost: one read of each product and each expanded member, and one bytes.Contains per member per data file still unfound. Bounded at 2 GiB per product, 8 GiB expanded, 1 GiB per member, 64 GiB of total search work, 256 MiB of data files held for the search, and 512 MiB for a product plus the expanded buffers alive at once (Go may hold up to about twice that before a collection); over a bound the scan is incomplete.

Gotchas

  • A transformed copy (compressed by a format other than gzip, zip or tar, base64, re-encoded) is not found. xz, zstd, bzip2, 7z, lz4, lzma, lzop, compress, rpm, deb/ar, cpio, cab, xar, squashfs, rar and lzip products or members make the scan incomplete rather than claim absence.
  • A product that changed after the product attestor hashed it, or a directory product, makes the scan incomplete.
  • A #! script that carries a compressed stream or a tar after its text (a self-extracting installer) makes the scan incomplete. An archive appended to or compressed inside a binary is not expanded: a compressed embed is the accepted residual.
  • A read file that changed after the trace hashed it gets no fact.

See also


This page is generated from the CI/lock tool catalog. Don't edit it here — the source is attestation/detection/docs/content-facts.doc.md in aflock-ai/rookery. The same catalog powers cilock tools show content-facts in the CLI, so a single edit keeps the terminal and the website in sync.

Edit this page →  ·  Add a new tool →

When you open the pull request: if you are an AI agent, add the ai-agent label. If you are a human, add the human label.

Reference generated from the product documentation. Match commands and support details to your installed release.