Skip to content

Commit

Permalink
comman with no condition
Browse files Browse the repository at this point in the history
null check
  • Loading branch information
0xjjoyy committed Apr 29, 2020
1 parent 1adba06 commit d9730ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
16 changes: 6 additions & 10 deletions docs/guardrails/scp-guardrails.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,7 @@ layout: default
],
"Resource": [
"*"
],
"Condition":
]
}
```

Expand Down Expand Up @@ -511,8 +510,7 @@ layout: default
],
"Resource": [
"arn:aws:glacier:*:*:vaults/*"
],
"Condition":
]
}
```

Expand Down Expand Up @@ -988,13 +986,12 @@ layout: default
"arn:aws:s3:::*/*"
],
"Condition": {
"Bool": {
"s3:x-amz-server-side-encryption": false
"Null": {
"s3:x-amz-server-side-encryption": "true"
},
"StringNotEquals": {
"s3:x-amz-server-side-encryption": [
"aws:kms",
"AES256"
"aws:kms"
]
}
}
Expand Down Expand Up @@ -1075,8 +1072,7 @@ layout: default
"Resource": [
"arn:aws:s3:::[BUCKET_TO_PROTECT]",
"arn:aws:s3:::[BUCKET_TO_PROTECT]/*"
],
"Condition":
]
}
```

Expand Down
9 changes: 4 additions & 5 deletions guardrails/s3/SCP-S3-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
"Resource": ["arn:aws:s3:::*/*"],
"Condition": [
{
"Bool": {
"s3:x-amz-server-side-encryption": false
"Null": {
"s3:x-amz-server-side-encryption": "true"
},
"StringNotEquals": {
"s3:x-amz-server-side-encryption": [
"aws:kms",
"AES256"
"aws:kms"
]
}
}
]
}
}
4 changes: 2 additions & 2 deletions guardrails/scp-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
{% for resource in scp["Resource"] -%}
{% filter indent(width=4) %} "{{resource}}"{% if not loop.last %},{% endif %} {% endfilter %}
{% endfor -%}
],
"Condition": {% filter indent(width=4) %}{{scp["conditions"]}}{% endfilter %}
]{% if "conditions" in scp %},
"Condition": {% filter indent(width=4) %}{{scp["conditions"]}}{% endfilter %}{% endif %}
}
```

Expand Down

0 comments on commit d9730ea

Please sign in to comment.