This article explains how to create, validate, upload, associate, and troubleshoot URL Files used with URL Filtering. URL Files allow administrators to define URL or fully qualified domain name (FQDN) entries, or regular-expression patterns, and associate each entry with a URL reputation. The resulting file can be used when configuring custom URL Category objects.
A common source of confusion is that uploading a URL File to the Director and making the file available to a VOS appliance are separate steps. The file must be uploaded to the Director first and then uploaded to the target appliance before it can be selected for URL Category configuration.
The expected workflow is:
Each line in the CSV file contains three comma-separated values:
string,<fully-qualified-domain-name>,<url-reputation>
patterns,<regular-expression>,<url-reputation>
The first field must be either string or patterns:
|
Keyword |
Second Field |
Purpose |
|
string |
Fully qualified domain name |
Matches a specific FQDN/URL entry. |
|
patterns |
Regular expression |
Matches one or more URLs based on the supplied regex. |
The supported reputation values range from safest to riskiest:
string,www.example.com,trustworthy
patterns,.*example.*,low_risk
patterns,.*versa-networks.*,trustworthy
When using the patterns format, the backslash (\) and opening curly brace ({) characters must be escaped by preceding them with a backslash.
For example, a pattern containing these characters must be represented in the CSV with the required escaping.
⚠ Note Incorrect regex escaping is a common reason for a URL pattern not matching the expected traffic.
A URL File can contain a maximum of 65,535 lines.
From Director view:
ℹ Note At this stage the file is available on the Director but has not necessarily been uploaded to the VOS appliance.
ℹ Note The file must be uploaded to the target appliance before it becomes available for use in URL Category configuration.
The custom URL Category can then be used in URL-Filtering profiles and associated security policies.
When a URL File does not appear to work, verify the configuration in the following order:
|
Verification Point |
What to Check |
|
CSV file |
Format, keyword, reputation, regex syntax, line count |
|
Director |
File is visible after upload |
|
Appliance |
File is uploaded to the correct VOS device |
|
URL Category |
The correct URL File is selected |
|
URL-Filtering profile |
The category/reputation is referenced by the profile |
|
Security policy |
The URL-Filtering profile is attached to the traffic path |
|
Traffic/logs |
The tested traffic actually traverses the VOS device |
Check the following:
This usually indicates that the Director upload completed but the appliance upload step was not completed or was performed against a different appliance.
The URL file is stored at the following location on the appliance:
/opt/versa/var/urlf/<tenant name>/url-files/
The Director can upload the file only if password-less SSH authentication to the device is working correctly.
Test passwordless authentication — run on Director:
If it asks for a password, that means password less authentication is not working.
ssh -i /var/versa/vnms/ncs/homes/admin/.ssh/id_dsa admin@<appliance management IP>
In that case:
View Director SSH public keys:
cd /var/versa/vnms/ncs/homes/admin/.ssh/
cat id_dsa.pub
cat id_rsa.pub
The keys above must match the authorized_keys file on the branch/appliance:
cat /home/admin/.ssh/authorized_keys
If the keys do not match, push the keys from the Director shell:
/opt/versa/vnms/scripts/push_keys_to_device.sh <appliance IP> <admin password>
Check whether the admin account is locked on the appliance (run from the appliance shell prompt):
[admin@HubController1: ~] $ cat /etc/passwd | grep admin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
admin:x:1001:1000::/home/admin:/usr/sbin/nologin <<<< Means it is LOCKED
aaaadmin:x:1002:1000::/home/aaaadmin:/bin/bash
If the admin account is locked, unlock it with the following command:
sudo usermod -s /bin/bash admin
Check the following:
For string entries, verify that the entry is the expected fully qualified domain name.
For patterns entries, validate the regular expression independently before testing it on the appliance.
To view the content of a URL file associated with a URL Category, use the following procedure:
Syntax:
show urlf config detail url-category user-defined
<tenant_name-id> <scan_context> <url_category_name>
Tip: Type ? for tenant_name-ID and scan_context to see available options. For scan_context, choose the latest value.
Example — connect to vsmd and run the show command:
vsh connect vsmd
show urlf config detail url-category user-defined Suborg1-2 Suborg1-2.20 Allow-URL-List
Example output:
User defined URL Category Name : Allow-URL-List
User defined URL Category ID : 132
Number of URL strings to match : 0
Number of URL patterns to match : 8
-------------------------------------------------------------------------
URL Match Type URL Reputation URL Pattern/String
-------------------------------------------------------------------------
regex 1 .*microsoft.com
regex 1 .*microsoft.net.*
regex 1 .*microsoft365.*
regex 1 .*microsoft365.com.*
regex 1 .*microsoftonline.com.*
regex 1 .*msftconnecttest.com.*
regex 1 login.microsoft.com
regex 1 www.msftconnecttest.com
A valid URL File alone does not enforce a policy. The URL File must be associated with a URL Category, and the resulting category must participate in the URL-Filtering and security-policy configuration.