Repository navigation
Triage CodeQL rust/cleartext-logging alerts #11–#14 - #148
Merged
Merged
Conversation
Service-boundary and hook maskers already redact before any write. CodeQL taint-tracks through those functions into assert!/println! sinks. Teach the analyzer via a log-injection barrier model, document dismissals in SECURITY.md, and stop interpolating already-masked strings in tests. Co-authored-by: Josh Boys <josh@arkahna.io>
Co-authored-by: Josh Boys <josh@arkahna.io>
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
Triage of open CodeQL
rust/cleartext-loggingalerts #11–#14. All four are false positives: taint analysis does not treat kindling’s secret maskers as sanitizers, so already-redacted strings look like cleartext when they hitassert!/println!.No production leak.
KindlingService::append_observationalways runsmask_secrets_with_evidenceon both the validated andvalidate: falsepaths (in-process CLI and daemon). Hook capture runsmask_secrets/filter_contentbefore append, then the service masks again.Alert dispositions (please dismiss)
crates/kindling/src/hook/filter.rs:275secret_assignment_is_masked. Interpolatedfilter_content→mask_secretsoutput into an assert message. Test no longer interpolates that string.:276crates/kindling/tests/capture_mapping.rs:84$ boom+ default"Unknown error"— no secrets. Assert no longer interpolatesobs.content.crates/kindling/src/commands/log.rs:103observation.contentafterappend_observation, which always callsmask_secrets_with_evidence. CodeQL sees taint through the masker. Productive path: user asked to log this content; we echo the stored (already-masked) row.Inline
// codeql[…]suppressions were not added.What changed
.github/codeql/extensions/kindling-rust/marksmask_secrets/mask_secrets_with_evidenceaslog-injectionbarriers (the sink kindrust/cleartext-logginguses). GitHub default setup auto-detects packs under that directory.SECURITY.md: automated-scanning section with this table (next to the existing secret-scanning fixture note).cli_log_echoes_already_redacted_contentso the fix: DX hardening - security, error handling, docs #14 path stays pinned.How the maskers work
mask_secrets/mask_secrets_with_evidence(crates/kindling-service/src/filter/secrets.rs, hook copy incrates/kindling/src/hook/filter.rs) walk the secret-pattern list and replace matches with[REDACTED]orkey=[REDACTED]. Evidence classes never include matched substrings. Service tests already pinapi_key=abcdef123456789→api_key=[REDACTED].Test plan
cargo test -p eddacraft-kindling --lib secret_assignment_is_maskedcargo test -p eddacraft-kindling --test capture_mappingcargo test -p eddacraft-kindling --test umbrella cli_logcargo test -p kindling-service append_observation_masks_secrets