Skip to content

auditcmd: audit-logs substring match, filenames shape, and pre-scan truncation all let secrets bypass DLP #109

Open

Description

@codeyevsky

Problem

Three related gaps in packages/guard/auditcmd/auditcmd.go all weaken the DLP scan applied to audit-log content:

  1. :58 — the check that decides whether a log entry is an "audit-logs" entry uses a substring match against the entry's identifier/path, so any entry whose name merely contains that substring (without being an actual audit-logs entry) is misclassified, and conversely crafted names can dodge the intended match.
  2. :176 — when the entry being scanned has a filenames field (a list), the code only scans that field and skips scanning sibling fields in the same entry, so secrets placed in another field of a filenames-shaped entry are never checked.
  3. :292 — the DLP scan is run on a summary string that has already been truncated for display, rather than on the full original content, so secrets located past the truncation point are never seen by the scanner.

Impact

Each of these independently lets secret material pass through the audit command's DLP scanning path unredacted or unflagged: via a misclassified entry, via an unscanned sibling field, or via content past the truncation cutoff.

Repro

  1. Craft an entry whose identifier merely contains the audit-logs substring but is not actually one, and observe the special-case handling at :58 misfires (or a genuine audit-logs-shaped entry's substring is crafted to dodge it).
  2. Produce a filenames-shaped entry with a secret in a different top-level field and observe only filenames gets scanned.
  3. Produce a long entry where a secret appears after the point the display-summary truncates it, and observe the DLP scan (which runs on the truncated summary) never sees it.

Suggested fix

Replace the substring check at :58 with an exact match (or a structural/type check) against the entry's actual classification rather than a loose substring test. At :176, scan all relevant fields of the entry, not just filenames, when that shape is detected. At :292, run the DLP scan against the full original content before truncation, and only truncate the already-scanned/redacted result for display.

Activity

  1. sharmis-tp commented on Nov 18, 2026

    @sharmis-tp

    Three separate DLP bypass vectors in the audit log path is a lot of surface area. I'll fix each one: use exact path matching instead of substring, validate the filename shape against a strict pattern, and move truncation to after the scan completes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions