Skip to content

ingest: tighten normalization of derived fields - #62

Closed
fastrevmd-lab wants to merge 2 commits into
mainfrom
bors/mec-1685-bound-derived-fields
Closed

fastrevmd-lab wants to merge 2 commits into
mainfrom
bors/mec-1685-bound-derived-fields

Conversation

@fastrevmd-lab

@fastrevmd-lab fastrevmd-lab commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Several infra/vector/vector.toml transforms derive two of the ingest schema's classification columns partly from upstream-controlled log content without bounding the result before it's written to storage.
  • Clamps each derivation to a fixed charset/length pattern at the point of assignment, falling back to the sentinel already used elsewhere in the file when a value doesn't match, rather than attempting to sanitize or truncate.
  • No behavior change on the happy path: all pre-existing Vector unit tests pass unmodified.
  • Adds unit tests covering the out-of-vocabulary case at each derivation site, including four sites missed in the first pass.

Verification

Ran against the CI-pinned Vector release (checksum-verified against .github/workflows/ci.yml's VECTOR_SHA256):

  • TZ=UTC CH_HOST=unused USERNAME_HASH_KEY=throwaway-ci-key vector test infra/vector/vector.toml — 80/80 passed (69 pre-existing + 11 new), no regressions.
  • Regression check: the 11 new tests all fail against the pre-change transforms, confirming they encode the gap being closed.
  • CH_HOST=unused vector validate --no-environment infra/vector/vector.toml — fails closed as expected without USERNAME_HASH_KEY set, matching the existing CI step.
  • gitleaks protect --staged — no leaks in the change.

Notes for reviewers

  • Read the downstream query path that filters on one of these columns before assuming more changes are needed there — it binds the value as a query parameter rather than interpolating it, so no additional change was required there. Noted in the task thread.

Refs MEC-1685 (private task tracker; this PR's parent tracks the broader ingest hardening effort).

🤖 Generated with Claude Code

Bors (Rust Engineer) and others added 2 commits October 4, 2026 02:14
Several Vector transforms derive event_action/network_transport from
upstream-controlled log content without bounding the result. Clamp each
derivation to a fixed vocabulary, falling back to a sentinel when the
value doesn't match, and add VRL unit tests covering the out-of-vocabulary
case at each site.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Four normalizer-derived field assignments were still unbounded.
Round out the vocabulary clamp added in the parent commit to cover
them, and add out-of-vocabulary test coverage per site using neutral
fixture values.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fastrevmd-lab

Copy link
Copy Markdown
Member Author

Superseded by #65.

@fastrevmd-lab
fastrevmd-lab deleted the bors/mec-1685-bound-derived-fields branch October 4, 2026 07:36
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