Repository navigation
Do not log kafka secrets - #119244
Do not log kafka secrets#119244
Conversation
|
Workflow [PR], commit [72d0f59] Summary: ✅
AI ReviewSummaryThis PR stops PR Metadata
Findings
Tests
Final Verdict
LLVM Coverage ReportMeasured on commit 72d0f59.
Changed lines: Changed C/C++ lines covered: 16/16 (100.00%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes3 object files changed (+188.01 KiB total), 1 added.
717 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units8 translation units recompiled, 11 s compile time in total, 7 of them have a recent master baseline. |
| # Generate the list of configuration properties that librdkafka marks with the _RK_SENSITIVE | ||
| # flag. ClickHouse uses it to hide the values of these properties in logs, because the public | ||
| # rd_kafka_conf_dump does not redact them. | ||
| set(RDKAFKA_SENSITIVE_PROPERTIES_HEADER "${CMAKE_CURRENT_BINARY_DIR}/generated/librdkafka_sensitive_properties.h") |
There was a problem hiding this comment.
Let's try including the .c instead (in a namespace to avoid conflicts) and see if we can use the array directly. It's a much simpler code and we don't need to regenerate or handle bash
|
Size impact:
|
| { | ||
| /// The properties librdkafka marks with the _RK_SENSITIVE flag, plus a substring safety net | ||
| /// for properties unknown to the vendored librdkafka version. | ||
| static const std::unordered_set<std::string_view> sensitive_properties = [] |
There was a problem hiding this comment.
This now takes librdkafka's _RK_SENSITIVE set as the source of truth, but the SQL-formatting masks are still hard-coded to kafka_sasl_password only (src/Storages/Kafka/Kafka_fwd.h and src/Parsers/FunctionSecretArgumentsFinder.cpp). That means sasl.username is redacted in the producer/consumer trace dump here, yet CREATE TABLE ... SETTINGS kafka_sasl_username = '...' still exposes the same value through SHOW CREATE and system.query_log.
If sasl.username is sensitive enough to prove the broader _RK_SENSITIVE path works, the SQL/query-log masking needs to stay in sync as well.
Backport #119244 to 26.9: Do not log kafka secrets
Backport #119244 to 26.8: Do not log kafka secrets
Cherry pick #119244 to 26.7: Do not log kafka secrets
Cherry pick #119244 to 26.3: Do not log kafka secrets
Backport #119244 to 26.3: Do not log kafka secrets
Backport #119244 to 26.7: Do not log kafka secrets
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Kafka producer and consumer trace logs now show the value of secret librdkafka properties, such as sasl.password, as [HIDDEN] instead of the cleartext value.
Workflow [PR]
Sync PR [sync-upstream/pr/119244]
Version info
26.10.1.1030-master(included in26.10and later)26.9.7.5,26.8.15.12,26.7.18.4,26.3.38.2