Skip to content

Commit

Permalink
Add conditional definition cypher support
Browse files Browse the repository at this point in the history
  • Loading branch information
beatro0t committed Jul 25, 2021
1 parent bba4e42 commit 7ddef93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/aws/attacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ def cypher_resolve_commands(history=False):

resolved = f"REPLACE({resolved}, \"${{{placeholder}}}\", {substitute})"

resolved = ("EXTRACT(_ IN %s|%s)" % (strings["commands"], resolved)
resolved = ("[_ IN %s|%s]" % (strings["commands"], resolved)
).replace('{', '{{').replace('}', '}}')

if history:
Expand Down Expand Up @@ -842,6 +842,7 @@ def cypher_inject():
f"[:{x.groupdict()['type']}{{",
', '.join([
f"{k}: '{v}'" for k, v in {"Effect": 'Allow', # Default to allow
**dict({"Condition": []} if self.conditional else {}),
**{k: v for (k, v) in [
re.sub(r"[^\S]*(?P<k>[^:.]*):'(?P<v>[^'.]*)'",
lambda x: f"{x.groupdict()['k']},{x.groupdict()['v']}",
Expand Down

0 comments on commit 7ddef93

Please sign in to comment.