Skip to content

redact: decode escaped key names in plain-text secret rules #403

Open

Description

@ElbertePlinio

The plain-text secret rules in redact_secrets match key names as written. They do not decode JSON \u escapes, so an escaped secret key outside a JSON object or array keeps its value.

Example: the log line D/app: "password": "hunter1" is stored unchanged, because password does not match password. The same holds on main today, so this predates the evidence text redaction in #352.

Found during the council review of #352. That PR closes the JSON-context cases: keys inside a JSON object or array are decoded, including after a missing comma or a stray closer. Only text with no surrounding JSON container still depends on the plain rules.

Acceptance criteria:

  • A quoted key with \u escapes before a colon in plain text is decoded before the secret-key check.
  • The value after such a key is redacted, and the rest of the line keeps its text.
  • Unescaped keys and non-secret escaped keys keep today's output.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions