Restrict "iam:CreateRole" and "iam:CreatePolicy" to work for kinesis data stream creation only

0

Hello

I am trying to create a kinesis data stream with the management console and an account that is restricted to using several services including Kinesis Data Firehose.

I found that to complete the operation I need additional permissions:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow",
"Action": [ "logs:CreateLogGroup", "logs:CreateLogStream" ], "Resource": ["arn:aws:logs:ap-southeast-2:548097210593:log-group:"] }, { "Effect": "Allow",
"Action": [ "iam:CreateRole" ], "Resource": ["arn:aws:iam::548097210593:role/service-role/
"] },
{ "Effect": "Allow", "Action": [ "iam:CreatePolicy" ], "Resource": ["arn:aws:iam::548097210593:policy/service-role/"] }, { "Effect": "Allow", "Action": [ "iam:AttachRolePolicy", "iam:CreatePolicyVersion", "iam:DeletePolicyVersion", "iam:PassRole" ], "Resource": ["arn:aws:iam::548097210593:role/service-role/KinesisFirehoseServiceRole-"] } ] }

Is there a way to make "iam:CreateRole" and "iam:CreatePolicy" to be more selective and allow only during the creation of a kinesis data stream?

Note that I make it more specific about the resources for "iam:AttachRolePolicy" and "iam:PassRole" But the same does not work for "iam:CreateRole" and "iam:CreatePolicy". The Role and Policy do not exist at the moment the actions is performed so

  • Hi, side note: you should obfuscate your account number in the quote above.

Harut
asked 10 months ago297 views
1 Answer
0

Instead of granting these powerful IAM permissions why don't you manually create the IAM Role that will be used by the Firehose and then select that role in the AWS Console during creation. https://docs.aws.amazon.com/ses/latest/dg/event-publishing-kinesis-analytics-firehose-stream.html

You can refer to this page in in the documentation when determining which permissions should be included in your IAM Role. https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html

I hope this helps you!

EXPERT
answered 10 months ago
  • That implies that the user has permission to create any kind of IAM roles/policies. The point here is that he should be restricted to doing only what is absolutely necessary

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions