Skip to main content

Authentication Rule

Authentication rules enforce user authentication before allowing access to network resources. The scm CLI provides commands to create, update, delete, move, and load authentication rules.

Overview

The authentication-rule commands allow you to:

  • Create authentication rules with zone, service, and category matching
  • Update existing rule configurations and authentication enforcement profiles
  • Delete rules that are no longer needed
  • Move rules to control processing order
  • Bulk import rules from YAML files
  • Export rules for backup or migration

Set Authentication Rule

Create or update an authentication rule.

Syntax

scm set security authentication-rule NAME [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMERule nameYes

Options

OptionDescriptionRequired
--folder TEXTFolder locationNo*
--snippet TEXTSnippet locationNo*
--device TEXTDevice locationNo*
--rulebase TEXTRulebase (pre, post, default)No
--description TEXTDescriptionNo
--source-zones TEXTSource zonesNo
--destination-zones TEXTDestination zonesNo
--service TEXTServicesNo
--category TEXTURL categoriesNo
--authentication-enforcement TEXTAuthentication profileNo
--disabledDisable the ruleNo
--tags TEXTTagsNo

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

Examples

Create Basic Authentication Rule

$ scm set security authentication-rule auth-web \
--folder Texas \
--source-zones trust \
--destination-zones untrust \
--authentication-enforcement my-auth-profile
---> 100%
Created authentication rule: auth-web in folder Texas

Create Rule with Service and Category

$ scm set security authentication-rule auth-sensitive \
--folder Texas \
--source-zones trust \
--destination-zones dmz \
--service "service-https" \
--category "financial-services" \
--authentication-enforcement strict-auth \
--description "Authenticate before accessing sensitive resources"
---> 100%
Created authentication rule: auth-sensitive in folder Texas

Move Authentication Rule

Change the position of an authentication rule. Rules are processed in order from top to bottom.

Syntax

scm move security authentication-rule NAME [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMEName of the rule to moveYes

Options

OptionDescriptionRequired
--folder TEXTFolder containing the ruleNo*
--snippet TEXTSnippet containing the ruleNo*
--device TEXTDevice containing the ruleNo*
--destination TEXTWhere to move (top, bottom, before, after)Yes
--destination-rule TEXTUUID of the reference rule (required with before/after)No**
--rulebase TEXTRulebase (pre or post; default: pre)No

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

** Required when --destination is before or after.

Examples

Move Rule to Top

$ scm move security authentication-rule auth-sensitive \
--folder Texas \
--destination top
---> 100%
Moved authentication rule: auth-sensitive to top in folder Texas

Move Rule Before Another Rule

$ scm move security authentication-rule auth-web \
--folder Texas \
--destination before \
--destination-rule 123e4567-e89b-12d3-a456-426614174000
---> 100%
Moved authentication rule: auth-web before rule 123e4567-e89b-12d3-a456-426614174000 in folder Texas

Delete Authentication Rule

Delete an authentication rule from SCM.

Syntax

scm delete security authentication-rule NAME [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMERule name to deleteYes

Options

OptionDescriptionRequired
--folder TEXTFolder locationNo*
--snippet TEXTSnippet locationNo*
--device TEXTDevice locationNo*
--rulebase TEXTRulebase to use (pre, post, or default; default: pre)No
--forceSkip confirmation promptNo

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

Example

$ scm delete security authentication-rule auth-web \
--folder Texas \
--force
---> 100%
Deleted authentication rule: auth-web from folder Texas

Load Authentication Rule

Load multiple authentication rules from a YAML file.

Syntax

scm load security authentication-rule [OPTIONS]

Options

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

YAML File Format

---
authentication_rules:
- name: auth-web
folder: Texas
description: "Authenticate web traffic"
source_zones:
- trust
destination_zones:
- untrust
authentication_enforcement: my-auth-profile

- name: auth-sensitive
folder: Texas
description: "Authenticate before accessing sensitive resources"
source_zones:
- trust
destination_zones:
- dmz
service:
- service-https
category:
- financial-services
authentication_enforcement: strict-auth

Examples

Load with Original Locations

$ scm load security authentication-rule \
--file auth-rules.yaml
---> 100%
✓ Loaded authentication rule: auth-web
✓ Loaded authentication rule: auth-sensitive

Successfully loaded 2 out of 2 authentication rules from 'auth-rules.yaml'

Load with Folder Override

$ scm load security authentication-rule \
--file auth-rules.yaml \
--folder Austin
---> 100%
✓ Loaded authentication rule: auth-web
✓ Loaded authentication rule: auth-sensitive

Successfully loaded 2 out of 2 authentication rules from 'auth-rules.yaml'
note

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

Show Authentication Rule

Display authentication rule objects.

Syntax

scm show security authentication-rule [NAME] [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMERule name to display; omit to list allNo

Options

OptionDescriptionRequired
--folder TEXTFolder locationNo*
--snippet TEXTSnippet locationNo*
--device TEXTDevice locationNo*
--rulebase TEXTRulebase to use (pre, post, or default; default: pre)No
--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 Rule

$ scm show security authentication-rule auth-web \
--folder Texas
---> 100%
Authentication Rule: auth-web
Location: Folder 'Texas'
Source Zones: trust
Destination Zones: untrust
Authentication Enforcement: my-auth-profile

List All Rules (Default Behavior)

$ scm show security authentication-rule --folder Texas
---> 100%
Authentication Rules in folder 'Texas':
------------------------------------------------------------
Name: auth-web
Source Zones: trust
Destination Zones: untrust
Authentication Enforcement: my-auth-profile
------------------------------------------------------------
Name: auth-sensitive
Source Zones: trust
Destination Zones: dmz
Authentication Enforcement: strict-auth
------------------------------------------------------------

Backup Authentication Rules

Backup all authentication rule objects from a specified location to a YAML file.

Syntax

scm backup security authentication-rule [OPTIONS]

Options

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

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

Examples

Backup from Folder

$ scm backup security authentication-rule --folder Texas
---> 100%
Successfully backed up 6 authentication rules to authentication_rule_folder_texas_20240115_120530.yaml

Backup with Custom Filename

$ scm backup security authentication-rule \
--folder Texas \
--file texas-auth-rules.yaml
---> 100%
Successfully backed up 6 authentication rules to texas-auth-rules.yaml

Best Practices

  1. Match Specific Traffic: Define source zones, destination zones, and services to target authentication requirements to specific traffic flows.
  2. Order Rules Carefully: Place more specific authentication rules above general ones since rules are processed top to bottom.
  3. Use Authentication Enforcement Profiles: Reference pre-configured authentication profiles to ensure consistent authentication behavior.
  4. Use Category Matching: Combine URL categories with authentication rules for context-aware authentication requirements.
  5. Backup Before Changes: Always backup existing rules before making bulk modifications via load commands.