Skip to content
Open
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
12 changes: 7 additions & 5 deletions bundles/k3d-standard/uds-private-pki-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

variables:
core:
# CA certificate for Authservice
CA_CERT: "PLACEHOLDER_CA_CERT"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we call this out as a breaking change?

Copy link
Contributor

Choose a reason for hiding this comment

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

We're leaving CA_CERT around, just deprecated so I don't think we need to. This removal is just in a CI only config file so not a downstream breaking change here.

# CA_CERTS
CA_BUNDLE_CERTS: "PLACEHOLDER_CA_BUNDLE_CERTS"
CA_BUNDLE_INCLUDE_DOD_CERTS: "true"
CA_BUNDLE_INCLUDE_PUBLIC_CERTS: "true"

# Admin Gateway TLS certificate and key
ADMIN_TLS_CERT: "PLACEHOLDER_ADMIN_TLS_CERT"
Expand All @@ -18,9 +20,9 @@ variables:
GRAFANA_EXTRA_CONFIGMAP_MOUNTS:
- name: ca-certs
mountPath: /etc/ssl/certs/ca.pem
configMap: private-ca
configMap: uds-trust-bundle
readOnly: true
subPath: ca.pem
subPath: ca-bundle.pem

# Keycloak private PKI configuration
KEYCLOAK_EXTRA_VOLUME_MOUNTS:
Expand All @@ -30,6 +32,6 @@ variables:
KEYCLOAK_EXTRA_VOLUMES:
- name: ca-certs
configMap:
name: private-ca
name: uds-trust-bundle
KEYCLOAK_TRUSTSTORE_PATHS:
- "/tmp/ca-certs"
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sidebar:
</tr>
</thead>
<tbody>
<tr><td style="white-space: nowrap;">attributes</td><td style="white-space: nowrap;"><a href="#Attributes">Attributes</a></td><td></td></tr><tr><td style="white-space: nowrap;">expose</td><td style="white-space: nowrap;"><a href="#Expose">Expose</a></td><td></td></tr><tr><td style="white-space: nowrap;">networking</td><td style="white-space: nowrap;"><a href="#Networking">Networking</a></td><td></td></tr><tr><td style="white-space: nowrap;">policy</td><td style="white-space: nowrap;"><a href="#Policy">Policy</a></td><td></td></tr>
<tr><td style="white-space: nowrap;">attributes</td><td style="white-space: nowrap;"><a href="#Attributes">Attributes</a></td><td></td></tr><tr><td style="white-space: nowrap;">caBundle</td><td style="white-space: nowrap;"><a href="#CaBundle">CaBundle</a></td><td></td></tr><tr><td style="white-space: nowrap;">expose</td><td style="white-space: nowrap;"><a href="#Expose">Expose</a></td><td></td></tr><tr><td style="white-space: nowrap;">networking</td><td style="white-space: nowrap;"><a href="#Networking">Networking</a></td><td></td></tr><tr><td style="white-space: nowrap;">policy</td><td style="white-space: nowrap;"><a href="#Policy">Policy</a></td><td></td></tr>
</tbody>
</table>
</div>
Expand All @@ -77,6 +77,24 @@ sidebar:
</table>
</div>

<a id="CaBundle"></a>
<div style="margin-left: 60px; padding-top: 30px;">

### CaBundle
<table style="width: 100%; table-layout: fixed;">
<thead>
<tr>
<th style="width: 20%; white-space: nowrap;">Field</th>
<th style="width: 25%; white-space: nowrap;">Type</th>
<th style="width: 55%; white-space: nowrap;">Description</th>
</tr>
</thead>
<tbody>
<tr><td style="white-space: nowrap;">certs</td><td style="white-space: nowrap;">string</td><td>Contents of user provided CA bundle certificates</td></tr><tr><td style="white-space: nowrap;">includeDoDCerts</td><td style="white-space: nowrap;">boolean</td><td>Include DoD CA certificates in the bundle</td></tr><tr><td style="white-space: nowrap;">includePublicCerts</td><td style="white-space: nowrap;">boolean</td><td>Include public CA certificates in the bundle</td></tr>
</tbody>
</table>
</div>

