[security] Redact sensitive config values in startup logs#3486
Conversation
|
@Prajwal-banakar PTAL |
|
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 This can lead to conservative masking for keys containing terms like |
|
@luoyuxia please help review |
|
@fresh-borzoni PTAL |
fresh-borzoni
left a comment
There was a problem hiding this comment.
@litiliu Thank you for the PR, left some comments, PTAL
| /** Utility class for {@link Configuration} related helper functions. */ | ||
| public class ConfigurationUtils { | ||
|
|
||
| private static final String[] SENSITIVE_KEY_PARTS = { |
There was a problem hiding this comment.
Also #3526 adds a second S3-cred list that already diverges, is it worth unifying?
There was a problem hiding this comment.
Good point. I agree it is worth unifying the S3 credential detection, but I would prefer to handle that in #3526 or a focused follow-up.
The matching in this PR is intentionally generic and conservative for log redaction, following Flink-style sensitive-key substring matching. The #3526 logic is S3-specific and should probably use a more precise matcher for supported S3 config prefixes/suffixes, such as s3., s3a., fs.s3a. plus credential-bearing suffixes.
I will keep this PR scoped to the generic redaction path and avoid folding a filesystem config refactor into it. We can extract a shared S3 credential matcher separately so #3526 and the S3 filesystem code do not drift.
What do you think?
20682dc to
b45b839
Compare
|
@fresh-borzoni Thanks for the careful review. I pushed updates for the actionable comments:
For the S3 credential matcher unification with #3526, I’d prefer to keep that as a focused follow-up since that path is S3-specific while this PR keeps the generic log-redaction behavior. |
fresh-borzoni
left a comment
There was a problem hiding this comment.
@litiliu Thank you for the changes, LGTM overall, one comment:
ZooKeeperClient.upsertEntityConfigs seems to also log secrets by the glance, shall we fix it as well, WDYT?
Summary
GlobalConfigurationlogs startup properties.fs.s3a.access.key,s3.access-key, andfs.oss.accessKeyId.Fixes #3485
Test Plan
mvn -pl fluss-common -Dtest=ConfigurationTest,GlobalConfigurationTest test