Skip to content

[security] Redact sensitive config values in startup logs#3486

Open
litiliu wants to merge 1 commit into
apache:mainfrom
litiliu:codex/3485-redact-sensitive-config-logs
Open

[security] Redact sensitive config values in startup logs#3486
litiliu wants to merge 1 commit into
apache:mainfrom
litiliu:codex/3485-redact-sensitive-config-logs

Conversation

@litiliu

@litiliu litiliu commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Redact sensitive configuration values when GlobalConfiguration logs startup properties.
  • Match sensitive keys case-insensitively using Flink-style substring matching.
  • Cover Fluss access-key variants such as fs.s3a.access.key, s3.access-key, and fs.oss.accessKeyId.

Fixes #3485

Test Plan

  • mvn -pl fluss-common -Dtest=ConfigurationTest,GlobalConfigurationTest test

Add key-based sensitive configuration detection for startup logging, including Flink-compatible sensitive key parts and Fluss access key variants.

Ensure GlobalConfiguration logs sensitive values as ****** and add tests for the logging path.

Closes apache#3485
@litiliu litiliu marked this pull request as ready for review June 15, 2026 07:16
@litiliu

litiliu commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@Prajwal-banakar PTAL

@Prajwal-banakar

Copy link
Copy Markdown
Contributor

HI @litiliu Thanks for the fix, this looks good to me and i've one small question, the implementation uses substring matching (contains) for all sensitive key parts. Is this intentionally aligned with Flink's behavior? I'm asking because patterns such as token and secret may also match non-sensitive configuration keys.

@litiliu

litiliu commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

HI @litiliu Thanks for the fix, this looks good to me and i've one small question, the implementation uses substring matching (contains) for all sensitive key parts. Is this intentionally aligned with Flink's behavior? I'm asking because patterns such as token and secret may also match non-sensitive configuration keys.

@Prajwal-banakar Yes, this is intentional and aligned with Flink's existing behavior. The implementation follows the same semantics as GlobalConfiguration.isSensitive(...), which lowercases the key and checks whether it contains any of the configured sensitive key parts.

This can lead to conservative masking for keys containing terms like token or secret, even if they are not actually sensitive. I think that is acceptable here because it is safer to over-mask than to accidentally expose credentials, and it keeps the behavior consistent with the rest of Flink's configuration/logging handling. If we want stricter matching in the future, it should probably be changed centrally in Flink's sensitive-key detection logic rather than only at this call site.

@litiliu

litiliu commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@luoyuxia please help review

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.

[security] Redact sensitive configuration values in startup logs

2 participants