<a id="Expose"></a>
<div style="margin-left: 60px; padding-top: 30px;">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,43 @@ sidebar:
</tr>
</thead>
<tbody>
<tr><td style="white-space: nowrap;">monitor</td><td style="white-space: nowrap;"><a href="#Monitor">Monitor[]</a></td><td>Create Service or Pod Monitor configurations</td></tr><tr><td style="white-space: nowrap;">network</td><td style="white-space: nowrap;"><a href="#Network">Network</a></td><td>Network configuration for the package</td></tr><tr><td style="white-space: nowrap;">sso</td><td style="white-space: nowrap;"><a href="#Sso">Sso[]</a></td><td>Create SSO client configurations</td></tr>
<tr><td style="white-space: nowrap;">caBundle</td><td style="white-space: nowrap;"><a href="#CaBundle">CaBundle</a></td><td>CA bundle configuration for the package</td></tr><tr><td style="white-space: nowrap;">monitor</td><td style="white-space: nowrap;"><a href="#Monitor">Monitor[]</a></td><td>Create Service or Pod Monitor configurations</td></tr><tr><td style="white-space: nowrap;">network</td><td style="white-space: nowrap;"><a href="#Network">Network</a></td><td>Network configuration for the package</td></tr><tr><td style="white-space: nowrap;">sso</td><td style="white-space: nowrap;"><a href="#Sso">Sso[]</a></td><td>Create SSO client configurations</td></tr>
</tbody>
</table>
</div>

<a id="CaBundle"></a>
<div style="margin-left: 60px; padding-top: 30px;">

### CaBundle
<table style="width: 100%; table-layout: fixed;">
<thead>
<tr>
<th style="width: 20%; white-space: nowrap;">Field</th>
<th style="width: 25%; white-space: nowrap;">Type</th>
<th style="width: 55%; white-space: nowrap;">Description</th>
</tr>
</thead>
<tbody>
<tr><td style="white-space: nowrap;">configMap</td><td style="white-space: nowrap;"><a href="#ConfigMap">ConfigMap</a></td><td>ConfigMap configuration for CA bundle</td></tr>
</tbody>
</table>
</div>

<a id="ConfigMap"></a>
<div style="margin-left: 80px; padding-top: 30px;">

