Skip to content

[DPE-9318] Config option for certificate extra sans#26

Open
reneradoi wants to merge 9 commits into9/edgefrom
config-for-certificate-extra-sans
Open

[DPE-9318] Config option for certificate extra sans#26
reneradoi wants to merge 9 commits into9/edgefrom
config-for-certificate-extra-sans

Conversation

@reneradoi
Copy link
Copy Markdown
Contributor

This PR adds a configuration option for certificate-extra-sans, which allows users to configure specific Subject Alternative Names (SAN) that they want to add to the default SANs in the client certificates. These can be IP addresses or hostnames.

The configuration option will only be considered if client TLS is enabled, not for internal peer TLS (self-managed certificates). If the configuration value is invalid, a "blocked" status will be displayed to the user.

…ate-extra-sans

# Conflicts:
#	config.yaml
#	poetry.lock
#	src/events/tls.py
#	src/managers/tls.py
#	src/statuses.py
#	tests/unit/test_tls.py
Copy link
Copy Markdown

@Mehdi-Bendriss Mehdi-Bendriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks René, good work. I have a comment on a missing error log, but should be good for me.

return

if not (private_key := self.charm.tls_manager.read_and_validate_private_key(secret_id)):
logger.error("Invalid private key provided, cannot update TLS certificates.")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this error log going too? This was a case we said (in etcd) we wanted to alert the user of through logging

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users are still alerted through the blocked status and the detailed error log in read_and_validate_private_key() for every condition that is checked.

skourta
skourta previously approved these changes Mar 24, 2026
Copy link
Copy Markdown
Contributor

@skourta skourta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment else LGTM. Thank you @reneradoi

This PR adds support for error propagation from a TLS provider in
accordance with
[TE202](https://docs.google.com/document/d/1Czkzq8aF-ac74yobbopWr4fSV_YfED9QHhMdHeb61BI/edit?usp=sharing).

The operator observes the newly added `certificate-denied` event and
displays a `blocked` status in case client TLS is enabled and the TLS
provider is sending `request_errors` over the TLS relation interface.

The PR also adds integration test coverage with Vault as TLS provider.
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.

3 participants