Address Objects¶
Address objects are used to identify network addresses in security policies, NAT rules, and other configurations. The scm
CLI provides commands to create, update, delete, and load address objects.
Address Types¶
The CLI supports four types of address objects:
Type | Format | Example |
---|---|---|
IP Netmask | IP address with CIDR notation | 192.168.1.0/24 |
IP Range | Range of IP addresses | 192.168.1.1-192.168.1.10 |
IP Wildcard | IP with wildcard mask | 10.20.1.0/0.0.248.255 |
FQDN | Fully qualified domain name | example.com |
Note
You can only specify one address type per address object.
Set Address¶
Create or update an address object.
Syntax¶
Options¶
Option | Description | Required |
---|---|---|
--folder TEXT | Folder for the address object | Yes |
--name TEXT | Name of the address object | Yes |
--description TEXT | Description for the address | No |
--tags LIST | List of tags to apply to the address | No |
--ip-netmask TEXT | Address in CIDR notation | No* |
--ip-range TEXT | Address range | No* |
--ip-wildcard TEXT | Address with wildcard mask | No* |
--fqdn TEXT | Fully qualified domain name | No* |
* You must specify exactly one of the address type options.
Examples¶
Create an IP Netmask Address¶
$ scm set object address \
--folder Texas \
--name webserver \
--ip-netmask 192.168.1.100/32 \
--description "Web server" \
--tags ["server", "web"]
---> 100%
Created address: webserver in folder Texas
Create an FQDN Address¶
$ scm set object address \
--folder Texas \
--name company-website \
--fqdn example.com \
--description "Company website"
---> 100%
Created address: company-website in folder Texas
Create an IP Range Address¶
$ scm set object address \
--folder Texas \
--name dhcp-pool \
--ip-range 192.168.1.100-192.168.1.200 \
--description "DHCP address pool"
---> 100%
Created address: dhcp-pool in folder Texas
Delete Address¶
Delete an address object from SCM.
Syntax¶
Options¶
Option | Description | Required |
---|---|---|
--folder TEXT | Folder containing the address object | Yes |
--name TEXT | Name of the address object to delete | Yes |
Example¶
$ scm delete object address --folder Texas --name webserver
---> 100%
Deleted address: webserver from folder Texas
Load Addresses¶
Load multiple address objects from a YAML file.
Syntax¶
Options¶
Option | Description | Required |
---|---|---|
--file TEXT | Path to YAML file containing address definitions | Yes |
--folder TEXT | Override folder location for all objects | No |
--snippet TEXT | Override snippet location for all objects | No |
--device TEXT | Override device location for all objects | No |
--dry-run | Preview changes without applying them | No |
YAML File Format¶
---
addresses:
- name: web-server-1
folder: Texas # Container location (folder, snippet, or device)
description: "Web Server 1"
ip_netmask: 192.168.1.10/32
tags:
- web
- production
- name: web-server-2
folder: Texas
description: "Web Server 2"
ip_netmask: 192.168.1.11/32
tags:
- web
- production
- name: database-server
folder: Texas
description: "Database Server"
ip_netmask: 192.168.2.10/32
tags:
- database
- production
- name: company-website
folder: Texas
description: "Company Website"
fqdn: example.com
tags:
- web
- external
Examples¶
Load with Original Locations¶
$ scm load object address --file addresses.yml
---> 100%
✓ Loaded address: web-server-1
✓ Loaded address: web-server-2
✓ Loaded address: database-server
✓ Loaded address: company-website
Successfully loaded 4 out of 4 addresses from 'addresses.yml'
Load with Folder Override¶
$ scm load object address --file addresses.yml --folder Austin
---> 100%
✓ Loaded address: web-server-1
✓ Loaded address: web-server-2
✓ Loaded address: database-server
✓ Loaded address: company-website
Successfully loaded 4 out of 4 addresses from 'addresses.yml'
Note
When using container override options (--folder, --snippet, --device), all addresses will be loaded into the specified container, ignoring the container specified in the YAML file.
Show Address¶
Display address objects.
Syntax¶
Options¶
Option | Description | Required |
---|---|---|
--folder TEXT | Folder containing the address object | Yes |
--name TEXT | Name of the address object to show | No |
* If --name is not specified, all items will be listed.
Examples¶
Show Specific Address¶
$ scm show object address --folder Texas --name webserver
---> 100%
Address: webserver
Location: Folder 'Texas'
Description: Web server
Type: IP/Netmask
Value: 192.168.1.100/32
Tags: server, web
ID: 123e4567-e89b-12d3-a456-426614174000
List All Addresses (Default Behavior)¶
$ scm show object address --folder Texas
---> 100%
Addresses in folder 'Texas':
------------------------------------------------------------
Name: webserver
Location: Folder 'Texas'
Description: Web server
Type: IP/Netmask
Value: 192.168.1.100/32
Tags: server, web
------------------------------------------------------------
Name: company-website
Location: Folder 'Texas'
Description: Company website
Type: FQDN
Value: example.com
Tags: web, external
------------------------------------------------------------
Name: dhcp-pool
Location: Folder 'Texas'
Description: DHCP address pool
Type: IP Range
Value: 192.168.1.100-192.168.1.200
------------------------------------------------------------
Backup Addresses¶
Backup all address objects from a specified location to a YAML file.
Syntax¶
Options¶
Option | Description | Required |
---|---|---|
--folder TEXT | Folder to backup addresses from | No* |
--snippet TEXT | Snippet to backup addresses from | No* |
--device TEXT | Device to backup addresses from | No* |
--file TEXT | Output filename (defaults to auto-generated) | No |
* You must specify exactly one of --folder, --snippet, or --device.
Examples¶
Backup from Folder¶
$ scm backup object address --folder Texas
---> 100%
Successfully backed up 15 addresses to address_folder_texas_20240115_120530.yaml
Backup with Custom Filename¶
$ scm backup object address --folder Texas --file texas-addresses.yaml
---> 100%
Successfully backed up 15 addresses to texas-addresses.yaml
Best Practices¶
- Use Descriptive Names: Choose clear, descriptive names for address objects
- Add Descriptions: Always include a description to document the purpose of each address
- Apply Tags: Use tags to categorize addresses for easier management and policy creation
- Use YAML for Bulk Operations: For large deployments, use YAML files to manage address objects
- Validate First: Use the
--dry-run
option to preview changes before applying them - Organize by Folder: Keep address objects organized in logical folders