Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Make it easier to add coverage to old rulesets #1069

Description

@jsha

Right now the process of updating old rulesets to ensure they have sufficient test coverage is very tedious. Typically one has to pull out a list of hostnames from deeply nested regexes like this one:

<rule from="^http://s3(?:-website)?(-ap-(?:nor|sou)theast-1|-(?:eu|us)-west-\d|-external-\d|-sa-east-1)?\.amazonaws\.com/"                                                     

Instead, it would be nice to automatically extract hostnames from regexes when possible. The Python exrex module claims to do this. We could write a script that would do use that module to extract hostnames where possible and add them to <target host=...> tags.

Of course, we can't extract hostnames from wildcard matches like \w+, but that's fine. We'll have to manually add test cases for those.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions