Skip to content

Commit 36fc900

Browse files
author
Mauricio Harley
committed
Replace CI/Zuul references with manual commands in HSM adoption docs
The Key Manager (Barbican) HSM adoption documentation contained references to CI-specific tooling (Zuul job vars, CI framework configuration, cifmw_* variables) that are not applicable to users performing adoption manually. This made the Proteccio HSM procedure (section 4.4.2) impossible to follow as a user. Replace CI-oriented instructions with concrete manual commands (oc create secret, oc patch) following the same pattern used by the simple_crypto adoption procedure (section 4.3). Update related concept modules and troubleshooting procedures to remove CI references and use user-facing terminology throughout. Signed-off-by: Mauricio Harley <mharley@redhat.com>
1 parent 2f5f862 commit 36fc900

8 files changed

Lines changed: 210 additions & 127 deletions

docs_user/modules/con_key-manager-service-hsm-adoption-approaches.adoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ Standard adoption approach::
1616
* Is suitable for development, testing, and standard production environments
1717

1818
HSM-enabled adoption approach::
19-
* Uses the enhanced `barbican_adoption` role with HSM awareness
20-
* Configures HSM integration through a simple boolean flag (`barbican_hsm_enabled: true`)
21-
* Automatically creates required Kubernetes secrets (`hsm-login` and `proteccio-data`)
19+
* Patches the `OpenStackControlPlane` CR with HSM-enabled configuration
20+
* Creates required Kubernetes secrets (`hsm-login` and `proteccio-data`) for HSM credentials and certificates
2221
* Preserves HSM metadata during database migration
2322
* Supports both simple crypto and HSM back ends in the target environment
24-
* Requires HSM-specific configuration variables and custom container images with HSM client libraries (built using the `rhoso_proteccio_hsm` Ansible role)
25-
* Uses HSM client certificates and configuration files accessible via URLs
23+
* Requires custom container images with HSM client libraries (built using the `rhoso_proteccio_hsm` Ansible role)
24+
* Requires HSM client certificates and configuration files
2625
* Requires proper HSM partition and key configuration that matches your source environment
2726
* The HSM-enabled adoption approach currently supports:
2827
** Proteccio (Eviden Trustway): Fully supported with PKCS#11 integration
@@ -34,7 +33,7 @@ HSM-enabled adoption approach::
3433
HSM adoption requires additional configuration steps, including:
3534
3635
* Custom Barbican container images with HSM client libraries that are built using the `rhoso_proteccio_hsm` Ansible role
37-
* HSM client certificates and configuration files that are accessible by using URLs
36+
* HSM client certificates and configuration files that are accessible from the host where you run the adoption commands
3837
* Proper HSM partition and key configuration that matches your source environment
3938
4039
These approaches are mutually exclusive. Choose an approach based on your source environment configuration.

docs_user/modules/con_key-manager-service-support-for-crypto-plugins.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ The {key_manager} supports HSM integration through the PKCS#11 plugin. This enab
2121
* Compliance with security requirements for production environments
2222
* Preservation of existing HSM-protected secrets during adoption
2323

24-
HSM integration is configured through a simple boolean flag (`barbican_hsm_enabled`) during the adoption process. For environments that require HSM integration during adoption, see xref:adopting-key-manager-service-with-proteccio-hsm_{context}[Adopting the {key_manager} with Proteccio HSM integration].
24+
For environments that require HSM integration during adoption, see xref:adopting-the-key-manager-service-with-proteccio-hsm_{context}[Adopting the {key_manager} with Proteccio HSM integration].

docs_user/modules/proc_adopting-key-manager-service-with-hsm-integration.adoc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ When your source {OpenStackPreviousInstaller} environment includes hardware secu
1313
* The target {rhos_long} environment with HSM infrastructure is accessible.
1414
* HSM-enabled {key_manager_first_ref} container images are built and available in your registry.
1515

16-
[NOTE]
17-
====
18-
If you use the automated adoption process by setting `barbican_hsm_enabled: true`, the required HSM secrets (`hsm-login` and `proteccio-data`) are created automatically. You only need to manually create the secret when you perform the manual adoption steps.
19-
====
20-
2116
.Procedure
2217

