Remove rendered manifest values from verbose logging (#649) - #668
Draft
leynos wants to merge 3 commits into
Draft
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueWarning Your free Security trial is over. An organization admin can upgrade to Advanced for continuous pull request security review or dismiss this notice. Comment |
Contributor
Reviewer's GuideThe PR closes the verbose logging secret leak by eliminating rendered-manifest JSON serialization, emitting only bounded structural counts through telemetry, and adding an end-to-end test that verifies env()-resolved secrets remain in generated output but never appear in CLI logs; associated dead localization entries are removed. Sequence diagram for secret-safe verbose manifest telemetrysequenceDiagram
participant CLI
participant Runner
participant Manifest as NetsukeManifest
participant Telemetry
participant Output as NinjaOutput
CLI->>Runner: generate_ninja_with_shell()
Runner->>Manifest: load_manifest_with_stage_reporting()
Manifest-->>Runner: rendered manifest
Runner->>Telemetry: record_manifest_structure(manifest)
Telemetry->>Telemetry: describe_counter()
Telemetry->>Telemetry: trace_span(variable_count, macro_count, rule_count, action_count, target_count, default_count)
Telemetry->>Telemetry: counter().increment(1)
Runner->>Output: generate Ninja graph
Output-->>CLI: generated file contains resolved values
Runner-->>CLI: verbose logs contain structural counts only
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Replace the raw AST JSON dump with bounded structural telemetry that emits only fixed-vocabulary aggregate counts of manifest collections. Retire the runner.context.serialise_manifest Fluent key across all locales now that no call site remains.
Replace the retired raw AST dump with a fixed-vocabulary structural telemetry module emitting only collection-size counts, add a secret-absence regression test covering command, script, and variable rendering sites, and retire the serialise-manifest localization key across all locales.
leynos
force-pushed
the
feat/remove-secret-leaks-from-verbose-ast-tracing
branch
from
September 3, 2026 01:11
42a905e to
e06f18c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch removes the raw rendered-manifest JSON dump from
--verbosetracing output so secrets interpolated through
env()can no longer leakinto terminal history, CI logs, or diagnostic bundles, closing the medium
severity Codex finding for issue #649.
Closes #649.
Review walkthrough
src/runner/graph_generation.rs
to see the leak point removed: the
tracing::enabled!(DEBUG)guard,serde_json::to_string_pretty(&manifest)serialisation, and thedebug!("AST:...")event are replaced by a call to the new boundedstructural telemetry entry point immediately after the manifest loads.
src/runner/manifest_structure_telemetry.rs
for the replacement boundary. It records only fixed-vocabulary integer
counts of the loaded manifest shape (variables, macros, rules, actions,
targets, defaults) through a
TRACEspan and ametrics::counter!with aone-time
describe_counter!registration. No manifest text, paths, recipecontents, variable values, or descriptions cross the telemetry boundary,
because rendered values can carry secret material from
env()interpolation.
tests/logging_stderr/verbose_secret_absence.rs
for the regression proof. The test drives the real
--verbose generateCLI path with a distinctive sentinel injected through
env('CI_SECRET')at the command, script, and variable rendering sites, and asserts the
sentinel is absent from both stdout and stderr while the generated Ninja
file still resolves the interpolation.
Validation
make check-fmt: passes (Rust, Python, and Markdown formatting clean).make lint: passes (Clippy-D warnings, Whitaker Dylint suite, Pylint10.00/10, ambrleaks).
make test: passes (cargo-nextest full workspace suite plus doctests,including the new secret-absence regression test).
make doc-coverage: passes at 99.13%, above the 80% threshold.Notes
runner.context.serialise_manifestFluent key was removedfrom
src/localization/keys.rsand all 35locales/*/messages.ftlcatalogues in one coordinated change so the localisation audit stays
balanced without suppressing dead-code warnings.
may occur in an arbitrary string with no secret-bearing field name, so
the fix removes the leak at the serialisation boundary instead.
Summary by Sourcery
Prevent rendered manifest contents from being emitted by verbose logging while retaining safe structural observability.
Bug Fixes:
Enhancements:
Tests: