Creating a custom app signature to block by URL path

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Creating a custom app signature to block by URL path

L1 Bithead

I'm hoping to get some help with a custom signature that I've created.  We're trying to block users from playing flash games on facebook, but still allow them to get to everything else.  For example:  https://apps.facebook.com/candycrush.  The URL category is social-networking and the application is facebook-apps.

 

I've created a signature to detect the app as follows:

 

 

 facebook-candycrush {
     subcategory gaming;
     category media;
     technology browser-based;
     risk 2;
     data-ident no;
     parent-app facebook-apps;
     default {
         port tcp/443;
     }
     signature {
         facebook-candycrush-url {
             and-condition {
                 "And Condition 1" {
                     or-condition {
                         "Or Condition 1" {
                             operator {
                                 pattern-match {
                                     pattern apps\.facebook\.com;
                                     context http-req-host-header;
                                 }
                             }
                         }
                     }
                 }
                 "And Condition 2" {
                     or-condition {
                         "Or Condition 1" {
                             operator {
                                 pattern-match {
                                     pattern candycrush;
                                     context http-req-uri-path;
                                 }
                             }
                         }
                     }
                 }
             }
             scope protocol-data-unit;
             order-free no;
             comment "Detect apps.facebook.com/candycrush";
         }
     }
    

 

Picture of the GUI config:

Snag_c5699be.png

 

 

 

I'm missing something with the AND syntax.  It works fine if I only look for the http-req-host-header or if I only look for the http-req-uri-path, but when I add both, it doesn't work.

 

Any help would be appreciated.

2 accepted solutions

Accepted Solutions

L1 Bithead

Solved my problem by changing from transaction to session and removing ordered condition match.

View solution in original post

Why don't you use custom url category and block this category with security profile?

Enterprise Architect, Security @ Cloud Carib Ltd
Palo Alto Networks certified from 2011

View solution in original post

5 REPLIES 5

L1 Bithead

Solved my problem by changing from transaction to session and removing ordered condition match.

Why don't you use custom url category and block this category with security profile?

Enterprise Architect, Security @ Cloud Carib Ltd
Palo Alto Networks certified from 2011

Well that would certainly be easier.  I guess I was under the impression that URL Categories only worked on hostnames or domains, not paths.

You can use path. For example permit single Youtube video.

Enterprise Architect, Security @ Cloud Carib Ltd
Palo Alto Networks certified from 2011

I just tested and of course it works perfectly.  Thanks so much for setting me straight. 

  • 2 accepted solutions
  • 12418 Views
  • 5 replies
  • 0 Likes
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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!