|
| 1 | +//Module included in the following assemblies: |
| 2 | +// |
| 3 | +//* microshift_install/microshift-embed-in-rpm-ostree.adoc |
| 4 | + |
| 5 | + |
| 6 | +:_content-type: PROCEDURE |
| 7 | +[id="microshift-ca-adding-bundle-ostree_{context}"] |
| 8 | += Adding a certificate authority bundle to an ostree image |
| 9 | +You can include additional trusted certificate authorities (CAs) to the {op-system-ostree-first} `rpm-ostree` image by adding them to the blueprint that you use to create the image. Using the following procedure sets up additional CAs to be trusted by the operating system when pulling images from an image registry. |
| 10 | + |
| 11 | +[NOTE] |
| 12 | +==== |
| 13 | +This procedure requires you to configure the CA bundle customizations in the blueprint, and then add steps to your kickstart file to enable the bundle. In the following steps, `data` is the key, and `<value>` represents the PEM-encoded certificate. |
| 14 | +==== |
| 15 | + |
| 16 | +.Prerequisites |
| 17 | + |
| 18 | +* You have root user access to your build host. |
| 19 | +* Your build host meets the Image Builder system requirements. |
| 20 | +* You have installed and set up Image Builder and the `composer-cli` tool. |
| 21 | +
|
| 22 | +.Procedure |
| 23 | + |
| 24 | +. Add the following custom values to your blueprint to add a directory. |
| 25 | + |
| 26 | +.. Add instructions to your blueprint on the host where the image is built to create the directory, for example, `/etc/pki/ca-trust/source/anchors/` for your certificate bundles. |
| 27 | ++ |
| 28 | +[source,terminal] |
| 29 | +---- |
| 30 | +[[customizations.directories]] |
| 31 | +path = "/etc/pki/ca-trust/source/anchors" |
| 32 | +---- |
| 33 | + |
| 34 | +.. After the image has booted, create the certificate bundles, for example, `/etc/pki/ca-trust/source/anchors/cert1.pem`: |
| 35 | ++ |
| 36 | +[source,terminal] |
| 37 | +---- |
| 38 | +[[customizations.files]] |
| 39 | +path = "/etc/pki/ca-trust/source/anchors/cert1.pem" |
| 40 | +data = "<value>" |
| 41 | +---- |
| 42 | + |
| 43 | +. To enable the certificate bundle in the system-wide trust store configuration, use the `update-ca-trust` command on the host where the image you are using has booted, for example: |
| 44 | ++ |
| 45 | +[source,terminal] |
| 46 | +---- |
| 47 | +$ sudo update-ca-trust |
| 48 | +---- |
| 49 | + |
| 50 | +[NOTE] |
| 51 | +==== |
| 52 | +The `update-ca-trust` command might be included in the `%post` section of a kickstart file used for MicroShift host installation so that all the necessary certificate trust is enabled on the first boot. You must configure the CA bundle customizations in the blueprint before adding steps to your kickstart file to enable the bundle. |
| 53 | +
|
| 54 | +[source,terminal] |
| 55 | +---- |
| 56 | +%post |
| 57 | +# Update certificate trust storage in case new certificates were |
| 58 | +# installed at /etc/pki/ca-trust/source/anchors directory |
| 59 | +update-ca-trust |
| 60 | +%end |
| 61 | +---- |
| 62 | +==== |
0 commit comments