Skip to content

Commit 95af4ac

Browse files
authored
feat: only add non-FQDN variant of fully qualified domain names to SANs (#564)
* feat: trim optional trailing dot of cluster domain to always get the non-FQDN variant * chore: add tests / changelog entry * fix: remove trailing dots from node names * fix: move logic to tls module
1 parent 1bea067 commit 95af4ac

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
1818
### Changed
1919

2020
- Default to OCI for image metadata ([#544]).
21+
- [BREAKING] When using a fully qualified domain name, only the variant without the trailing dot is added to the SANs. This should only improve the behavior in scenarios where FQDNs are used and not affect anything else ([#564]).
2122

2223
### Fixed
2324

@@ -29,6 +30,7 @@ All notable changes to this project will be documented in this file.
2930
[#548]: https://github.com/stackabletech/secret-operator/pull/548
3031
[#552]: https://github.com/stackabletech/secret-operator/pull/552
3132
[#563]: https://github.com/stackabletech/secret-operator/pull/563
33+
[#564]: https://github.com/stackabletech/secret-operator/pull/564
3234

3335
## [24.11.1] - 2025-01-10
3436

docs/modules/secret-operator/pages/scope.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ For example, a TLS certificate provisioned by the xref:secretclass.adoc#backend-
5959
xref:#node[] and xref:#pod[] would contain the following values in its `subjectAlternateName` (SAN) extension field:
6060

6161
* The node's IP address
62-
* The node's fully qualified domain name (`my-node.example.com`)
63-
* The pod's fully qualified domain name (`my-pod.my-service.my-namespace.svc.cluster.local`)
62+
* The node's fully qualified domain name (`my-node.example.com`, without a trailing dot)
63+
* The pod's fully qualified domain name (`my-pod.my-service.my-namespace.svc.cluster.local`, without a trailing dot)

rust/operator-binary/src/backend/tls/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,14 @@ impl SecretBackend for TlsGenerate {
252252
.context(ScopeAddressesSnafu { scope })?,
253253
);
254254
}
255+
for address in &mut addresses {
256+
if let Address::Dns(dns) = address {
257+
// Turn FQDNs into bare domain names by removing the trailing dot
258+
if dns.ends_with('.') {
259+
dns.pop();
260+
}
261+
}
262+
}
255263
let ca = self
256264
.ca_manager
257265
.find_certificate_authority_for_signing(not_after)

0 commit comments

Comments
 (0)