我的目标是通过 AWS 内联策略来限制每个 IAM 的自动化文档执行,但了解当前的限制后我发现我只能使用*
通配符而不能指定特定文档。
有什么方法可以限制特定的 IAM 只能访问特定的自动化文档。
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "test",
"Effect": "Allow",
"Action": [
"ssm:StartAutomationExecution"
],
"Resource": "*"
}
]
}
答案1
答案2
@JohnRotenstein、@HenrikPingel,我找到了一种实现我想要的方法
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ssm:*"
],
"Resource": [
"arn:aws:ssm:eu-west-2:{accountnumberplaceholder}:automation-definition/{documentnameplaceholder}:$DEFAULT",
"arn:aws:ssm:eu-west-2:{accountnumberplaceholder}:automation-definition/{documentnameplaceholder}:$DEFAULT",
"arn:aws:ssm:eu-west-2:{accountnumberplaceholder}:automation-definition/{documentnameplaceholder}:$DEFAULT",
"arn:aws:ssm:eu-west-2:{accountnumberplaceholder}:*",
"arn:aws:ec2:eu-west-2:{accountnumberplaceholder}:instance/*",
"arn:aws:ssm:eu-west-2::document/AWS-RunPowerShellScript"
]
}
]