2318
. Confirm that your source environment configuration includes HSM integration:
@@ -45,7 +40,7 @@ $ SIMPLE_CRYPTO_KEK=$(ssh tripleo-admin@controller-0.ctlplane \
4540
$ oc set data secret/osp-secret "BarbicanSimpleCryptoKEK=${SIMPLE_CRYPTO_KEK}"
4641
----
4742

48-
. If you are not using the automated adoption, create HSM-specific secrets in the target environment:
43+
. Create HSM-specific secrets in the target environment:
4944
+
5045
[source,bash]
5146
----
@@ -76,11 +71,6 @@ Specifies the path to the client key.
7671
Specifies the path to the server certificate.
7772
<path_to_hsm_config>::
7873
Specifies the path to your HSM configuration in your {rhos_acro} environment.
79-
+
80-
[NOTE]
81-
====
82-
When you use the automated adoption by setting `barbican_hsm_enabled: true`, the `barbican_adoption` role creates these secrets automatically. The secret names default to `hsm-login` and `proteccio-data`.
83-
====
8474

8575
. Patch the `OpenStackControlPlane` custom resource to deploy {key_manager} with HSM support:
8676
+

docs_user/modules/proc_adopting-key-manager-service-with-proteccio-hsm.adoc

Lines changed: 141 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,98 +4,171 @@
44
= Adopting the {key_manager} with Proteccio HSM integration
55

66
[role="_abstract"]
7-
To adopt the {key_manager_first_ref} with Proteccio hardware security module (HSM) integration, you use the enhanced Barbican adoption role with HSM support enabled through a configuration flag. This approach preserves HSM integration while adopting all existing secrets from your source {rhos_prev_long} ({OpenStackShort}) environment.
8-
When you run the data plane adoption tests with HSM support enabled, the adoption process performs the following actions:
9-
10-
* Extracts the simple crypto KEK from the source configuration.
11-
* Creates the required HSM secrets (hsm-login and proteccio-data) in the target namespace.
12-
* Deploys Barbican with HSM-enabled configuration by using the PKCS#11 plugin.
13-
* Verifies the HSM functionality and secret migration.
14-
When you run the data plane adoption tests with HSM support enabled, the adoption process performs the following actions:
15-
16-
* Extracts the simple crypto KEK from the source configuration.
17-
* Creates the required HSM secrets (hsm-login and proteccio-data) in the target namespace.
18-
* Deploys Barbican with HSM-enabled configuration by using the PKCS#11 plugin.
19-
* Verifies the HSM functionality and secret migration.
7+
To adopt the {key_manager_first_ref} with Proteccio hardware security module (HSM) integration, you patch an existing `OpenStackControlPlane` custom resource (CR) where {key_manager} is disabled. The patch starts the service with the configuration parameters from the {rhos_prev_long} ({OpenStackShort}) environment and preserves access to existing HSM-backed secrets. You configure the {key_manager} to use both the `simple_crypto` and `pkcs11` back ends.
208

219
The {key_manager} Proteccio HSM adoption is complete if you see the following results:
2210

23-
* The `BarbicanAPI` and `BarbicanWorker` services are up and running with HSM-enabled configuration.
11+
* The `BarbicanAPI`, `BarbicanWorker`, and `BarbicanKeystoneListener` services are up and running with HSM-enabled configuration.
2412
* All secrets from the source {OpenStackShort} {rhos_prev_ver} environment are available in {rhos_long} {rhos_curr_ver}.
2513
* The PKCS11 crypto plugin is available alongside `simple_crypto` for new secret storage.
2614
* HSM functionality is verified and operational.
2715

2816
[NOTE]
29-
====
30-
If your environment does not include Proteccio HSM, to adopt the {key_manager} by using `simple_crypto`, see xref:adopting-the-key-manager-service_{context}[Adopting the {key_manager}].
31-
32-
The enhanced {key_manager} adoption role supports HSM configuration through a simple boolean flag. This approach integrates seamlessly with the standard data plane adoption framework while providing HSM support.
33-
====
17+
If your environment does not include Proteccio HSM, to adopt the {key_manager} by using `simple_crypto` only, see xref:adopting-the-key-manager-service_{context}[Adopting the {key_manager}].
3418

3519
.Prerequisites
3620

3721
* You have a running {OpenStackPreviousInstaller} environment with Proteccio HSM integration (the source cloud).
3822
* You have a Single Node OpenShift or OpenShift Local running in the {rhocp_long} cluster.
3923
* You have SSH access to the source {OpenStackPreviousInstaller} undercloud and Controller nodes.
40-
* You have configured HSM variables in your adoption configuration files.
41-
* Custom {key_manager} container images with the Proteccio client libraries are available in your registry.
24+
* Custom {key_manager} container images with the Proteccio client libraries are built and available in your container registry. For more information, see the `rhoso_proteccio_hsm` Ansible role documentation.
25+
* The Proteccio client certificate, client key, server certificate, and `proteccio.rc` configuration file for the target environment are available on the host where you run the adoption commands.
4226

4327
[IMPORTANT]
4428
====
45-
The HSM adoption process requires proper configuration of HSM-related variables. The adoption role automatically creates the required Kubernetes secrets (`hsm-login` and `proteccio-data`) when `barbican_hsm_enabled` is set to `true`. Ensure that your environment includes the following:
46-
47-
* All HSM-related variables are properly set in your configuration files
48-
* The Proteccio client ISO, certificates, and configuration files are accessible from the configured URLs
49-
* Custom {key_manager} images with Proteccio client are built and available in your container registry
29+
Without proper HSM configuration, your HSM-protected secrets become inaccessible after adoption. Ensure the following before you begin:
5030
51-
Without proper HSM configuration, your HSM-protected secrets become inaccessible after adoption.
31+
* The HSM partition name, MKEK label, and HMAC label match the values configured in your source environment.
32+
* The Proteccio client certificates and configuration files are valid for the target environment.
5233
====
5334

5435
.Procedure
5536

56-
. Configure HSM integration variables in your adoption configuration (Zuul job vars or CI framework configuration):
37+
. Confirm that your source environment configuration includes Proteccio HSM integration:
5738
+
39+
[source,bash]
40+
----
41+
$ ssh tripleo-admin@controller-0.ctlplane \
42+
"sudo cat /var/lib/config-data/puppet-generated/barbican/etc/barbican/barbican.conf | grep -A5 '\[p11_crypto_plugin\]'"
5843
----
59-
# Enable HSM integration for the Barbican adoption role
60-
barbican_hsm_enabled: true
44+
+
45+
If you see the `[p11_crypto_plugin]` section with Proteccio-specific settings, for example `library_path = /usr/lib64/libnethsm.so`, continue with the HSM adoption.
6146

62-
# HSM login credentials
63-
proteccio_login_password: "your_hsm_password"
47+
. Add the simple crypto key encryption key (KEK) secret:
48+
+
49+
----
50+
$ oc set data secret/osp-secret "BarbicanSimpleCryptoKEK=$($CONTROLLER1_SSH "python3 -c \"import configparser; c = configparser.ConfigParser(); c.read('/var/lib/config-data/puppet-generated/barbican/etc/barbican/barbican.conf'); print(c['simple_crypto_plugin']['kek'])\"")"
51+
----
6452

