Deploy Fernet on the Overcloud
Deploy Fernet on the Red Hat OpenStack Platform overcloud
概要
Preface リンクのコピーリンクがクリップボードにコピーされました!
Making open source more inclusive リンクのコピーリンクがクリップボードにコピーされました!
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Providing feedback on Red Hat documentation リンクのコピーリンクがクリップボードにコピーされました!
We appreciate your input on our documentation. Tell us how we can make it better.
Using the Direct Documentation Feedback (DDF) function
Use the Add Feedback DDF function for direct comments on specific sentences, paragraphs, or code blocks.
- View the documentation in the Multi-page HTML format.
- Ensure that you see the Feedback button in the upper right corner of the document.
- Highlight the part of text that you want to comment on.
- Click Add Feedback.
- Complete the Add Feedback field with your comments.
- Optional: Add your email address so that the documentation team can contact you for clarification on your issue.
- Click Submit.
第1章 Using Fernet keys for encryption in the overcloud リンクのコピーリンクがクリップボードにコピーされました!
Fernet is the default token provider, that replaces uuid. You can review your Fernet deployment and rotate the Fernet keys.
1.1. Reviewing the Fernet deployment リンクのコピーリンクがクリップボードにコピーされました!
Review your configuration to confirm that Fernet tokens are working correctly.
Procedure
Retrieve the IP address of the controller node:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow SSH into the Controller node:
ssh heat-admin@192.0.2.16
[heat-admin@overcloud-controller-0 ~]$ ssh heat-admin@192.0.2.16Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the values of the token driver and provider settings:
sudo crudini --get /var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf token driver sql sudo crudini --get /var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf token provider fernet
[heat-admin@overcloud-controller-0 ~]$ sudo crudini --get /var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf token driver sql [heat-admin@overcloud-controller-0 ~]$ sudo crudini --get /var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf token provider fernetCopy to Clipboard Copied! Toggle word wrap Toggle overflow Test the Fernet provider:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The result includes the long Fernet token.
1.2. Fernet key rotation cycles リンクのコピーリンクがクリップボードにコピーされました!
When you decide the length of Fernet key rotation cycles, follow the security posture of your organization. If your organization does not have guidance, a monthly rotation cycle is good practice for security reasons.
Fernet uses three types of keys, which are stored in /var/lib/config-data/puppet-generated/keystone/etc/keystone/fernet-keys. The highest-numbered directory contains the primary key, which generates new tokens and decrypts existing tokens.
Fernet key rotation uses the following process: . The primary key becomes the secondary key. . The <system> issues a new primary key. The outgoing primary key is no longer valid. You can use secondary keys to decrypt tokens that were associated with previous primary keys, but you cannot issue new tokens.
1.3. Rotating the Fernet keys by using the Workflow service リンクのコピーリンクがクリップボードにコピーされました!
By default, director manages the overcloud Fernet keys. This setting is managed in an environment file using ManageKeystoneFernetKeys. As a result, the Fernet keys are stored in the Workflow service (mistral), in the KeystoneFernetKeys section. This approach means that you can rotate the Fernet keys with the Workflow service and the keys persist after stack updates.
Procedure
Review the existing Fernet keys:
Identify the Fernet key location. Log in to a Controller node as the heat-admin user and use the
crudinicommand to query the Fernet keys:[stack@<undercloud_host> ~]$ ssh heat-admin@overcloud-controller-o sudo crudini --get /var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf fernet_tokens key_repository /etc/keystone/fernet-keys
[stack@<undercloud_host> ~]$ ssh heat-admin@overcloud-controller-o [heat-admin@overcloud-controller-0 ~]$ sudo crudini --get /var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf fernet_tokens key_repository /etc/keystone/fernet-keysCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注記The
/etc/keystone/directory refers to the container file system path.Inspect the current Fernet key directories:
sudo ls /var/lib/config-data/puppet-generated/keystone/etc/keystone/fernet-keys 0 1 2
[heat-admin@overcloud-controller-0 ~]$ sudo ls /var/lib/config-data/puppet-generated/keystone/etc/keystone/fernet-keys 0 1 2Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
0- Contains the staged key, which becomes the next primary key and is always numbered0. -
1- Contains the secondary key. 2- Contains the primary key. This number increments each time that the keys rotate. The highest number always serves as the primary key.注記-
The maximum number of keys is set with
max_active_keysproperty. The default is 5 keys. - The keys propagate across all Controller nodes.
-
The maximum number of keys is set with
-
Rotate the Fernet keys by using the
workflowcommand:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Retrieve the ID and ensure that the workflow is successful.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On the Controller node, review the number of Fernet keys, and compare with the previous result.
sudo ls /var/lib/config-data/puppet-generated/keystone/etc/keystone/fernet-keys 0 1 2 3
[heat-admin@overcloud-controller-0 ~]$ sudo ls /var/lib/config-data/puppet-generated/keystone/etc/keystone/fernet-keys 0 1 2 3Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
0- Contains the staged key and always be numbered0. This key becomes a primary key during the next rotation. -
1 & 2- Contain the secondary keys. 3- Contains the primary key. This number increments each time the keys rotate. The highest number always serves as the primary key.注記-
The maximum number of keys is set with the
max_active_keysproperty. The default is 5 keys. - The keys propagate across all Controller nodes.
-
The maximum number of keys is set with the
-