It depends on what your concern is here. If it's from the perspective of isolating a compromised node: Yeah, that's the case, but it's the case for IAM access as a whole. One approach is to network isolate the instance, by changing its security groups to a security group with limited (or no) egress allowed.
If this is more of a concern of having to tie the confidant services to IAM roles, and that those roles are tied to individual instances: a confidant service is by default 1:1 with IAM roles, but it doesn't necessarily need to be. The default is for confidant to manage grants on the authnz key and for those grants to reflect IAM roles, but you can manage the IAM policy directly as well.
Let's say for instance you have a service: example-production-iad, and you want to grant access to this confidant service to multiple IAM roles: instance1-production, instance2-production, instance3-production. This is doable by adding an IAM policy to each of those roles:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"kms:GenerateRandom"
],
"Effect": "Allow",
"Resource": "*"
},
{
"Action": [
"kms:Encrypt"
],
"Effect": "Allow",
"Resource": [
"arn:aws:kms:us-east-1:12345:key/your-authnz-key-id"
],
"Condition": {
"StringEquals": {
"kms:EncryptionContext:to": "confidant-production",
"kms:EncryptionContext:user_type": "service",
"kms:EncryptionContext:from": "example-production-iad"
}
}
}
]
}
Now if you want to remove this service from the instances, you just remove this IAM policy from the IAM roles.
Unfortunately if you use the same IAM role on different instances, you're a bit stuck. My general approach to IAM roles is to scope them as closely to the service as possible, so that it's possible to add/remove policy in a fine-grained approach, but I know not everyone has things setup this way.
- Ryan