Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: only add non-FQDN variant of fully qualified domain names to SANs #564

Merged
merged 5 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
### Changed

- Default to OCI for image metadata ([#544]).
- [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]).

### Fixed

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

## [24.11.1] - 2025-01-10

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/secret-operator/pages/scope.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ For example, a TLS certificate provisioned by the xref:secretclass.adoc#backend-
xref:#node[] and xref:#pod[] would contain the following values in its `subjectAlternateName` (SAN) extension field:

* The node's IP address
* The node's fully qualified domain name (`my-node.example.com`)
* The pod's fully qualified domain name (`my-pod.my-service.my-namespace.svc.cluster.local`)
* The node's fully qualified domain name (`my-node.example.com`, without a trailing dot)
* The pod's fully qualified domain name (`my-pod.my-service.my-namespace.svc.cluster.local`, without a trailing dot)
8 changes: 8 additions & 0 deletions rust/operator-binary/src/backend/tls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,14 @@ impl SecretBackend for TlsGenerate {
.context(ScopeAddressesSnafu { scope })?,
);
}
for address in &mut addresses {
if let Address::Dns(dns) = address {
// Turn FQDNs into bare domain names by removing the trailing dot
if dns.ends_with('.') {
dns.pop();
}
}
}
let ca = self
.ca_manager
.find_certificate_authority_for_signing(not_after)
Expand Down
Loading