65-
# Kubernetes secret names (defaults shown)
66-
proteccio_login_secret_name: "hsm-login"
67-
proteccio_client_data_secret_name: "proteccio-data"
53+
. Create the HSM login credentials secret:
54+
+
55+
[source,bash]
56+
----
57+
$ oc create secret generic hsm-login \
58+
--from-literal=PKCS11Pin=<your_hsm_password> \
59+
-n openstack
60+
----
61+
+
62+
where:
6863

69-
# HSM partition and key configuration
70-
cifmw_hsm_proteccio_partition: "VHSM1"
71-
cifmw_hsm_mkek_label: "adoption_mkek_1"
72-
cifmw_hsm_hmac_label: "adoption_hmac_1"
73-
cifmw_hsm_proteccio_library_path: "/usr/lib64/libnethsm.so"
74-
cifmw_hsm_key_wrap_mechanism: "CKM_AES_CBC_PAD"
64+
`<your_hsm_password>`::
65+
Specifies the HSM PKCS#11 PIN for the Proteccio partition in your environment.
7566

76-
# HSM client sources (URLs to download Proteccio client files)
77-
cifmw_hsm_proteccio_client_src: "<URL_of_Proteccio_ISO_file>"
78-
cifmw_hsm_proteccio_conf_src: "<URL_of_proteccio.rc_config_file>"
79-
cifmw_hsm_proteccio_client_crt_src: "<URL_of_client_certificate_file>"
80-
cifmw_hsm_proteccio_client_key_src: "<URL_of_client_certificate_key>"
81-
cifmw_hsm_proteccio_server_crt_src:
82-
- "<URL_of_HSM_certificate_file>"
67+
. Create the Proteccio client data secret with the certificates and configuration:
68+
+
69+
[source,bash]
70+
----
71+
$ oc create secret generic proteccio-data \
72+
--from-file=client.crt=<path_to_client_cert> \
73+
--from-file=client.key=<path_to_client_key> \
74+
--from-file=<hsm_server_cert_filename>=<path_to_server_cert> \
75+
--from-file=proteccio.rc=<path_to_hsm_config> \
76+
-n openstack
8377
----
8478
+
8579
where:
8680

