Skip to content

fix(kafka-connect): ignore worker-managed and masked connector config values - #835

Merged
fhussonnois merged 1 commit into
mainfrom
fix/kafka-connect-config-drift
Oct 10, 2026
Merged

fhussonnois merged 1 commit into
mainfrom
fix/kafka-connect-config-drift

Conversation

@fhussonnois

Copy link
Copy Markdown
Member

Summary

Applying an unchanged KafkaConnector manifest always reported an UPDATE, because two values returned by GET /connectors/{name}/config can never appear in a manifest.

  • __internal.config.version: the Connect worker adds this key, and with orphan deletion enabled it was reported as DELETE on every run. Keys prefixed with __internal. are now dropped when a connector config is read (KafkaConnectUtils.removeCommonConnectorConfig).
  • Masked secrets: some distributions, such as Confluent Platform, return sensitive values masked as ••••••••. When the actual value matches the new maskedConfigValuePattern provider property and the key is still declared in the manifest, it is treated as equal to the desired value, so the change is NONE.
    • Default: ^•+$ (a non-empty sequence of bullet characters).
    • An empty string disables it. An invalid regex fails provider configuration with a ConfigException.
    • If a masked key is removed from the manifest, it is still reported as DELETE.

Trade-off: Jikkou cannot see the real value behind a mask, so if only that value changes, the change is not detected. This is documented on the Kafka Connect provider configuration page.

Fixes #822

Tests

  • KafkaConnectorChangeComputerTest: masked value gives NONE; no pattern gives UPDATE; masked key removed gives DELETE; other keys still diff normally; custom pattern.
  • KafkaConnectUtilsTest: __internal.* keys are stripped.
  • KafkaConnectExtensionProviderTest: default pattern, disabled by an empty value, invalid regex.
  • ./mvnw test -pl providers/jikkou-provider-kafka-connect: 57 tests, all passing.

… values

Applying an unchanged KafkaConnector manifest always reported an UPDATE
because two values returned by GET /connectors/{name}/config can never be
written in a manifest:

- `__internal.config.version` is added by the Connect worker and was
  reported as deleted on every run. Keys prefixed with `__internal.` are
  now dropped when reading a connector config.
- Some distributions (e.g. Confluent Platform) return sensitive values
  masked as bullet characters. A masked value is now considered equal to
  the desired value. The mask is matched with the new provider property
  `maskedConfigValuePattern` (default `^•+$`; empty to disable).

Fixes #822
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Security Scan Results

Vulnerabilities detected:


Report Summary

┌───────────────────────────────────────────────────┬───────┬─────────────────┬─────────┐
│                      Target                       │ Type  │ Vulnerabilities │ Secrets │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ cli/pom.xml                                       │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ core/pom.xml                                      │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ docs/go.mod                                       │ gomod │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ extension-rest-client/pom.xml                     │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ pom.xml                                           │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ processor/pom.xml                                 │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ providers/jikkou-provider-aiven/pom.xml           │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ providers/jikkou-provider-aws/pom.xml             │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ providers/jikkou-provider-confluent/pom.xml       │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ providers/jikkou-provider-core/pom.xml            │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ providers/jikkou-provider-iceberg/pom.xml         │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ providers/jikkou-provider-kafka-connect/pom.xml   │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ providers/jikkou-provider-kafka/pom.xml           │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ providers/jikkou-provider-schema-registry/pom.xml │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ resource-generator/pom.xml                        │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ server/jikkou-api-client/pom.xml                  │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ server/jikkou-api-data/pom.xml                    │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ server/jikkou-api-server/pom.xml                  │  pom  │        0        │    -    │
├───────────────────────────────────────────────────┼───────┼─────────────────┼─────────┤
│ template-jinja/pom.xml                            │  pom  │        0        │    -    │
└───────────────────────────────────────────────────┴───────┴─────────────────┴─────────┘
Legend:
- '-': Not scanned
- '0': Clean (no security findings detected)


Scanned by Trivy

@fhussonnois
fhussonnois merged commit 3cd1491 into main Oct 10, 2026
4 checks passed
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.

Connector config reports permanent drift from __internal.config.version and masked secret values

1 participant