Troubleshooting and Uploading URL Files


Troubleshooting and Uploading URL Files

 

1. Overview

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.

2. URL File Processing Workflow

The expected workflow is:

  1. Prepare and validate the CSV file.
  2. Upload the URL File to the Director.
  3. Upload the URL File to the target VOS appliance.
  4. Associate the URL File with a custom URL Category.
  5. Use the URL Category in the appropriate URL-Filtering profile and security policy.
  6. Verify the result using URL-filtering logs, statistics, and CLI commands.

 

3. URL File Format

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.

 

3.1  Supported URL Reputations

The supported reputation values range from safest to riskiest:

 

3.2  Examples

string,www.example.com,trustworthy

patterns,.*example.*,low_risk

patterns,.*versa-networks.*,trustworthy

3.3  Regular-Expression Escaping

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.

3.4  File Size Limit

A URL File can contain a maximum of 65,535 lines.

4. Uploading a URL File

4.1  Upload the File to the Director

From Director view:

  1. Select Configuration.
  2. Select Devices > Devices.
  3. Select the required organization.
  4. Select the target device. The view changes to Appliance view.
  5. Select Objects & Connectors > Objects > Custom Objects > URL File.
  6. Click Upload.
  7. Select the CSV file and verify that its contents follow the supported URL File format.
  8. Click OK.

Note At this stage the file is available on the Director but has not necessarily been uploaded to the VOS appliance.

 

4.2  Upload the File to the VOS Appliance

  1. From the URL File page, select the Appliance tab.
  2. Click Upload.
  3. In the Filename field, select the URL File that was uploaded to the Director.
  4. Click OK.

Note The file must be uploaded to the target appliance before it becomes available for use in URL Category configuration.

5. Associate the URL File with a Custom URL Category

  1. Select Objects & Connectors > Objects > Custom Objects > URL Categories.
  2. Create a new URL Category or edit an existing one.
  3. In the URL File field, select the URL File which was uploaded.
  4. Click OK.

The custom URL Category can then be used in URL-Filtering profiles and associated security policies.

6. Verify the Complete Configuration Chain

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

 

7. Troubleshooting URL Files

7.1  URL File Upload Fails

Check the following:

 

7.2  URL File Is Visible on the Director but Not on the Appliance

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

 

7.3  URL File Is Not Available in the URL Category

Check the following:

 

7.4  URL Does Not Match the URL File

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

 

7.5  URL Filtering Appears Not to Be Applied

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.