IAM Policy for aws secrets manager not working

0

We would like to restrict the via tags or any other way for our developers to access only limited secrets via aws secrets manager. { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": [ "secretsmanager:GetResourcePolicy", "secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret", "secretsmanager:ListSecretVersionIds" ], "Resource": "*", "Condition": { "StringEquals": { "secretsmanager:ResourceTag/ServerName": "ServerABC" } } } } The error is below: Failed to fetch a list of secrets.

Hamid
已提问 9 个月前251 查看次数
1 回答
0

Hi,

Have a look at "Controlling access based on tag keys" on https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html

The proper syntax is to use aws:TagKeys :https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys

Your used "secretsmanager:ResourceTag/ServerName"

See their example:

{
        "Effect": "Allow",
        "Action": [
            "secretsmanager:CreateSecret",
            "secretsmanager:TagResource"
        ],
        "Resource": "*",
        "Condition": {
            "Null": {
                "aws:TagKeys": "false"
            },
            "ForAllValues:StringEquals": {
                "aws:TagKeys": [
                    "environment",
                    "cost-center"
                ]
            }
        }
}

Best, Didier

profile pictureAWS
专家
已回答 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则