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 Reply Children
  • Hi Sachin

    Thank you, i allready know about Quick Regex tool.
    It is nice, if you only want to block/allow certain domain names, and don't know anything about RegExp.

    My problem is, that i DO know regexp extensibly, but it is a bit of hit and miss, when trying to do something.
    For example, it took me a while to realize that http:// was not part of the URL being evaluated, so ^http.*\.com fails to match anything, when you would expect it to match all non https sites with .com TLD.

    Another example (to bypass scanning of all MP3 / MP4 podcasts and files).
    ^[[:graph:]]+\.mp[34](\?.*)?$   <-- this one works
    ^https?\:\/\/[[:graph:]]+\.mp[34](\?.*)?$  <-- this does not work (even though it should)

    So, even the Quick Regex tool gives wrong URL regex to be used with Sophos XG!

    Please provide de correct documentation ASAP!

  • Hi,

    We are supporting the standard RegEx format so there’s no specific format constraint here. Can you test the same thing in v16 and update whether problem persist or not.

    Thanks

  • Dear Sachin

    I dont think you fully understand, what you are answering...

    There are MANY different regular expression standards, where these three are probably the closest to a defacto standard:
    - PCRE (Perl Compatible Regular Expressions)
    - IEEE Posix BRE (Standard Regular Expression)
    - IEEE Posix ERE (Extended Regular Expression) 

    I looked a bit in the UTM manual, but i was unclear if this was correct, as there was the same wrong statement about starting RegEx with ^http:.
    So, therefore i ask you again - can you please help to get the correct information / documentation / syntax about the Regular Expression implementation used in Sophos XG SFOS?

    Unfortunately i do not have SFOS16, as i am running this on our production HA XG310's...
    But if there has been any change in the implementation from v15 to v16 i hope, for gods sake, you or someone else have this documented in the changelogs and documentation!!!

    - Martin

  • Hi,

    The information is provided by the Customer Engineering team. I will try to engage with the documentation team to get the required information published but that will be for v16. 

    Thanks 

  • There are two places where regex is used for web

    - In input validation in the UI
    - In the proxy itself

    The latter is definitely PCRE.  I'm not sure about the input validation, since it doesn't evaluate the RE but I think it should accept all PCRE.

    Whether http is matched or not is not a RegEx implementation/standards issue.

    There have been several changes in this area in v16.  I know that in v16 you can include http in the the match string.  I don't know about v15 but I didn't think we changed that behavior.