I try to limit possibility to push changes to release branch on CodeCommit repository on AWS. The problem is that release branch has subbranches like releases/3.4.1 or releases/4.1.4 and i want to prevent from push changes to any subbranch. I wrote policy which should do this what i want but it do not work completly.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"codecommit:GitPush"
],
"Resource": "arn:aws:codecommit:(myRegion):(myAccount):(myReposotory)",
"Condition": {
"StringLikeIfExists": {
"codecommit:References": [
"refs/heads/releases/"
]
},
"Null": {
"codecommit:References": false
}
}
}
]}
User still has privilege to push changes to releases subbranches. What's wrong with this policy?