Skip to content

feat(rules): tracing-fields keeps the fields standard.toml denies out of telemetry - #34

Draft
PiquelChips wants to merge 1 commit into
feat/rule-duplicate-itemsfrom
feat/rule-tracing-fields
Draft

PiquelChips wants to merge 1 commit into
feat/rule-duplicate-itemsfrom
feat/rule-tracing-fields

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

What and why

sourceorigin never records secrets, query strings, headers, paths, client IPs or user agents in telemetry (SO13). Today one runtime test (telemetry_exports_no_secret_of_a_sign_in_and_code_exchange) and the collector's deletions enforce it, but only for the flows the test drives. The inventory adds a source check. tracing-fields fails on a tracing event or span macro outside tests that records a field whose name, or a dotted part of it, standard.toml denies:

denied-fields = ["token", "secret", "cookie", "user_agent", "ip"]
  • Macros: trace! … error!, event!, span! and the *_span! forms, with or without tracing::.
  • Fields: name = value, the shorthand %name/?name, and dotted names such as http.user_agent. The message literal and its format arguments are not fields, nor are target:, parent: or a level.
  • Opt-in: with no denied-fields, nothing is checked. A field called path is personal data in sourceorigin's requests, but a file path in piqueld.
  • Not covered: #[instrument], which records every argument it doesn't skip. None of the three repositories uses it; a follow-up can read it if one starts.

Stacked on #33.

Testing

  • just check-changed feat/rule-duplicate-items passes.
  • New fixture test: token = %token, ?request.path and warn!(target: "audit", %token) fail. These pass: a token only in the message's format arguments, a span with other fields, and a #[test]. Without denied-fields, nothing is checked.

Measured on git archive copies of each repository's origin/main (since removed), with the inventory's list (token, secret, cookie, path, query, user_agent, ip):

violations notes
sourceorigin e99cc0e6b 0 of 84 event macros; the rule keeps it so
piqueld a17710f52 3 %path of a JSON error and the database file, secret = %name of a secret's name; not personal data, and piqueld doesn't opt in
DirkEngine 07e8ba44 0

Checklist

  • The crate's README (its documentation on docs.rs) shows the change, and a repository's xtask can still follow it. (just readme, and denied-fields in the configuration example.)
  • A change to the public API is noted for the next release, with what each repository's xtask must change. (A new Rule variant and standard.toml key; no xtask change.)
  • just check-changed passes.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@PiquelChips
PiquelChips force-pushed the feat/rule-duplicate-items branch 2 times, most recently from 25d3636 to bc0c299 Compare November 22, 2026 22:20
…emetry

When denied-fields lists names, no tracing event or span macro outside
tests records a field whose name, or a dotted part of it, is one of them.
@PiquelChips
PiquelChips force-pushed the feat/rule-tracing-fields branch from 85578d4 to 58499cb Compare November 22, 2026 22:20
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