Create a URL filter for an arbitrary string?

L1 Bithead

Create a URL filter for an arbitrary string?

Hello,

I'd like to create a URL filter to block/deny any URL that has an arbitrary string in it.

I was referred to this forum by Palo Alto Support.

In this specific case, the string I'd like to block is "Automated_Clearing_House_transaction".

How can I do this?

Thanks,

Matt

Tags (1)
L3 Networker

Re: Create a URL filter for an arbitrary string?

For this case you will want to create a custom Vulnerability signature with a pattern match for string in the http-req-uri-path context. 

L4 Transporter

Re: Create a URL filter for an arbitrary string?

I agree, accomplished similar blocks with this method

L1 Bithead

Re: Create a URL filter for an arbitrary string?

Thanks all.

For this case, would the following regex work?

.*Automated_Clearing_House_transaction.*

Which regex engine does PAN use so I can find a tester?

How do I apply this to a policy?

L3 Networker

Re: Create a URL filter for an arbitrary string?

Regex is done in custom hardware, so it's not just a standard off-the-shelf engine, but for these purposes it's close enough to PCRE.  In fact since you're just doing a string match simply using Automated_Clearing_House_transaction will work.

I created and tested a signature with the following config:

Screen Shot 2015-04-21 at 9.45.14 AM.png

and it worked on a test url:

Screen Shot 2015-04-21 at 9.48.44 AM.png

The XML for the signature is:

drogers@Captain.America# show threats vulnerability 42001 signature

    <signature>

      <standard>

        <entry name="ACH">

          <and-condition>

            <entry name="And Condition 1">

              <or-condition>

                <entry name="Or Condition 1">

                  <operator>

                    <pattern-match>

                      <pattern>Automated_Clearing_House_transaction</pattern>

                      <context>http-req-uri-path</context>

                      <negate>no</negate>

                    </pattern-match>

                  </operator>

                </entry>

              </or-condition>

            </entry>

          </and-condition>

          <order-free>no</order-free>

          <scope>protocol-data-unit</scope>

        </entry>

      </standard>

    </signature>

L1 Bithead

Re: Create a URL filter for an arbitrary string?

I'm actually trying to handle:

https://www.google.com/url?q=https%3A%2F%2Fwww.dropbox.com%2Fs%2F3629en16p7n2gyg%2FAutomated_Clearing_House_transaction6971.doc%3Fdl%3D1&sa=D&sntz=1&usg=AFQjCNHcCM7TtsC5x7MLN8ha5av6hCxdRw

I ended up using:

.*Automated_Clearing_House_transaction.*\.doc.*

I used this to test: http://regexpal.com/

What do you think?

Any way to make the regex case insensitive?

(?i).*Automated_Clearing_House_transaction.*\.doc.*

is not accepted by PAN.

[update]

Local SE confirmed that there is no case-insensitive support... would utilize too much CPU.

Thanks!

L3 Networker

Re: Create a URL filter for an arbitrary string?

Hi,

This way may be easier..

How to Filter Certain Search Strings using URL Filtering

Best regards

Rob

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!