How to delegate KMS key creation to an IAM account
Good morning everyone,
It's my first question there, so please be indulgent with me ;o)
I would like to delegate the KMS key creation and use to an IAM user. The purpose is to have an IAM account for a customer and so, he could create and manage his own key. Is it possible? Do you have some documentation or links to help me?
Until now, I created an IAM account but when I try to create a key with it, I get 2 errors message AccessDenied - User: arn:aws:iam::444444444444:user/MATMUT_KMS_Manager is not authorized to perform: iam:ListUsers on resource: arn:aws:iam::444444444444:user/ because no identity-based policy allows the iam:ListUsers action
AccessDenied - User: arn:aws:iam::444444444444:user/MATMUT_KMS_Manager is not authorized to perform: iam:ListRoles on resource: arn:aws:iam::444444444444:role/ because no identity-based policy allows the iam:ListRoles action
Thanks for your help. Best Regards, Mike
It sounds like you might need to add a few more actions to your IAM user policy. To fix those issues specifically, it will need to include the following in addition to the KMS actions:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": [
"iam:ListRoles",
"iam:ListUsers"
],
"Resource": "*"
}
}
There are some more examples here of policies that allow various KMS actions: https://docs.aws.amazon.com/kms/latest/developerguide/customer-managed-policies.html
Relevant questions
Use KMS grant to access to encrypted KMS - CMK S3 bucket
asked 3 months agoHow to delegate KMS key creation to an IAM account
Accepted Answerasked 20 days agoKMS Customer Managed Key with cross-account service role permissions
Accepted Answerasked 2 years agoKMS Key policy ignored over IAM Role
Accepted Answerasked 3 years agoKMS key policy principal not detected
asked a month agoAuditing KMS AWS owned key
Accepted Answerasked 6 months agoKMS cost in my AWS Free Tier
asked 2 years agoKMS key policy to allow access to the key only to the role used to create the key
asked 7 months agoHow to pass KMS encyption key in Deploy to S3 action in cloudformation
asked 3 years agoHow can I receive the header and footer in getting the public key from KMS?
asked 9 months ago