-
Notifications
You must be signed in to change notification settings - Fork 138
Add Barbican adoption support with Proteccio HSM integration #3351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mauricioharley
wants to merge
1
commit into
openstack-k8s-operators:main
Choose a base branch
from
mauricioharley:proteccio_ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
# Copyright Red Hat, Inc. | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
- name: Configure OSP 17.1 Barbican with Proteccio HSM | ||
hosts: "{{ cifmw_target_hook_host | default('localhost') }}" | ||
tasks: | ||
- name: Gather ansible_user_dir from undercloud | ||
delegate_to: "osp-undercloud-0" | ||
ansible.builtin.setup: | ||
gather_subset: | ||
- user_dir | ||
|
||
- name: Generate Barbican Proteccio Heat environment file | ||
delegate_to: "osp-undercloud-0" | ||
ansible.builtin.copy: | ||
mode: '0644' | ||
dest: "{{ ansible_user_dir }}/enable-barbican-proteccio.yaml" | ||
content: |- | ||
parameter_defaults: | ||
# Enable PKCS11 backend for Barbican | ||
BarbicanPkcs11CryptoEnabled: true | ||
BarbicanPkcs11CryptoGlobalDefault: true | ||
BarbicanSimpleCryptoGlobalDefault: false | ||
|
||
# Proteccio HSM configuration | ||
BarbicanPkcs11CryptoLibraryPath: {{ cifmw_barbican_proteccio_library_path | default('/usr/lib64/libnethsm.so') }} | ||
BarbicanPkcs11CryptoTokenLabels: {{ cifmw_barbican_proteccio_partition }} | ||
BarbicanPkcs11CryptoMKEKLabel: {{ cifmw_barbican_proteccio_mkek_label }} | ||
BarbicanPkcs11CryptoHMACLabel: {{ cifmw_barbican_proteccio_hmac_label }} | ||
BarbicanPkcs11CryptoLogin: {{ cifmw_hsm_password }} | ||
BarbicanPkcs11CryptoSlotId: {{ cifmw_barbican_proteccio_slot_id | default('1') }} | ||
|
||
# Encryption mechanisms | ||
BarbicanPkcs11CryptoEncryptionMechanism: CKM_AES_CBC | ||
BarbicanPkcs11CryptoHMACKeyType: CKK_GENERIC_SECRET | ||
BarbicanPkcs11CryptoHMACKeygenMechanism: CKM_GENERIC_SECRET_KEY_GEN | ||
BarbicanPkcs11CryptoMKEKLength: 32 | ||
BarbicanPkcs11AlwaysSetCkaSensitive: false | ||
BarbicanPkcs11CryptoOsLockingOk: true | ||
BarbicanPkcs11CryptoATOSEnabled: true | ||
|
||
- name: Display generated file location | ||
ansible.builtin.debug: | ||
msg: "Generated Barbican Proteccio HSM configuration at: {{ ansible_user_dir }}/enable-barbican-proteccio.yaml" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
# OSP 17.1 deployment scenario for Barbican with Proteccio HSM | ||
# Extends the base Barbican scenario with HSM configuration | ||
|
||
undercloud: | ||
config: [] | ||
|
||
stacks: | ||
- stackname: overcloud | ||
pre_oc_run: | ||
- name: Configure Barbican with Proteccio HSM on OSP 17.1 | ||
type: playbook | ||
source: barbican-osp17-proteccio-setup.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
# Base OSP 17.1 deployment scenario for Barbican adoption | ||
# This deploys Barbican with simple_crypto backend (no HSM) | ||
# Can be extended with HSM-specific scenarios | ||
|
||
undercloud: | ||
config: [] | ||
|
||
stacks: | ||
- stackname: overcloud | ||
# No pre_oc_run hooks needed for basic Barbican | ||
# It will use the default simple_crypto backend |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the framework know to use the file in doing the 17.1 deployment?
I see in your rdo-jobs patch, you key off of file name - though actually you appear to be looking for something called proteccio-heat-vars.yaml in that patch.
I think ultimately you are probably going to want to set some generic parameter extra_tripleo_template or somesuch - and set that to the filename here.
Or you could create a directory {{ansible_user_dir}}/extra-heat-templates or some such and include the file there - and modify the rdo-jobs to read all files in that directory and add to the THT deploy command.