Fix IAM sample regex

This fixes wildcard expressions to appropriate regex.

Fixes #1282

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
This commit is contained in:
Ken Fukuyama
2019-03-26 09:00:21 +09:00
committed by Torin Sandall
parent 9e364259d5
commit fdfe8b7f34
+2 -2
View File
@@ -291,7 +291,7 @@ allow {
# actions_match is true if input.action matches one in the list
actions_match {
# iterate over the actions in the list
actions := ["s3:List*","s3:Get*"]
actions := ["s3:List.*","s3:Get.*"]
action := actions[_]
# check if input.action matches an action
regex.globs_match(input.action, action)
@@ -300,7 +300,7 @@ actions_match {
# resources_match is true if input.resource matches one in the list
resources_match {
# iterate over the resources in the list
resources := ["arn:aws:s3:::confidential-data","arn:aws:s3:::confidential-data/*"]
resources := ["arn:aws:s3:::confidential-data","arn:aws:s3:::confidential-data/.*"]
resource := resources[_]
# check if input.resource matches a resource
regex.globs_match(input.resource, resource)