Skip to content

Wonk fails on '?' syntax in policies #12

@JonnyDaenen

Description

@JonnyDaenen

Problem

Given the following resource description:

arn:<hidden>:log-group:???-dummy:*

Wonk fails on this.

Cause

Wonk tries to use this string as a regex to find out if multiple, more specific strings, match. This happens here.

To do so, wonk replaces * with .* in order to match with regex syntax in python. The question mark, which also needs a character in front of it, is not adjusted.

Potential solution

I believe it makes sense to also replace the questionmark using the following code:

        pattern_string = item.replace("?", ".?")

If I understand the semantics of wonk correctly in this part, this should solve the error while also looking for more specific strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions