You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 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*"]
action = actions[_]
# check if input.action matches an action
regex.globs_match(input.action, action)
}
# 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/*"]
resource = resources[_]
# check if input.resource matches a resource
regex.globs_match(input.resource, resource)
}
According to the rules above, the input below should be allowed.
@kenfdev that's correct. I think there was misunderstanding about how the regex.globs_match built-in function was supposed to work (the author was assuming it was going to act like a wildcard/shell glob).
If you could submit a patch to the docs to make the actions and resources specify regexp patterns like you did in the "Additional Info" section of your issue, that would be great. Thanks! 👍
Expected Behavior
Looking at the Comparison to Other Systems, the IAM policies' wild card doesn't seem to be working.
According to the rules above, the input below should be allowed.
Actual Behavior
The
Output
turns out to be empty (not allowed).Steps to Reproduce the Problem
Input
as follows:Output
{ "result": {} }
Additional Info
I assume this is because
regex.globs_match(glob1, glob2)
receives regex and not wild cards.This should be:
And the following
should be:
Changing the above statements, the
Output
looks correct:If my understanding is correct, I can create a quick PR for this. Thanks!
The text was updated successfully, but these errors were encountered: