Creating a custom app signature to block by URL path

Reply
L1 Bithead

Creating a custom app signature to block by URL path

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.

L1 Bithead

Re: Creating a custom app signature to block by URL path

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

L7 Applicator

Re: Creating a custom app signature to block by URL path

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

Enterprise Architect @ Cloud Carib www.cloudcarib.com
ACE (3.0, 5.0, 6.0, 7.0), PCNSE (6, 7), PCNSI
L1 Bithead

Re: Creating a custom app signature to block by URL path

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

L7 Applicator

Re: Creating a custom app signature to block by URL path

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

Enterprise Architect @ Cloud Carib www.cloudcarib.com
ACE (3.0, 5.0, 6.0, 7.0), PCNSE (6, 7), PCNSI
L1 Bithead

Re: Creating a custom app signature to block by URL path

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

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!