feat: tls trust contexts - #918
Open
hpidcock wants to merge 9 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Often it is required on internal systems, to develop a chain of trust using non-
public certificate authorities for establishing TLS connections. A relevant
issue that was raised is #780, where a CA certificate needs to be loaded for
Pebble to connect to a log-target (e.g. loki) to dispatch logs that occur.
Prior to this work, this problem required manipulating the system's CA pool to
add in the relevant trusted CA, then to restart Pebble such that it can load the
CA pool again.
Since charms are a primary use case for Pebble, and since they affect Pebble's
operation via adding layers to the plan, it is more natural for the charm (or an
administrator) to express trust in the plan. Trust contexts provide the means
for CA certificates to be trusted for the various consumers of trust that are
run via Pebble.
This change extends the layer schema with a new
trust-contextstop-level field,in addition to extending
services,checksandlog-targetswith a newtrust-contextfield to reference the chosen trust context by name.Here is an example layer/plan that demonstrates trust-contexts:
In addition to services, checks and log-targets, it is possible to run a command
via
pebble execwith a trust context. This is possible by passing--contextwith a service name that you wish to adopt the trust context from, in addition
to other existing behaviour taken from the service (e.g. user/group etc.).