Skip to main content

URL Category

Custom URL categories define lists of URLs or URL category matches for use in security policies and URL filtering profiles. The scm CLI provides commands to create, update, delete, and load custom URL categories.

Overview

The url-category commands allow you to:

  • Create custom URL categories with URL lists or category matches
  • Update existing category configurations
  • Delete categories that are no longer needed
  • Bulk import categories from YAML files
  • Export categories for backup or migration

Category Types

TypeDescription
URL ListDefine explicit URLs or URL patterns to match
Category MatchMatch against predefined URL category names

Set URL Category

Create or update a custom URL category.

Syntax

scm set security url-category NAME [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMECategory nameYes

Options

OptionDescriptionRequired
--folder TEXTFolder locationNo*
--snippet TEXTSnippet locationNo*
--device TEXTDevice locationNo*
--description TEXTDescriptionNo
--type TEXTType: "URL List" or "Category Match" (default: URL List)No
--url TEXTURL entries (can specify multiple)No

* One of --folder, --snippet, or --device is required.

Examples

Create URL List Category

$ scm set security url-category custom-block \
--folder Texas \
--url malware.example.com \
--url phishing.test.org
---> 100%
Created URL category: custom-block in folder Texas

Create Category Match Type

$ scm set security url-category match-category \
--folder Texas \
--type "Category Match" \
--url gambling \
--url adult
---> 100%
Created URL category: match-category in folder Texas

Delete URL Category

Delete a custom URL category from SCM.

Syntax

scm delete security url-category NAME [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMECategory name to deleteYes

Options

OptionDescriptionRequired
--folder TEXTFolder locationNo*
--snippet TEXTSnippet locationNo*
--device TEXTDevice locationNo*
--forceSkip confirmation promptNo

* One of --folder, --snippet, or --device is required.

Example

$ scm delete security url-category custom-block \
--folder Texas \
--force
---> 100%
Deleted URL category: custom-block from folder Texas

Load URL Category

Load multiple custom URL categories from a YAML file.

Syntax

scm load security url-category [OPTIONS]

Options

OptionDescriptionRequired
--file TEXTPath to YAML file containing category definitionsYes
--folder TEXTOverride folder location for all categoriesNo
--snippet TEXTOverride snippet location for all categoriesNo
--device TEXTOverride device location for all categoriesNo
--dry-runPreview changes without applying themNo

YAML File Format

---
url_categories:
- name: custom-block
folder: Texas
description: "Blocked URL list"
type: "URL List"
url:
- malware.example.com
- phishing.test.org

- name: match-category
folder: Texas
description: "Category match filter"
type: "Category Match"
url:
- gambling
- adult

Examples

Load with Original Locations

$ scm load security url-category \
--file url-categories.yaml
---> 100%
✓ Loaded URL category: custom-block
✓ Loaded URL category: match-category

Successfully loaded 2 out of 2 URL categories from 'url-categories.yaml'

Load with Folder Override

$ scm load security url-category \
--file url-categories.yaml \
--folder Austin
---> 100%
✓ Loaded URL category: custom-block
✓ Loaded URL category: match-category

Successfully loaded 2 out of 2 URL categories from 'url-categories.yaml'
note

When using container override options (--folder, --snippet, --device), all categories will be loaded into the specified container, ignoring the container specified in the YAML file.

Show URL Category

Display custom URL category objects.

Syntax

scm show security url-category [NAME] [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMECategory name to display; omit to list allNo

Options

OptionDescriptionRequired
--folder TEXTFolder locationNo*
--snippet TEXTSnippet locationNo*
--device TEXTDevice locationNo*
--output, -o [table|json|yaml]Output format (default: table)No
--max-results INTEGERMaximum number of results to displayNo

* One of --folder, --snippet, or --device is required.

note

When no NAME is specified, all items are listed by default.

Examples

Show Specific Category

$ scm show security url-category custom-block \
--folder Texas
---> 100%
URL Category: custom-block
Location: Folder 'Texas'
Type: URL List
URLs: malware.example.com, phishing.test.org

List All Categories (Default Behavior)

$ scm show security url-category --folder Texas
---> 100%
URL Categories in folder 'Texas':
------------------------------------------------------------
Name: custom-block
Type: URL List
URLs: 2 entries
------------------------------------------------------------
Name: match-category
Type: Category Match
URLs: gambling, adult
------------------------------------------------------------

Backup URL Categories

Backup all custom URL category objects from a specified location to a YAML file.

Syntax

scm backup security url-category [OPTIONS]

Options

OptionDescriptionRequired
--folder TEXTFolder to backup categories fromNo*
--snippet TEXTSnippet to backup categories fromNo*
--device TEXTDevice to backup categories fromNo*
--file TEXTOutput filename (defaults to auto-generated)No

* One of --folder, --snippet, or --device is required.

Examples

Backup from Folder

$ scm backup security url-category --folder Texas
---> 100%
Successfully backed up 6 URL categories to url_category_folder_texas_20240115_120530.yaml

Backup with Custom Filename

$ scm backup security url-category \
--folder Texas \
--file texas-url-categories.yaml
---> 100%
Successfully backed up 6 URL categories to texas-url-categories.yaml

Best Practices

  1. Use URL Lists for Specific Sites: Create URL List categories for explicit domain blocking or allowing of known sites.
  2. Use Category Match for Broad Filtering: Use Category Match type to reference predefined categories in custom policies.
  3. Descriptive Names: Name categories to clearly indicate their purpose (e.g., blocked-malware-sites, allowed-business-apps).
  4. Reference in URL Access Profiles: Combine custom URL categories with URL access profiles for granular filtering control.
  5. Backup Before Changes: Always backup existing categories before making bulk modifications via load commands.