Fix multiple IAM Policy Statement creation with empty sid
This commit is contained in:
parent
3a5d857a60
commit
21933052d3
@ -152,8 +152,10 @@ class IAMPolicyDocumentValidator:
|
||||
sids = []
|
||||
for statement in self._statements:
|
||||
if "Sid" in statement:
|
||||
assert statement["Sid"] not in sids
|
||||
sids.append(statement["Sid"])
|
||||
statementId = statement["Sid"]
|
||||
if statementId:
|
||||
assert statementId not in sids
|
||||
sids.append(statementId)
|
||||
|
||||
def _validate_statements_syntax(self):
|
||||
assert "Statement" in self._policy_json
|
||||
|
@ -1827,6 +1827,23 @@ valid_policy_documents = [
|
||||
"Resource": ["*"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "",
|
||||
"Effect": "Allow",
|
||||
"Action": "rds:*",
|
||||
"Resource": ["arn:aws:rds:region:*:*"]
|
||||
},
|
||||
{
|
||||
"Sid": "",
|
||||
"Effect": "Allow",
|
||||
"Action": ["rds:Describe*"],
|
||||
"Resource": ["*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user