Skip to content

feat(security): F0.5 golden records — microVM capture, scrub, normalize, diff - #319

Merged
randomizedcoder merged 1 commit into
mainfrom
sec/f05-golden-records
Nov 24, 2026
Merged

randomizedcoder merged 1 commit into
mainfrom
sec/f05-golden-records

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner
  • pkg/goldenrec: every ParquetRow column in exactly one class; Normalize, Scrub (Normalize-invariant) and Diff with a column filter, reused by FP-9 and FP-12.
  • cmd/xtcp2-golden: scrub, normalize, diff (exit 1 on differences, 50-line cap) and check.
  • s3parquet-golden microVM flavor + nix run .#capture-golden-records: production binary, 3 Docker containers, a named netns; keeps the second poll (the first can miss a namespace still opening).
  • Metrics over a unix listener, so the harness adds no host TCP sockets to the capture.
  • Fixture pkg/xtcp/testdata/golden/7_3_1 (23 rows, scrubbed); two independent captures normalize byte-identical.
  • checks.golden-records: JSONL matches the Parquet, scrub clean, manifest row count and schema match; a hand-edited JSONL fails naming the field.
  • Golden rows seed FuzzRowFromProto; protoFromRow round-trip test.
  • Tests are table-driven with positive, negative, boundary and corner rows, each with a description and expected outcome.
  • Finding: xtcp2 dumps AF_INET only, so dual-stack listeners and their accepted sockets go unrecorded (4 rows per container); F2 TODO added.
  • Finding: nsid 0 means both "no nsid" and the kernel's first id; made volatile, F2 TODO added.
  • Checked: go test ./..., gofmt, go-vet, nix-fmt, lint-baseline, the three golangci tiers, redteam-lint, golden-records, test-fuzz-all.

🤖 Generated with Claude Code

…ze, diff

- pkg/goldenrec: every ParquetRow column in exactly one class (strict,
  presence, ordinal, address, port, volatile, host); Normalize, Scrub
  (Normalize-invariant) and Diff with a column filter, for FP-9 and FP-12.
- cmd/xtcp2-golden: scrub, normalize, diff and check.
- s3parquet-golden microVM flavor and nix run .#capture-golden-records:
  the production binary, 3 Docker containers, a named netns; keeps the
  second poll; metrics over a unix listener so no host TCP is recorded.
- Fixture pkg/xtcp/testdata/golden/7_3_1 (23 rows, scrubbed); two
  independent captures normalize byte-identical.
- checks.golden-records: the JSONL matches the Parquet, the scrub is
  clean, the manifest row count and the schema match.
- Golden rows seed FuzzRowFromProto; protoFromRow round-trip test.
- Plan doc: F0.5 done; F2 TODOs for AF_INET6 collection and the
  ambiguous nsid 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@randomizedcoder
randomizedcoder merged commit d50e0a7 into main Nov 24, 2026
1 check passed
@randomizedcoder
randomizedcoder deleted the sec/f05-golden-records branch November 24, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant