Skip to content

Improve sanitization for Redis ACL command#15797

Merged
trask merged 1 commit intoopen-telemetry:mainfrom
mznet:sanitize-acl-command
Jan 8, 2026
Merged

Improve sanitization for Redis ACL command#15797
trask merged 1 commit intoopen-telemetry:mainfrom
mznet:sanitize-acl-command

Conversation

@mznet
Copy link
Copy Markdown
Contributor

@mznet mznet commented Jan 8, 2026

Redis ACL commands can contain sensitive information such as plain-text passwords and access control rules.

For example

ACL SETUSER alice on >MySecretPass ~user:alice:* +@read +@write

This command creates an admin user with a plain-text password.
However, in RedisCommandSanitizer, the ACL command is currently configured with KeepAllArgs.INSTANCE, which means all arguments of the ACL command can be exposed without any masking.

ACL has more than 10 subcommands, and the number and structure of arguments vary depending on the subcommand. Because of this, it is very tricky to sanitize ACL commands accurately.
Instead, it is better to keep only the subcommand and mask all arguments after it. For this reason, using CommandAndNumArgs(1) to preserve the subcommand and mask the rest of the arguments would be a better approach.

By CommandAndNumArgs(1), ACL commands can sanitize as shown below:

// ACL SETUSER alice on >MySecretPass ~user:alice:* +@read +@write
ACL SETUSER ? ? ? ? ? ?

// ACL DRYRUN auditor AUTH MySecretPass
ACL DRYRUN ? ? ?

@mznet mznet requested a review from a team as a code owner January 8, 2026 14:32
@trask trask merged commit b056aa1 into open-telemetry:main Jan 8, 2026
85 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot Bot commented Jan 8, 2026

Thank you for your contribution @mznet! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

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.

3 participants