#### ConfigMap
<table style="width: 100%; table-layout: fixed;">
<thead>
<tr>
<th style="width: 20%; white-space: nowrap;">Field</th>
<th style="width: 25%; white-space: nowrap;">Type</th>
<th style="width: 55%; white-space: nowrap;">Description</th>
</tr>
</thead>
<tbody>
<tr><td style="white-space: nowrap;">annotations</td><td style="white-space: nowrap;"></td><td>Additional annotations to apply to the generated ConfigMap (default: {})</td></tr><tr><td style="white-space: nowrap;">key</td><td style="white-space: nowrap;">string</td><td>The key name inside the ConfigMap (default: ca-bundle.pem)</td></tr><tr><td style="white-space: nowrap;">labels</td><td style="white-space: nowrap;"></td><td>Additional labels to apply to the generated ConfigMap (default: {})</td></tr><tr><td style="white-space: nowrap;">name</td><td style="white-space: nowrap;">string</td><td>The name of the ConfigMap to create (default: uds-trust-bundle)</td></tr>
</tbody>
</table>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/configuration/service-mesh/ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ variables:
```

:::note
If you are using Private PKI or self-signed certificates for your tenant certificates it is necessary to additionally configure `UDS_CA_CERT` with additional [trusted certificate authorities](/reference/configuration/single-sign-on/trusted-ca/). You may also need to configure individual UDS Core components to trust your private CA - see the [Private PKI Configuration](/reference/configuration/private-pki/) guide for details.
If you are using Private PKI or self-signed certificates for your tenant certificates it is necessary to additionally configure `UDS_CA_BUNDLE_CERTS` with additional [trusted certificate authorities](/reference/configuration/single-sign-on/trusted-ca/). You may also need to configure individual UDS Core components to trust your private CA - see the [Private PKI Configuration](/reference/configuration/trust-management/private-pki/) guide for details.
:::

#### Configuring TLS from a Secret
Expand Down
10 changes: 7 additions & 3 deletions docs/reference/configuration/single-sign-on/trusted-ca.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ title: Trusted Certificate Authority

Authservice can be configured with additional trusted certificate bundle in cases where UDS Core ingress gateways are deployed with private PKI.

To configure, set `UDS_CA_CERT` as an environment variable with a Base64 encoded PEM formatted CA bundle that can be used to verify the certificates of the tenant gateway.
To configure, set `UDS_CA_BUNDLE_CERTS` as an environment variable with a Base64 encoded PEM formatted CA bundle that can be used to verify the certificates of the tenant gateway. For details on configuring this variable, see the [Central Trust Bundle Management](/reference/configuration/trust-management/central-trust-bundle-management) documentation.

Alternatively you can specify the `CA_CERT` variable in your `uds-config.yaml`:
Alternatively you can specify the `CA_BUNDLE_CERTS` variable in your `uds-config.yaml`:

```yaml
variables:
core:
CA_CERT: <base64 encoded certificate authority>
CA_BUNDLE_CERTS: <base64 encoded certificate authority>
```

:::note[Legacy Support]
The `CA_CERT` variable is still supported for backwards compatibility but is deprecated. Use `CA_BUNDLE_CERTS` for new deployments.
:::

See [configuring Istio Ingress](https://uds.defenseunicorns.com/reference/configuration/ingress/#configure-domain-name-and-tls-for-istio-gateways) for the relevant documentation on configuring ingress certificates.
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
title: Central Trust Bundle Management
sidebar:
order: 8.1
---

UDS Core provides a centralized trust bundle management system that automatically builds and distributes certificate trust bundles across the cluster. This system allows you to define a unified trust source that all packages can automatically consume, regardless of whether the trust bundle includes private, public, or DoD-specific Certificate Authority (CA) certificates.

## Overview

The central trust bundle management feature addresses the challenge of maintaining consistent certificate trust chains across environments. Rather than each package independently managing trusted CA configuration, UDS Core provides a standardized mechanism to:

- **Centrally manage CA certificates**: Define trust bundles in one place through Cluster Configuration
- **Automatically distribute trust stores**: Generate and distribute trust bundles to all namespaces
- **Support multiple CA sources**: Include private/custom, DoD, and public CA certificates as needed

When you configure a trust bundle, UDS Core automatically creates ConfigMaps in each namespace, containing the combined CA certificates in PEM format that applications can mount and use.

## Configuration

Trust bundles are configured during UDS Core deployment using UDS/Zarf variables:

### UDS Core Deployment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `CA_BUNDLE_CERTS` | Base64 encoded CA certs (bundle) in PEM format that UDS Core will inherently trust. At minimum, this must include your Domain CA Cert if using Private PKI for your UDS Core deployment | `""` (empty) |
| `CA_BUNDLE_INCLUDE_DOD_CERTS` | Include DoD CA certificates in the bundle | `false` |
| `CA_BUNDLE_INCLUDE_PUBLIC_CERTS` | Include standard public CA certificates in the bundle | `false` |

:::note[Legacy Support]
The `CA_CERT` variable is still supported for backwards compatibility but is deprecated. Use `CA_BUNDLE_CERTS` for new deployments. This new variable is also used for Authservice configuration as described in the [trusted CA SSO documentation](/reference/configuration/single-sign-on/trusted-ca).
:::

### Cluster Trust Bundle Configuration

The UDS Core trust bundle is configured at deployment time at the cluster level.

Configure these variables in your `uds-config.yaml` file to set up the trust bundle. For example:
```yaml
variables:
core:
CA_BUNDLE_CERTS: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0t..." # Base64 encoded PEM bundle
CA_BUNDLE_INCLUDE_DOD_CERTS: "true" # default false
CA_BUNDLE_INCLUDE_PUBLIC_CERTS: "true" # default false
```

The above example will build a trust bundle that includes your custom CA certificates, DoD CAs, and public CAs concatted together in PEM format. Both the DoD and Public CAs are packaged with UDS Core.

### UDS Package Configuration

Trust bundle ConfigMaps are automatically deployed in all namespaces that contain a UDS Package CR. You can customize the ConfigMap configuration using the `caBundle` field in your Package CR:

```yaml
apiVersion: uds.dev/v1alpha1
kind: Package
metadata:
namespace: my-package
spec:
caBundle:
configMap:
name: uds-trust-bundle # default: uds-trust-bundle - name of the ConfigMap created in the package namespace
key: ca-bundle.pem # default: ca-bundle.pem - key name inside the ConfigMap
labels: # default: {} - list of labels to apply to the ConfigMap created
uds.dev/pod-reload: "true" # apply this label to enable pod reloads on change of this configmap
annotations: # default: {} - list of annotations to apply to the ConfigMap
uds.dev/pod-reload-selector: "app=my-app" # annotation to specify which pods to reload on configmap change
```

The above package CR will create a ConfigMap named `uds-trust-bundle` in the `my-package` namespace with the trust bundle under the key `ca-bundle.pem`. The specified labels and annotations will also be applied to the ConfigMap.

### Mounting the Trust Bundle

Applications can mount the trust bundle ConfigMap into their pods to use the CA certificates for TLS verification. The mount path for the system trust store will depend on the container distribution/application requirements. Common paths include for system trust store replacement:

- Debian/Ubuntu: `/etc/ssl/certs/ca-certificates.crt`
- RedHat/CentOS: `/etc/pki/tls/certs/ca-bundle.crt`

:::caution[Application Trust Store Usage]
Replacing the system trust store does not always guarantee that your application will use the system trust store. Different programming languages and crypto libraries may have their own trust store locations or use embedded CA certificates. You should consult your application's documentation and crypto package/library to understand where it pulls trusted certificates from.
:::

## DoD Certs

UDS Core includes an option to add DoD CA certificates to the trust bundle. When `CA_BUNDLE_INCLUDE_DOD_CERTS` is set to `true`, the standard DoD CA certificates packaged with UDS Core will be included in the trust bundle.

UDS Core pulls these certs from: [DoD Approved External PKI Trust Chains](https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/zip/unclass-dod_approved_external_pkis_trust_chains.zip)

You can also see the certs checked into the UDS Core repository source code here: [UDS Core DoD Certificates](https://github.com/defenseunicorns/uds-core/tree/main/certs/dod)

## Public Certs

The UDS Core trust bundle includes a subset of public CA certificates from the Mozilla CA store. UDS Core only includes widely trusted Public CAs that are based out of the United States or are commonly used for global services.

You can find the full list of public CAs included here [UDS Core Public Trust Config](https://github.com/defenseunicorns/uds-core/blob/main/certs/public/uds-core-public-ca-trust-config.yaml).

The resulting PEM bundle is here [UDS Core Public CA Bundle](https://github.com/defenseunicorns/uds-core/blob/main/certs/public/ca-bundle.pem).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note to self: add a uds docs redirect link for this

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: Private Certificate Authority (CA) Configuration
sidebar:
order: 8.2
---

Some UDS Core components need to connect to external services over TLS. By default, they trust the well-known public certificate authorities (CAs) that come with their container images. If your environment uses self-signed certificates or certificates issued by a private CA, these components will not trust those endpoints unless you explicitly provide the CA bundle.
Expand All @@ -24,7 +26,7 @@ Mounting additional volumes and certificates can introduce minimal security risk
Before configuring private PKI, you'll need the following:

1. The trusted CA bundle in PEM format that your certificates are signed by
2. A ConfigMap containing the trusted CA bundle from (1), available in each namespace (a tool like [trust-manager](https://cert-manager.io/docs/trust/trust-manager/) can help automate this)
2. A ConfigMap containing the trusted CA bundle from (1), available in each namespace (see [Central Trust Bundle Management](/reference/configuration/trust-management/central-trust-bundle-management) for details on doing this with UDS Core.)

:::note
For the examples in this guide, we assume you have a ConfigMap named `private-ca` with a key `ca.pem` that contains your CA bundle.
Expand Down
4 changes: 4 additions & 0 deletions hack/dev-manifests/cluster-config-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ spec:
attributes:
clusterName: ""
tags: []
caBundle:
certs: ""
includeDoDCerts: true
includePublicCerts: true
expose:
adminDomain: ""
caCert: ""
Expand Down
11 changes: 11 additions & 0 deletions hack/dev-manifests/uds-ca-certs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2025 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

apiVersion: v1
kind: ConfigMap
metadata:
name: uds-ca-certs
namespace: pepr-system
data:
dodCACerts: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

ConfigMap has a limitation to 1 MB. I did some quick math and for a Base64 encoded certs that are quite large (2 KB, 2.72 KB after encoding), we can store around 370 of these.

Even though it appears quite large, shall we mention somewhere in the docs that there is certain ceiling there and administrators should be aware of it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, we did some math in the design doc around this. Realistically, we don't imagine users hitting the upper limit on the configmap. We could put a callout in the docs about the upper limit, but I feel it is adding a caution to something that most likely won't happen? I lean towards leaving it out but could be convinced to put it in

publicCACerts: ""
49 changes: 49 additions & 0 deletions schemas/clusterconfig-v1alpha1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
},
"spec": {
"$ref": "#/definitions/Spec"
},
"status": {
"$ref": "#/definitions/Status"
}
},
"required": [
Expand All @@ -36,6 +39,9 @@
"attributes": {
"$ref": "#/definitions/Attributes"
},
"caBundle": {
"$ref": "#/definitions/CABundle"
},
"expose": {
"$ref": "#/definitions/Expose"
},
Expand Down Expand Up @@ -71,6 +77,26 @@
"required": [],
"title": "Attributes"
},
"CABundle": {
"type": "object",
"additionalProperties": false,
"properties": {
"certs": {
"type": "string",
"description": "Contents of user provided CA bundle certificates"
},
"includeDoDCerts": {
"type": "boolean",
"description": "Include DoD CA certificates in the bundle"
},
"includePublicCerts": {
"type": "boolean",
"description": "Include public CA certificates in the bundle"
}
},
"required": [],
"title": "CABundle"
},
"Expose": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -126,12 +152,35 @@
],
"title": "Policy"
},
"Status": {
"type": "object",
"additionalProperties": false,
"properties": {
"observedGeneration": {
"type": "integer"
},
"phase": {
"$ref": "#/definitions/Phase"
}
},
"required": [],
"title": "Status"
},
"Name": {
"type": "string",
"enum": [
"uds-cluster-config"
],
"title": "Name"
},
"Phase": {
"type": "string",
"enum": [
"Pending",
"Ready",
"Failed"
],
"title": "Phase"
}
}
}
Loading
Loading