Is there anyway to determine what IAM permissions I actually need for a CloudFormation template?

后端 未结 1 1070
一向
一向 2020-12-06 13:14

Just wondering whats the best practice for determining what permissions I should give for my CloudFormation template?

After some time of trying to give the minimal

相关标签:
1条回答
  • 2020-12-06 13:52

    In the short term, you can use aws-leastprivilege. But it doesn't support every resource type.

    For the long term: as mentioned in this 2019 re:invent talk, CloudFormation is working towards open sourcing and migrating most of its resource types to a new public resource schema. One of the benefits of this is that you'll be able to see the permissions required to perform each operation.

    E.g. for AWS::ImageBuilder::Image, the schema says

        "handlers": {
            "create": {
                "permissions": [
                    "iam:GetRole",
                    "imagebuilder:GetImageRecipe",
                    "imagebuilder:GetInfrastructureConfiguration",
                    "imagebuilder:GetDistributionConfiguration",
                    "imagebuilder:GetImage",
                    "imagebuilder:CreateImage",
                    "imagebuilder:TagResource"
                ]
            },
            "read": {
                "permissions": [
                    "imagebuilder:GetImage"
                ]
            },
            "delete": {
                "permissions": [
                    "imagebuilder:GetImage",
                    "imagebuilder:DeleteImage",
                    "imagebuilder:UnTagResource"
                ]
            },
            "list": {
                "permissions": [
                    "imagebuilder:ListImages"
                ]
            }
        }
    
    0 讨论(0)
提交回复
热议问题