mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
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:
committed by
Torin Sandall
parent
9e364259d5
commit
fdfe8b7f34
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user