Skip to content

Commit 2295d97

Browse files
author
Mauricio Harley
committed
Add Barbican adoption support with Proteccio HSM integration
Implements comprehensive Barbican service adoption from OSP 17.1 to RHOSO 18 with optional Proteccio Hardware Security Module (HSM) integration. Features: - Base scenario for Barbican adoption without HSM (barbican.yaml) - Extended scenario with Proteccio HSM support (barbican-proteccio.yaml) - OSP 17.1 HSM configuration hook (barbican-osp17-proteccio-setup.yml) - Conditional HSM environment file inclusion in adoption workflow Implements: OSPRH-18874 Signed-off-by: Mauricio Harley <[email protected]>
1 parent fa902d4 commit 2295d97

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
# Copyright Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
- name: Configure OSP 17.1 Barbican with Proteccio HSM
18+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
19+
tasks:
20+
- name: Gather ansible_user_dir from undercloud
21+
delegate_to: "osp-undercloud-0"
22+
ansible.builtin.setup:
23+
gather_subset:
24+
- user_dir
25+
26+
- name: Generate Barbican Proteccio Heat environment file
27+
delegate_to: "osp-undercloud-0"
28+
ansible.builtin.copy:
29+
mode: '0644'
30+
dest: "{{ ansible_user_dir }}/enable-barbican-proteccio.yaml"
31+
content: |-
32+
parameter_defaults:
33+
# Enable PKCS11 backend for Barbican
34+
BarbicanPkcs11CryptoEnabled: true
35+
BarbicanPkcs11CryptoGlobalDefault: true
36+
BarbicanSimpleCryptoGlobalDefault: false
37+
38+
# Proteccio HSM configuration
39+
BarbicanPkcs11CryptoLibraryPath: {{ cifmw_barbican_proteccio_library_path | default('/usr/lib64/libnethsm.so') }}
40+
BarbicanPkcs11CryptoTokenLabels: {{ cifmw_barbican_proteccio_partition }}
41+
BarbicanPkcs11CryptoMKEKLabel: {{ cifmw_barbican_proteccio_mkek_label }}
42+
BarbicanPkcs11CryptoHMACLabel: {{ cifmw_barbican_proteccio_hmac_label }}
43+
BarbicanPkcs11CryptoLogin: {{ cifmw_hsm_password }}
44+
BarbicanPkcs11CryptoSlotId: {{ cifmw_barbican_proteccio_slot_id | default('1') }}
45+
46+
# Encryption mechanisms
47+
BarbicanPkcs11CryptoEncryptionMechanism: CKM_AES_CBC
48+
BarbicanPkcs11CryptoHMACKeyType: CKK_GENERIC_SECRET
49+
BarbicanPkcs11CryptoHMACKeygenMechanism: CKM_GENERIC_SECRET_KEY_GEN
50+
BarbicanPkcs11CryptoMKEKLength: 32
51+
BarbicanPkcs11AlwaysSetCkaSensitive: false
52+
BarbicanPkcs11CryptoOsLockingOk: true
53+
BarbicanPkcs11CryptoATOSEnabled: true
54+
55+
- name: Display generated file location
56+
ansible.builtin.debug:
57+
msg: "Generated Barbican Proteccio HSM configuration at: {{ ansible_user_dir }}/enable-barbican-proteccio.yaml"

roles/adoption_osp_deploy/tasks/deploy_overcloud.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@
7070
dest: "{{ _private_overcloud_conf_file }}"
7171
mode: "0644"
7272

73+
- name: Check if Barbican Proteccio HSM env file exists
74+
delegate_to: "osp-undercloud-0"
75+
ansible.builtin.stat:
76+
path: "{{ ansible_user_dir }}/enable-barbican-proteccio.yaml"
77+
register: _barbican_proteccio_env_file
78+
79+
- name: Include Barbican Proteccio HSM environment file if exists
80+
when: _barbican_proteccio_env_file.stat.exists
81+
ansible.builtin.set_fact:
82+
_overcloud_args: "{{ _overcloud_args }} -e {{ ansible_user_dir }}/enable-barbican-proteccio.yaml"
83+
7384
- name: Run overcloud deploy
7485
delegate_to: "osp-undercloud-0"
7586
vars:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
# OSP 17.1 deployment scenario for Barbican with Proteccio HSM
3+
# Extends the base Barbican scenario with HSM configuration
4+
5+
undercloud:
6+
config: []
7+
8+
stacks:
9+
- stackname: overcloud
10+
pre_oc_run:
11+
- name: Configure Barbican with Proteccio HSM on OSP 17.1
12+
type: playbook
13+
source: barbican-osp17-proteccio-setup.yml

scenarios/adoption/barbican.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
# Base OSP 17.1 deployment scenario for Barbican adoption
3+
# This deploys Barbican with simple_crypto backend (no HSM)
4+
# Can be extended with HSM-specific scenarios
5+
6+
undercloud:
7+
config: []
8+
9+
stacks:
10+
- stackname: overcloud
11+
# No pre_oc_run hooks needed for basic Barbican
12+
# It will use the default simple_crypto backend

0 commit comments

Comments
 (0)