87-
<URL_of_Proteccio_ISO_file>::
88-
Specifies the full URL (including "http://" or "https://") of the Proteccio client ISO image file.
89-
<URL_of_proteccio.rc_config_file>::
90-
Specifies the full URL (including "http://" or "https://") of the `proteccio.rc` configuration in your {rhos_acro} environment.
91-
<URL_of_client_certificate_file>::
92-
Specifies the full URL (including "http://" or "https://") of the HSM client certificate file.
93-
<URL_of_client_certificate_key>::
94-
Specifies the full URL (including "http://" or "https://") of the client key file.
95-
<URL_of_HSM_certificate_file>::
96-
Specifies the full URL (including "http://" or "https://") of the HSM certificate file.
81+
`<path_to_client_cert>`::
82+
Specifies the path to the HSM client certificate file.
83+
`<path_to_client_key>`::
84+
Specifies the path to the HSM client key file.
85+
`<hsm_server_cert_filename>`::
86+
Specifies the filename of the HSM server certificate as expected by the Proteccio client, for example, `10_8_60_93.CRT`.
87+
`<path_to_server_cert>`::
88+
Specifies the path to the HSM server certificate file.
89+
`<path_to_hsm_config>`::
90+
Specifies the path to the `proteccio.rc` configuration file for your environment.
91+
92+
. Patch the `OpenStackControlPlane` CR to deploy the {key_manager} with HSM support:
93+
+
94+
[subs="+quotes"]
95+
----
96+
$ oc patch openstackcontrolplane openstack --type=merge --patch '
97+
spec:
98+
barbican:
99+
enabled: true
100+
apiOverride:
101+
route: {}
102+
template:
103+
databaseInstance: openstack
104+
databaseAccount: barbican
105+
messagingBus:
106+
cluster: rabbitmq
107+
secret: osp-secret
108+
simpleCryptoBackendSecret: osp-secret
109+
serviceAccount: barbican
110+
serviceUser: barbican
111+
passwordSelectors:
112+
database: BarbicanDatabasePassword
113+
service: BarbicanPassword
114+
simplecryptokek: BarbicanSimpleCryptoKEK
115+
customServiceConfig: |
116+
[p11_crypto_plugin]
117+
plugin_name = PKCS11
118+
library_path = *<library_path>*
119+
token_labels = *<partition_name>*
120+
mkek_label = *<mkek_label>*
121+
hmac_label = *<hmac_label>*
122+
encryption_mechanism = CKM_AES_CBC
123+
hmac_key_type = CKK_GENERIC_SECRET
124+
hmac_keygen_mechanism = CKM_GENERIC_SECRET_KEY_GEN
125+
hmac_mechanism = CKM_SHA256_HMAC
126+
key_wrap_mechanism = *<key_wrap_mechanism>*
127+
key_wrap_generate_iv = true
128+
always_set_cka_sensitive = true
129+
os_locking_ok = false
130+
globalDefaultSecretStore: pkcs11
131+
enabledSecretStores: ["simple_crypto", "pkcs11"]
132+
pkcs11:
133+
loginSecret: hsm-login
134+
clientDataSecret: proteccio-data
135+
clientDataPath: /etc/proteccio
136+
barbicanAPI:
137+
replicas: 1
138+
override:
139+
service:
140+
internal:
141+
metadata:
142+
annotations:
143+
metallb.universe.tf/address-pool: internalapi
144+
metallb.universe.tf/allow-shared-ip: internalapi
145+
metallb.universe.tf/loadBalancerIPs: *<172.17.0.80>*
146+
spec:
147+
type: LoadBalancer
148+
barbicanWorker:
149+
replicas: 1
150+
barbicanKeystoneListener:
151+
replicas: 1
152+
'
153+
----
154+
+
155+
where:
97156

98-
. Run the data plane adoption tests with HSM support enabled:
157+
`<library_path>`::
158+
Specifies the path to the PKCS#11 library inside the container, for example, `/usr/lib64/libnethsm.so` for Proteccio.
159+
`<partition_name>`::
160+
Specifies the HSM partition name, for example, `VHSM1`. This value must match the partition configured in your source environment.
161+
`<mkek_label>`::
162+
Specifies the label of the Master Key Encryption Key (MKEK) in the HSM. This value must match the key configured in your source environment.
163+
`<hmac_label>`::
164+
Specifies the label of the HMAC key in the HSM. This value must match the key configured in your source environment.
165+
`<key_wrap_mechanism>`::
166+
Specifies the PKCS#11 key wrap mechanism, for example, `CKM_AES_CBC_PAD`. This value must match the mechanism configured in your source environment.
167+
`<172.17.0.80>`::
168+
Specifies the load balancer IP in your environment. If you use IPv6, change the load balancer IP to the load balancer IP in your environment, for example, `metallb.universe.tf/loadBalancerIPs: fd00:bbbb::80`.
169+
170+
`messagingBus.Cluster`::
171+
For more information about RHOSO RabbitMQ clusters, see link:https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/monitoring_high_availability_services/ref_rhoso-rabbitmq-clusters_ha-monitoring#con_understand-the-rabbitmq-interface-for-openstack-services[RHOSO RabbitMQ clusters] in _Monitoring high availability services_.
99172

