Feature #21751
closedInstaller's Terraform code supports Customer-Managed Keys
Description
When enabling CMK on AWS, some special permissions need to be set in order for Arvados to work properly.
Compute nodes¶
Compute nodes need access to the keys so that the ebs-autoscale
feature can create EBS encrypted volumes correctly. Preliminary tests suggest that the following policy is enough:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:DescribeKey",
"kms:GenerateDataKey*"
],
"Resource": [
"arn:aws:kms:us-east-1:1234567890:key/xxxxxx-kms-id"
]
},
{
"Effect": "Allow",
"Action": "kms:CreateGrant",
"Resource": [
"arn:aws:kms:us-east-1:1234567890:key/xxxxxx-kms-id"
],
"Condition": {
"Bool": {
"kms:GrantIsForAWSResource": true
}
}
}
]
}
Cloud dispatcher¶
The a-d-c
service might need a similar policy so that it can launch compute nodes with their storage volumes encrypted by default.
This feature should be optional, and disabled by default. The CMK's ARN should be set in Terraform's tfvars
file.
Updated by Peter Amstutz 9 months ago
- Target version changed from Development 2024-05-22 sprint to Development 2024-06-05 sprint
Updated by Peter Amstutz 8 months ago
- Target version changed from Development 2024-06-05 sprint to Development 2024-06-19 sprint
Updated by Peter Amstutz 8 months ago
- Target version changed from Development 2024-06-19 sprint to Development 2024-07-03 sprint
Updated by Peter Amstutz 7 months ago
- Target version changed from Development 2024-07-03 sprint to Development 2024-07-24 sprint
Updated by Peter Amstutz 6 months ago
- Target version changed from Development 2024-07-24 sprint to Development 2024-08-07 sprint
Updated by Peter Amstutz 6 months ago
- Target version changed from Development 2024-08-07 sprint to Development 2024-08-28 sprint
Updated by Peter Amstutz 5 months ago
- Target version changed from Development 2024-08-28 sprint to Development 2024-09-11 sprint
Updated by Peter Amstutz 5 months ago
- Target version changed from Development 2024-09-11 sprint to Development 2024-09-25 sprint
Updated by Lucas Di Pentima 5 months ago
This has been partially finished for some time. I left it aside because I wasn't able to reproduce the issue as I originally remembered it, but I have just been able to do so, so it's now ready to be reviewed.
Changes at c6428ce - branch 21751-installer-cmk-support
- All agreed upon points are implemented / addressed. Describe changes from pre-implementation design.
- Yes
- Anything not implemented (discovered or discussed during work) has a follow-up story.
- No
- Code is tested and passing, both automated and manual, what manual testing was done is described.
- We currently don't have automated multi-node+terraform tests. I've done manual tests on our sandbox account:
- Deployed a test cluster and confirmed it's working correctly with a diagnostics run.
- Changed the account's EC2 security configuration setting the EBS encryption to use a CMK.
- Ran another diagnostics test and confirmed it's failing with the following instance error message: "Client.InvalidKMSKey.InvalidState: The KMS key provided is in an incorrect state"
- Set the
cmk_arn
variable interraform/services/terraform.tfvars
and re-ran./installer.sh terraform
. - Ran diagnostics once again, and got a successful run.
- None
- This minor features are just documented on the
terraform.tfvars
file.
- No change in scale.
- Backwards compatibility is maintained as this feature is disabled by default.
- Yes
Changes:
- Adds CMK access policy as described in https://docs.aws.amazon.com/autoscaling/ec2/userguide/key-policy-requirements-EBS-encryption.html
- Attaches said policy to both compute node and dispatcher roles: the dispatcher needs it to launch new instances, and the instances need it to create the EBS autoscale volumes.
Updated by Brett Smith 5 months ago
Lucas Di Pentima wrote in #note-11:
Changes at c6428ce - branch
21751-installer-cmk-support
Just one naming suggestion about:
name = "${local.cluster_name}_dispatchercmk_access_attachment"
For consistency with the rest of the names around here, I think it would be nicer if we added an underscore to make it dispatcher_cmk
. It's also a little easier to read.
This is good to merge, thanks.
Updated by Lucas Di Pentima 5 months ago
Brett Smith wrote in #note-13:
For consistency with the rest of the names around here, I think it would be nicer if we added an underscore to make it
dispatcher_cmk
. It's also a little easier to read.This is good to merge, thanks.
Thank you for spotting the typo, it was my intention to name it as you suggested.
Updated by Lucas Di Pentima 5 months ago
- Status changed from In Progress to Resolved
Applied in changeset arvados|798ec576038caa889e2fe6adc4a226560540127a.