Skip to content

feat: pebble trust context spec - #16

Open
hpidcock wants to merge 5 commits into
canonical:mainfrom
hpidcock:trust-context
Open

feat: pebble trust context spec#16
hpidcock wants to merge 5 commits into
canonical:mainfrom
hpidcock:trust-context

Conversation

@hpidcock

Copy link
Copy Markdown
Member

This is a spec that seeks to address canonical/pebble#780 after some prototyping
of CA bundle reloading it was clear that this problem space is best solved through
extending the pebble plan.

@benhoyt benhoyt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like a good start. I read this through today and left a few initial comments. Look forward to discussing next week.

Comment thread specs/OP08X-tls-trust-store.md Outdated
@@ -0,0 +1,806 @@
# OP0X7 — TLS Trust Contexts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, let's allocate a spec number before merging.

Suggested change
# OP0X7 — TLS Trust Contexts
# OP0X7 — Pebble TLS Trust Contexts

Comment thread specs/OP08X-tls-trust-store.md Outdated
Comment thread specs/OP08X-tls-trust-store.md Outdated
Comment thread specs/OP08X-tls-trust-store.md Outdated

## Plan Configuration

A new top-level section `trust` is added to the Pebble plan. It follows

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A singular name seems a bit wrong compared to the existing fields here: services, checks, log-targets (all plural). Then again, "trusts" seems funny too. "contexts" maybe?

We also have the hidden feature added by a downstream team called workloads: https://github.com/canonical/pebble/blob/b43995f1453397b006ac21ca3bf7938b93c7ca0d/internals/workloads/workloads.go#L29 -- it's service and exec context too ... I wonder if we could reuse or repurpose that?

Comment thread specs/OP08X-tls-trust-store.md Outdated
Comment thread specs/OP08X-tls-trust-store.md Outdated
Comment thread specs/OP08X-tls-trust-store.md Outdated
Comment thread specs/OP08X-tls-trust-store.md Outdated
- Rename top-level plan key `trust` to `trust-contexts`
- Remove `type` field; introduce an `x509` sub-object containing
  `ca-cert` and `ca-cert-files` in place of the top-level field
- Rename `tls-context` to `trust-context` on services, checks, and
  log-targets; remove the complex form with environment token injection
  and the `ca-pem-bundle-file` token mechanism entirely
- Replace `inherit` chain and built-in `default` trust context with a
  flat `include-system: true | false` boolean; when no `trust-context`
  is set on a consumer, the OS system pool is used without injection
- Require `ca-cert-files` entries to have permissions that are a subset
  of 0644; files with more permissive modes are dropped at runtime with
  a warning rather than causing a plan validation error
@hpidcock
hpidcock requested a review from benhoyt June 17, 2026 01:43

@benhoyt benhoyt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Updates look good to me, thanks. Seems in a good shape to start the design review with Gustavo.

@MichaelThamm

Copy link
Copy Markdown

Any update on this? We still see errors in our COS products as a result of this.

@tonyandrewmeyer

Copy link
Copy Markdown
Collaborator

Any update on this? We still see errors in our COS products as a result of this.

Hi @MichaelThamm. Harry's away this and next week, but is still working through getting the spec approved, and we still expect to have a solution this cycle.

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.

4 participants