-
Notifications
You must be signed in to change notification settings - Fork 39
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
ansible-scylla-node: Add support for encryption at rest #282
ansible-scylla-node: Add support for encryption at rest #282
Conversation
c279144
to
ab5141a
Compare
ab5141a
to
b46f483
Compare
3ba21bf
to
456fb78
Compare
de6612c
to
cbedd15
Compare
How was this PR tested? |
@vladzcloudius, the following tests were executed:
|
6811a91
to
97e0f3e
Compare
0aff41b
to
ef1cb01
Compare
# where the replicated keys will be kept. | ||
# If you want to use this role for managing your system keys, regardless of them being used for system_info encryption | ||
# or for encrypting the encrypted_keys table, you should set {{ handle_system_keys }} to true and place all of your system | ||
# keys under the {{ localhost_system_key_directory }} folder. The role will copy all the local keys to the {{ system_key_directory }} |
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.
This looks like an incorrect description of the localhost_system_key_directory
content structure: you have a per-host sub-directories structure there, don't you?
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.
you have a per-host sub-directories structure there, don't you?
we do because the inventory_hostname
is part of localhost_table_key_directory
and localhost_system_key_directory
by default:
localhost_system_key_directory: "{{ inventory_dir }}/encryption_at_rest/{{ inventory_hostname }}/system_encryption_keys"
localhost_table_key_directory: "{{ inventory_dir }}/encryption_at_rest/{{ inventory_hostname }}/table_encryption_keys"
Note that based on that the description is not wrong.
I added a comment clarifying that right below the statement that you mentioned.
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.
It's not clear.
The best is to provide an example of the localhost_system_key_directory
layout to avoid any confusion.
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.
Done
This patch adds a task list for managing local keys for encryption at rest. This task list will be responsible for copying a local key to all the Scylla nodes. If the local key exists but is different from an already existing key on the nodes, the role will fail. In order to use this task list, the variables _localhost_key_path and _remote_key_path must be defined.
ef1cb01
to
b02280d
Compare
The changes added here allow the user to manage system keys. Once the user sets the variable {{ handle_system_keys }} to true, the role will be responsible for copying any local keys stored in {{ localhost_system_key_directory }} to {{ system_key_directory }}. This patch also changes the scylla.yaml.j2 template file to update the system_key_directory in the scylla.yaml file if {{ handle_system_keys }} is set to true. Note that this patch only manages the keys without actually enabling/disabling any type of encryption at rest in the cluster.
The changes added here allow the user to manage table keys. Once the user sets the variable {{ handle_table_keys }} to true, the role will be responsible for copying any local keys stored in {{ localhost_table_key_directory }} to {{ table_key_directory }}. Note that this patch only manages the keys without actually enabling/disabling any type of encryption at rest in the cluster.
The changes added here allow the user to enable/disable encryption at rest for system level data, such as commit logs, batches, hints logs and KMIP Password. In order to do so, this patch adds the following yaml objects: * system_info_encryption_local: Should be used for a Local Key Provider * system_info_encryption_kmip: Should be used for a KMIP Key Provider * system_info_encryption_kms: Should be used for a KMS Key Provider These objects are documented on ansible-scylla-node/defaults/main.yml and you need to configure them appropriately. Once you enable any of them and execute the role, the scylla.yaml file will be adjusted according to what it was configured.
b02280d
to
9f5acc8
Compare
This PR adds the following features to the role:
Note that enabling data encryption is not part of this PR and needs to be done manually by the user.
The following tests were executed:
handle_system_keys
is set totrue
, any keys insidelocalhost_system_key_directory
will be copied tosystem_key_directory
handle_table_keys
is set totrue
, any keys insidelocalhost_table_key_directory
will be copied totable_key_directory
system_key_directory
has a different content from a key with the same name in thelocalhost_system_key_diretory
, the role will fail.table_key_directory
has a different content from a key with the same name in thelocalhost_table_key_directory
, the role will fail.system_info_encryption_local.enabled
is set totrue
, thescylla.yaml
file will be set appropriatelysystem_info_encryption_kmip.enabled
is set totrue
, thescylla.yaml
file will be set appropriatelysystem_info_encryption_kms.enabled
is set totrue
, thescylla.yaml
file will be set appropriately