100173
.Verification
101174

@@ -117,7 +190,7 @@ $ openstack service list | grep key-manager
117190
$ openstack secret list
118191
----
119192

120-
. Confirm that Barbican services are running:
193+
. Confirm that the {key_manager} services are running with HSM-enabled configuration:
121194
+
122195
----
123196
$ oc get pods -n openstack -l service=barbican -o wide
@@ -129,13 +202,18 @@ $ oc get pods -n openstack -l service=barbican -o wide
129202
$ openstack secret store --name adoption-verification --payload 'HSM adoption successful'
130203
----
131204

132-
. Verify that the HSM back end is operational:
205+
. Verify that the HSM back end is operational by retrieving the secret:
133206
+
134207
----
135208
$ openstack secret get <secret_id> --payload
136209
----
137210
+
138211
where:
139212

140-
<secret_id>::
141-
Specifies the ID of the HSM secret.
213+
`<secret_id>`::
214+
Specifies the ID of the secret created in the previous step.
215+
216+
[NOTE]
217+
====
218+
HSM adoption preserves both simple crypto and HSM-backed secrets. The migration process maintains HSM metadata and secret references, ensuring continued access to existing secrets while enabling new secrets to use either back end.
219+
====

docs_user/modules/proc_resolving-config-validation-failures.adoc

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
= Resolving configuration validation failures
55

66
[role="_abstract"]
7-
If the adoption fails with validation errors about placeholder values, replace the placeholder values with your environment's configuration values.
7+
If the adoption fails with validation errors about placeholder values, replace the placeholder values with your environment's actual configuration values.
88

99
Example error:
1010

@@ -17,17 +17,12 @@ fatal: [localhost]: FAILED! => {
1717

1818
.Procedure
1919

20-
. Edit your hardware security module configuration in the Zuul job vars or CI framework configuration file.
20+
. Check the `OpenStackControlPlane` CR patch and the Kubernetes secrets that you created during the adoption procedure.
2121

22-
. Check the following key variables and replace all placeholder values with actual configuration values for your environment:
22+
. Verify that the following configuration values are correct for your environment and do not contain placeholder values:
2323
+
24-
----
25-
cifmw_hsm_password: <your_actual_hsm_password>
26-
cifmw_barbican_proteccio_partition: <VHSM1>
27-
cifmw_barbican_proteccio_mkek_label: <your_mkek_label>
28-
cifmw_barbican_proteccio_hmac_label: <your_hmac_label>
29-
cifmw_hsm_proteccio_client_src: <https://your-server/path/to/Proteccio.iso>
30-
cifmw_hsm_proteccio_conf_src: <https://your-server/path/to/proteccio.rc>
31-
----
24+
* The HSM PKCS#11 PIN in the `hsm-login` secret
25+
* The HSM partition name, MKEK label, and HMAC label in the `customServiceConfig` section of the `OpenStackControlPlane` CR patch
26+
* The Proteccio client certificate, client key, server certificate, and `proteccio.rc` configuration file in the `proteccio-data` secret
3227

33-
. Verify that no placeholder values remain in your configuration.
28+
. Verify that no placeholder values remain in your configuration before you re-run the adoption.

docs_user/modules/proc_resolving-custom-image-registry-issues.adoc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ Specifies the name of your registry server.
4444
`<namespace>`::
4545
Specifies the namespace of your container image.
4646

47-
. Update registry configuration variables if needed:
47+
. If needed, verify that the custom {key_manager} images with Proteccio client libraries are available in the registry:
4848
+
49-
[source,yaml]
49+
[source,bash]
5050
----
51-
cifmw_update_containers_registry: "your-registry:5001"
52-
cifmw_update_containers_org: "your-namespace"
53-
cifmw_image_registry_verify_tls: false
51+
$ podman search <registry>/<namespace>/barbican --list-tags
5452
----
53+
+
54+
where:
55+
56+
`<registry>`::
57+
Specifies the name of your registry server.
58+
`<namespace>`::
59+
Specifies the namespace of your container image.

0 commit comments

Comments
 (0)