Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We propose a new configDef api to prevent security related configuration report to controller.

/**
* Whether this configuration must be excluded from
* {@code BrokerRegistrationRequest.StaticConfigs} (KIP-1326).
*
* <ul>
* <li>{@code DEFAULT} — defer to the broker-side filtering logic (currently
* validator-based: a config is reported if it has a {@link Validator} and
* is not {@code PASSWORD}).</li>
* <li>{@code NEVER} — explicit opt-out. The broker MUST NOT include this config
* under any circumstances, even if it gains a validator in the future.
* Intended for sensitive configs (PASSWORD, SSL/SASL secrets, reflective
* classes, free-form structured strings) as a defense-in-depth marker
* that survives future refactors of the inclusion logic.</li>
* </ul>
*
* There is intentionally no {@code ALWAYS} state: forcing a config without a
* validator into the registration request would defeat the purpose of the
* filter (the controller cannot validate values it has no validator for).
*/
public enum ControllerReportPolicy {
    DEFAULT,
    NEVER
}



/**
* Define a security-related configuration. The controller report policy is fixed at
* {@link ControllerReportPolicy#NEVER}, guaranteeing the broker will never include this
* config in {@code BrokerRegistrationRequest.StaticConfigs} (KIP-1326). Intended for
* SSL/SASL secrets, PASSWORD-type entries, JAAS configs, and other sensitive material
* that must never leave the broker.
*
* @param name The name of the config parameter
* @param type The type of the config
* @param defaultValue The default value to use if this config isn't present
* @param validator The validator to use in checking the correctness of the config
* @param importance The importance of this config
* @param documentation The documentation string for the config
* @return This ConfigDef so you can chain calls
*/
public ConfigDef defineSecurity(String name, Type type, Object defaultValue, Validator validator,
Importance importance, String documentation) {
return define(name, type, defaultValue, validator, importance, documentation,
ControllerReportPolicy.NEVER);
}

BrokerRegistrationRequest

...

We propose updating RegisterBrokerRecord to Version 5. This version introduces a new field StaticConfigs, which is a collection of BrokerStaticConfig objects. This allows the Controller to persist the broker's reported static settings directly within the metadata log.


BrokerRegerationRecordRegisterBrokerRecord.json

diff --git a/metadata/src/main/resources/common/metadata/RegisterBrokerRecord.json b/metadata/src/main/resources/common/metadata/RegisterBrokerRecord.json
index b7db680cbd..5570cbd96f 100644
--- a/metadata/src/main/resources/common/metadata/RegisterBrokerRecord.json
+++ b/metadata/src/main/resources/common/metadata/RegisterBrokerRecord.json
@@ -17,11 +17,12 @@
 // Version 2 adds IsMigratingZkBroker
 // Version 3 adds LogDirs
 // Version 4 adds CordonedLogDirs
+// Version 5 adds StaticConfigs for broker static config reporting.
 {
   "apiKey": 0,
   "type": "metadata",
   "name": "RegisterBrokerRecord",
-  "validVersions": "0-4",
+  "validVersions": "0-5",
   "flexibleVersions": "0+",
   "fields": [
     { "name": "BrokerId", "type": "int32", "versions": "0+", "entityType": "brokerId",
@@ -61,6 +62,16 @@
     { "name": "LogDirs", "type":  "[]uuid", "versions":  "3+", "taggedVersions": "3+", "tag": 0,
       "about": "Log directories configured in this broker which are available." },
     { "name": "CordonedLogDirs", "type":  "[]uuid", "versions":  "4+", "taggedVersions": "4+", "tag": "1",
-      "about": "Log directories that are cordoned." }
+      "about": "Log directories that are cordoned." },
+    { "name": "StaticConfigs", "type": "[]BrokerStaticConfig", "versions": "5+",
+      "taggedVersions": "5+", "tag": 2,
+      "about": "static configs from the broker's server.properties and default value.", "fields": [
+      { "name": "Name", "type": "string", "versions": "5+",
+        "about": "The config name." },
+      { "name": "Value", "type": "string", "versions": "5+", "nullableVersions": "5+",
+        "about": "The config value." },
+    ]}
   ]
 }

...