|
| 1 | + |
| 2 | +# Secrets (e.g. container pull secrets) |
| 3 | + |
| 4 | +To have `bootc` fetch updates from registry which requires authentication, |
| 5 | +you must include a pull secret in `/etc/ostree/auth.json`. |
| 6 | + |
| 7 | +Another common case is to also fetch container images via |
| 8 | +`podman` or equivalent. There is a [pull request to add `/etc/containers/auth.json`](https://github.com/containers/image/pull/1746) |
| 9 | +which would be shared by the two stacks by default. |
| 10 | + |
| 11 | +Regardless, injecting this data is a good example of a generic |
| 12 | +"secret". The bootc project does not currently include one |
| 13 | +single opinionated mechanism for secrets. |
| 14 | + |
| 15 | +## Embedding in container build |
| 16 | + |
| 17 | +This was mentioned above; you can include secrets in |
| 18 | +the container image if the registry server is suitably protected. |
| 19 | + |
| 20 | +In some cases, embedding only "bootstrap" secrets into the container |
| 21 | +image is a viable pattern, especially alongside a mechanism for |
| 22 | +having a machine authenticate to a cluster. In this pattern, |
| 23 | +a provisioning tool (whether run as part of the host system |
| 24 | +or a container image) uses the bootstrap secret to lay down |
| 25 | +and keep updated other secrets (for example, SSH keys, |
| 26 | +certificates). |
| 27 | + |
| 28 | +## Via cloud metadata |
| 29 | + |
| 30 | +Most production IaaS systems support a "metadata server" or equivalent |
| 31 | +which can securely host secrets - particularly "bootstrap secrets". |
| 32 | +Your container image can include tooling such as `cloud-init` |
| 33 | +or `ignition` which fetches these secrets. |
| 34 | + |
| 35 | +## Embedded in disk images |
| 36 | + |
| 37 | +Another pattern is to embed bootstrap secrets only in disk images. |
| 38 | +For example, when generating a cloud disk image (AMI, OpenStack glance image, etc.) |
| 39 | +from an input container image, the disk image can contain secrets that |
| 40 | +are effectively machine-local state. Rotating them would |
| 41 | +require an additional management tool, or refreshing disk images. |
| 42 | + |
| 43 | +## Injected via baremetal installers |
| 44 | + |
| 45 | +It is common for installer tools to support injecting configuration |
| 46 | +which can commonly cover secrets like this. |
| 47 | + |
| 48 | +## Injecting secrets via systemd credentials |
| 49 | + |
| 50 | +The systemd project has documentation for [credentials](https://systemd.io/CREDENTIALS/) |
| 51 | +which applies in some deployment methodologies. |
0 commit comments