Important note about SSL VPN compatibility for 20.0 MR1 with EoL SFOS versions and UTM9 OS. Learn more in the release notes.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RegEx URL: Exactly what implementation of regular expressions is used on Sophos XG (SFOS15)?

Is it Posix, Extended RegExp, Perl, ECMAscript or other?
I have had a hard time finding the correct syntax for HTTP bypass rules. It does not appear clear from documentation...

It would also be very nice, to have a RegEx tester built in, to check if you syntax actually matches what you want - and not by mistake maches every URL!
(Is there somewhere in the logs to check this?)

- Martin

EDIT:
And what is the sane explanation, that it is not possible to use RegEx bypass rules for HTTPS scanning?!?
This does not make any sense... 



This thread was automatically locked due to age.
Parents
  • Hi Martin,

    Here's an update-

    We have different check for RegEx at multiple location. The RegEx should be Perl and Java compatible and Max no of URL in Exception list should be < 128 and length of URL is < 100.

    HTTP Proxy:

    The proxy compiles the RegExes in the UI using pcre_compile which is “Perl-compatible regular expressions”

    API:

    URL RegExs can’t start with ^https:// or ^http://


    RegExes are not automatically anchored and must be if desired (example: ^microsoft\.com/ will matchhttp://microsoft.com/ but not http://www.microsoft.com/. If anchor is missing like: microsoft\.com/ then bothhttp://microsoft.com and http://www.microsoft.com will match)

    The max length of URLRegEx is 100, this is restricted by DB schema

    URL RegEx is validated by Perl compiler

    UI:

    URL RegExs can’t start with ^https:// or ^http:// (there's a bug though, see NC-11547)

    The max length of urlregex is 100

    We use the Java Script library RegExp to validate the syntax of the Regexes
    1. Check # of groups (e.g. if \2 is used, there must be at least 2 groups)
    2. Check [] content (e.g. [] should not be allowed because it's empty)

    total # of URL RegExes in an exception < 128

    Hope that helps :)

    Sachin Gurung
    Team Lead | Sophos Technical Support
    Knowledge Base  |  @SophosSupport  |  Video tutorials
    Remember to like a post.  If a post (on a question thread) solves your question use the 'This helped me' link.

  • "RegExes are not automatically anchored and must be if desired (example: ^microsoft\.com/ "

     

    We just implemented the XG coming off the UTM and not anchoring the regex made the appliance unusable, the processor would maxed out under any kind of load.  

    With the current design, it should probably be required.

     

    Our support person is suppose to be writing a KBA about it shortly.

Reply
  • "RegExes are not automatically anchored and must be if desired (example: ^microsoft\.com/ "

     

    We just implemented the XG coming off the UTM and not anchoring the regex made the appliance unusable, the processor would maxed out under any kind of load.  

    With the current design, it should probably be required.

     

    Our support person is suppose to be writing a KBA about it shortly.

Children