Skip to content

Hide PII from ACL log#14645

Merged
sundb merged 5 commits intoredis:unstablefrom
RoyBenMoshe:hide-user-input-from-log
Jan 4, 2026
Merged

Hide PII from ACL log#14645
sundb merged 5 commits intoredis:unstablefrom
RoyBenMoshe:hide-user-input-from-log

Conversation

@RoyBenMoshe
Copy link
Contributor

@RoyBenMoshe RoyBenMoshe commented Dec 24, 2025

This PR continues the work from #13400, following the discussion in #11747, to further ensure sensitive user data is not exposed in logs when hide_user_data_from_log is enabled.

  • Introduce redactLogCstr() helper for safe, centralized log redaction.
  • Update ACL and networking log messages to use redacted values where appropriate.
  • Prevent leaking raw query buffer contents.

@sundb sundb added the release-notes indication that this issue needs to be mentioned in the release notes label Dec 24, 2025
@sundb sundb added this to Redis 8.6 Dec 24, 2025
src/server.h Outdated
void debugPauseProcess(void);

/* Log redaction helpers: return "*redacted*" when hide-user-data-from-log is on. */
static inline const char *logRedactCstr(const char *s) {return server.hide_user_data_from_log ? "*redacted*" : (s ? s : "(null)");}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about using define?

#define logRedactCstr(s) \
    (server.hide_user_data_from_log ? "*redacted*" : ((s) ? (s) : "(null)"))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe keeping it as a static inline function already gives us probably the same zero-cost, compiler-inlined, type-safe behavior we need, so turning it into a macro would just add a little risk for probably no real payoff.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use define because of the overhead, but to align with the things nearby (#define serverLog below), but I can't find this method anywhere else to put it.
Let's see what others think.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about renaming to redactLogCstr? Redact should be the action.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about renaming to redactLogCstr? Redact should be the action.

Sure, that sounds better.

@sundb sundb changed the title Hide PII from log Hide PII from ACL log Dec 31, 2025
@sundb sundb merged commit 29346eb into redis:unstable Jan 4, 2026
19 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Redis 8.6 Jan 4, 2026
sundb pushed a commit that referenced this pull request Jan 29, 2026
This PR continues the work #14645, to further ensure sensitive user
data is not exposed in logs when hide_user_data_from_log is enabled.

- Redact empty key notices during RDB load.
- Redact key names in eviction/expiration debug logs.
- Block DEBUG SCRIPT output and suppress raw string dump in crash object
debug when redaction is enabled.
- Redact malformed MODULE LOAD argument snippets and unresolved module
configuration logs.
- Redact empty key notices during RDB load.
- Redact key names during Lua globals allow‑list warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes indication that this issue needs to be mentioned in the release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants