亚马逊现在支持通过IAM策略逐个分支地限制对CodeCommit存储库的访问。
我已经使用下面的策略形式成功地拒绝了对特定分支的访问,但找不到一种方法来拒绝对以特定名称开头的所有分支的访问。例如: master和develop是具体的分支,但是我有release-1,release-2等等,我也想否认。我想要的是能够使用通配符。我尝试过release-*,但没有起作用。它们的格式是否包含通配符在"codecommit:References"?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"codecommit:GitPush",
"codecommit:DeleteBranch",
"codecommit:PutFile",
"codecommit:MergePullRequestByFastForward"
],
"Resource": "arn:aws:codecommit:us-east-2:80398EXAMPLE:MyDemoRepo",
"Condition": {
"StringEqualsIfExists": {
"codecommit:References": [
"refs/heads/master",
"refs/heads/develop",
"refs/heads/release-[now what]"
]
},
"Null": {
"codecommit:References": false
}
}
}
]
}
https://stackoverflow.com/questions/50767386
复制相似问题