Guest User!

You are not Sophos Staff.

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

Yet another regex cry for help

I have blocked the download of .EXE files in the default content filter (running UTM 9.209-8). This works really well.

I get requests now and again to allow some specific download and for this I have been creating exceptions using regular expressions to match the URL where the specific exe is being downloaded from - typically these are updates for legitimate software we are running and are therefore downloaded regularly. This has also worked well.

However, one specific download location has me stumped. The exe is being downloaded from this content server - this is the URL that is displayed in the log:

df975b643fb977f682c3-8243d3bde40a04822331a45aadc0149c.r48.cf3.rackcdn.com/IRIS110601-55.exe


So, my attempt at a regular expression to match this is as follows:

^http?://([A-Za-z0-9.-]*\.)rackcdn\.com/IRIS*[0-9-]\.exe


When I test this in the Policy tester, it comes back as allowed, but the tester does not state a match with an exception and the end user still cannot download the EXE. Other exceptions that I know work will also say "allowed" in the tester even when the exception is disabled but the end user cannot get the EXE - but when the exception is enabled the tester still comes back saying "allowed", but it also states that an exception has been matched and this time the end user can download the exe as expected.

I suspect my reg exp is wrong - probably the multiple subdomains - can anyone enlighten me please?


This thread was automatically locked due to age.
Parents
  • James, although your REGEX will work, here's your glitch in your first one...  The "*" should not be after "IRIS" - here's what you wanted: [;)]

    ^https?://([A-Za-z0-9.-]*\.)rackcdn\.com/IRIS[0-9-]*\.exe


    Cheers - Bob
  • James, although your REGEX will work, here's your glitch in your first one...  The "*" should not be after "IRIS" - here's what you wanted: [;)]

    ^https?://([A-Za-z0-9.-]*\.)rackcdn\.com/IRIS[0-9-]*\.exe


    Cheers - Bob


    Many thanks Bob. I was on the right track I guess!
Reply
  • James, although your REGEX will work, here's your glitch in your first one...  The "*" should not be after "IRIS" - here's what you wanted: [;)]

    ^https?://([A-Za-z0-9.-]*\.)rackcdn\.com/IRIS[0-9-]*\.exe


    Cheers - Bob


    Many thanks Bob. I was on the right track I guess!
Children
No Data