feat(ae): /dx/evidence_manifest ingest → forensic_db.dx_evidence_manifest#78
feat(ae): /dx/evidence_manifest ingest → forensic_db.dx_evidence_manifest#78ConstanzeTU wants to merge 1 commit into
Conversation
…manifest
Closes the AE-side wire gap for dx's §9 completeness contract (stacked on
the dx_evidence_graph rename). dx already POSTs manifests via
aeclient.WriteEvidenceManifest → /dx/evidence_manifest; aeprod26 404s that
path, so manifest_rows_exported=0 / graph_write_failures{kind=manifest}>0.
Adds, mirroring the evidence_graph path:
- control: manifestWriter iface + SetManifestWriter + POST /dx/evidence_manifest
handler. Accepts one manifest.Manifest per verdict; scalars map to typed
columns, nested collections (case_window/findings/orders/seeds/chain) are
rendered as JSON text so the JSONEachRow insert is CH-version independent.
- clickhouse: forensic_db.dx_evidence_manifest table (columns = manifest.Manifest
JSON tags; event_time nanos + hostname read-path like dx_evidence_graph),
WriteEvidenceManifest sink, KnownTables + OperatorOwnedTables (created on boot).
- main: wire SetManifestWriter(applier).
- tests: endpoint 501/202/502 + nested-as-text flattening; table-set guard.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧪 TTL test image for the dx-agentdigest Exactly what's in this AENew endpoint —
New table —
Nested-as-text: the handler pre-renders Engine: Quick verify
A full |
✅ Full release:
|
|
Superseded by #85 — the three PRs (#73/#77/#78) were a linear one-commit-each stack on the pre-squash |
…manifest (folds #77/#78) (#73) * feat(adaptive_export): wire the /query runner — dx OrderQuery → forensic capture (dx#93) The control surface shipped with control.New(activeSet, nil) — '/query runner wired later'. So every dx OrderQuery 501'd and the table dx read for a verdict (e.g. the jndi-in-http) never reached forensic_db unless a kubescape-anomaly window happened to push it. The forensic export steered to noise, not to dx's evidence. Adds Controller.OrderQuery(target, table, window, queryID): a single-shot QueryFor → querier.Query → sink.WritePixieRows (the same path pushPixieRows uses, plus globalSem + reconcile accounting), independent of any anomaly window. Wires control.New(activeSet, ctl) in main.go so POST /query executes it. When the operator-side querier is disabled, OrderQuery errors and /query 502s; start/stop + dx_attack_graph are unaffected. Pairs with entlein/dx#96 which orders the full consulted read-set through this runner. Tests: writes-rows / no-querier-errors / empty-no-write / sink-error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(ae): rename dx_attack_graph → dx_evidence_graph (malignant view) Restacks the dx graph rename onto the #73 /query-runner tip. Renames across the AE forensic path: - table forensic_db.dx_attack_graph → dx_evidence_graph - view dx_attack_graph_malicious → dx_evidence_graph_malignant (medical terminology: malignant, not malicious) - endpoint /dx/attack_graph → /dx/evidence_graph - Go WriteAttackGraph/handleDXAttackGraph → *EvidenceGraph Done mechanically on #73 so it also covers order_query_test.go (absent from the original rename branch's lineage). Also fixes two pre-existing #73 lint nits surfaced by touching the package: gofumpt blank lines in order_query_test.go and the missing order_query_test.go entry in controller/BUILD.bazel's controller_test srcs (gazelle). * feat(ae): add /dx/evidence_manifest ingest → forensic_db.dx_evidence_manifest Closes the AE-side wire gap for dx's §9 completeness contract (stacked on the dx_evidence_graph rename). dx already POSTs manifests via aeclient.WriteEvidenceManifest → /dx/evidence_manifest; aeprod26 404s that path, so manifest_rows_exported=0 / graph_write_failures{kind=manifest}>0. Adds, mirroring the evidence_graph path: - control: manifestWriter iface + SetManifestWriter + POST /dx/evidence_manifest handler. Accepts one manifest.Manifest per verdict; scalars map to typed columns, nested collections (case_window/findings/orders/seeds/chain) are rendered as JSON text so the JSONEachRow insert is CH-version independent. - clickhouse: forensic_db.dx_evidence_manifest table (columns = manifest.Manifest JSON tags; event_time nanos + hostname read-path like dx_evidence_graph), WriteEvidenceManifest sink, KnownTables + OperatorOwnedTables (created on boot). - main: wire SetManifestWriter(applier). - tests: endpoint 501/202/502 + nested-as-text flattening; table-set guard. * lint(#73): fix arc-lint failures + copy.bara cleanup - .arclint: exclude the adaptive_export_loadtest/suite/ nested go module (module 'aeloadsuite') from linters — golangci-lint typecheck failed on it from the root module, same as the already-excluded tools/loadgen/. - skaffold.yaml (loadtest): reindent the requires: block to indent-sequences:false (yamllint: expected 0/4, was 2/6). yamllint clean now. - e2e_calibrate_soc.yaml: strip trailing whitespace (arc autofix). - copy.bara.sky: drop the malformed duplicate line (md_udtfs/** + shared/manager BUILD.bazel concatenated behind a comment; both already listed above it). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017k7uYSNUctQvkTAZYJbaB3 * genfiles(#73): .bazelignore the aeloadsuite nested module run-genfiles failed because gazelle generated src/e2e_test/adaptive_export_loadtest/ suite/BUILD.bazel (untracked → dirty tree). suite/ is a separate go module ('aeloadsuite'), not part of the root px.dev/pixie build — gazelle's generated importpath/deps for it are wrong. Ignore it like the sibling tools/loadgen module (already in .bazelignore) so gazelle skips it. Verified: gazelle fix leaves the tree clean afterward. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017k7uYSNUctQvkTAZYJbaB3 --------- Co-authored-by: Entlein <eineintlein@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: pixie-agent <croedig@sba-research.org>
Stacked on #77 (dx graph rename) → #73 → #68. Closes the AE-side wire gap for dx's §9 completeness contract. Full 'what's included' + TTL test image posted as a comment below once the image is pushed.