Skip to content

Commit 8187551

Browse files
feat: Add FQDNs to the subject DNs of TLS certificates
1 parent a0a841e commit 8187551

7 files changed

Lines changed: 71 additions & 52 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ All notable changes to this project will be documented in this file.
1616
controllers).
1717
Previously, arbitrary file names were silently accepted and ignored ([#960]).
1818
- Bump `stackable-operator` to 0.111.1 and snafu to 0.9 ([#960], [#961]).
19+
- BREAKING: Extend the subject DNs of TLS certificates with the FQDNs of the Kafka pods ([#972]).
1920

2021
[#953]: https://github.com/stackabletech/kafka-operator/pull/953
2122
[#960]: https://github.com/stackabletech/kafka-operator/pull/960
2223
[#961]: https://github.com/stackabletech/kafka-operator/pull/961
24+
[#972]: https://github.com/stackabletech/kafka-operator/pull/972
2325

2426
## [26.3.0] - 2026-03-16
2527

Cargo.lock

Lines changed: 12 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 33 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ tracing = "0.1"
3131

3232
[patch."https://github.com/stackabletech/operator-rs.git"]
3333
# stackable-operator = { path = "../operator-rs/crates/stackable-operator" }
34-
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
34+
stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "feat/annotation-auto-tls-cert-subject-dn" }

crate-hashes.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/operator-binary/src/crd/security.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ impl KafkaTlsSecurity {
563563
.with_pod_scope()
564564
.with_format(SecretFormat::TlsPkcs12)
565565
.with_auto_tls_cert_lifetime(*requested_secret_lifetime)
566+
.with_auto_tls_cert_domain_components_in_subject_dn(true)
566567
.build()
567568
.context(SecretVolumeBuildSnafu)?,
568569
)
@@ -864,6 +865,7 @@ impl KafkaTlsSecurity {
864865
.with_pod_scope()
865866
.with_format(SecretFormat::TlsPem)
866867
.with_auto_tls_cert_lifetime(*requested_secret_lifetime)
868+
.with_auto_tls_cert_domain_components_in_subject_dn(true)
867869
.build()
868870
.context(SecretVolumeBuildSnafu)?,
869871
)
@@ -888,6 +890,7 @@ impl KafkaTlsSecurity {
888890
.with_listener_volume_scope(LISTENER_BOOTSTRAP_VOLUME_NAME)
889891
.with_format(SecretFormat::TlsPkcs12)
890892
.with_auto_tls_cert_lifetime(*requested_secret_lifetime)
893+
.with_auto_tls_cert_domain_components_in_subject_dn(true)
891894
.build()
892895
.context(SecretVolumeBuildSnafu)?,
893896
)

tests/templates/kuttl/opa/20-install-opa.yaml.j2

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,27 @@ commands:
1818
default allow := false
1919

2020
allow if {
21-
input.requestContext.principal.name == "kafka"
21+
is_internal_request
22+
startswith(
23+
input.requestContext.principal.name,
24+
"DC=local,DC=cluster,DC=svc,DC=$NAMESPACE,DC=test-kafka-broker-default-headless,DC=test-kafka-broker-default-",
25+
)
2226
}
2327

2428
allow if {
25-
input.requestContext.principal.name == "CN=generated certificate for pod"
29+
is_external_request
30+
input.requestContext.principal.name == "kafka"
2631
}
2732

2833
allow if {
34+
is_external_request
2935
input.requestContext.principal.name == "developer"
3036
resource_is_allowed
3137
}
3238

39+
is_internal_request if input.requestContext.listenerName == "INTERNAL"
40+
is_external_request if not is_internal_request
41+
3342
# only allow access to a specific topic
3443
resource_is_allowed if {
3544
input.action.resourcePattern.resourceType == "TOPIC"

0 commit comments

Comments
 (0)