TABLE OF CONTENTS

Question:

How to use url string and regex pattern match in URL filtering


Solution:

In Versa flexvnf, URL based traffic filtering can be done based on url string or pattern match.


To match based on url string, define the exact url. e.g. www.facebook.com.


Case1: URL strings match



Incases where url filtering is based on pattern,we need to use regex to match url string, e.g .*facebook.* 

(.*<string>.*) for url string www.facebook.com


IMP NOTE: We use standard regex pattern and it is recommended to defined strict pattern match, else it may cause similar url's strings to match defined patterns.


Case2: Regex pattern match



Case3: Complex regex pattern match (\w*\.)microsoftonline\.com(\/.*)" 

NOTE:- Tested on 21.2.3 



admin@SDWAN-Branch3-cli(config)% show orgs org-services Tenant1 url-filtering
user-defined-url-categories {
    URL_with_Blackslash {
        urls {
            patterns "(\w*\.)microsoftonline\.com(\/.*)" {
                reputation trustworthy;
            }
        }
    



Pattern Test:

Open public site as regexr.com or regextester.com can be used to validate the url string match to defined regex pattern.


Example 1: 

Defined pattern *.sex*  to match www.sex.com is also matching url string like search.com.


Making the pattern *.sex.*  match strict, avoids matching similar url string.


Example 2: 

Defined pattern .*kp.*  to match all north korean domain but its matching non korean domain url strings.


Correct pattern  .*(\.kp)($|\/.*) to match all and only north korean domains.