Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Using Policy Controller API

 

The following sections provide usage examples for the various APIs defined in the Policy Controller API:

Note

For usage examples of the Config API, see Configuring Policy Controller API.

Site API Usage Examples

The following are usage examples for the Site API:

Usage Example 1 - Creating a site

where:

  • emsId is the device identifier from Security Director. You can use the Space REST API to obtain the device identifier using Device Management API.

  • feedSourceId is the skyATP realm and its value is NULL during the POST operation. When a site is associated to realms, you can update the site with feedSourceId.

  • The value of enrollStatus can be ENROLL_SUCCESS, ENROLL_FAILURE, DISENROLL_SUCCESS, or DISENROLL_FAILURE.

Usage Example 2 - Retrieving a site

Usage Example 3 - Updating a site based on siteId

Usage Example 4 - Retrieving the updated site to check if the updates are present

Usage Example 5 - Deleting a site

Policy Enforcement Group API Usage Examples

The following are usage examples for the Policy Enforcement Group API:

Usage Example 1 - Creating a new Policy Enforcement Group

where:

  • sites and addressGroups are mutually exclusive.

  • The value of addressGroups can be a single IP, an IP range, or an IP subnet.

  • If the value of groupType is IP, addressGroups are populated; if the value is LOCATION, sites are populated.

Usage Example 2 - Retrieving a specific policy enforcement group based on policyGroupId

Usage Example 3 - Updating a specific policy enforcement group based on policyGroupId

Usage Example 4 - Retrieving the updated policy enforcement group to check if the updates are present

Usage Example 5 - Deleting a policy enforcement group

Threat Policy API Usage Examples

The following are usage examples for the Threat Policy API:

Usage Example 1 - Creating a new Threat Policy

where:

  • The value of action can be PERMIT, LOG, BLOCK_DROP, BLOCK_CLOSE, or BLOCK_QUARANTINE.

  • The value of secondaryAction cab be LOG_ALL, LOG_BLOCKED, or NONE.

  • If you specify MALWARE as the feedType, SRX takes a single threat level threshold value, that is, it allows two actions — permit and block.

  • If you specify GEO_IP as the feedType, then the SRX Series device has no threshold and allows permit or block.

  • For deployStatus, you do not have to specify the values DRAFT, ANALYSIS_PROGRESS, READY_TO_DEPLOY, and DEPLOYED for POST and PUT operations.

Usage Example 2 - Updating a threat policy

Usage Example 3 - Retrieving a specific threat policy based on threatPolicyId

Usage Example 4 - Deleting a threat policy

Custom Feed API Usage Examples

The following are usage examples for the Custom Feed API:

Usage Example 1 - Creating a new CustomFeed

where:

  • The value of feedType can be Blacklist, Whitelist, or Dynamic-Address.

  • The value of content can be a list of IP addresses, an IP range, or a subnet for a Blacklist, Whitelist and, Dynamic-Address.

  • The value of inputType can be an IP, URL or a domain for a Blacklist, Whitelist and, Dynamic-Address.

Usage Example 2- Creating a new CustomFeed with Infected-Host feedtype

where:

  • The value of feedType is Infected-Hosts.

  • The value of content can be a list of IP addresses.

  • The value of inputType can be and an IP address.

Usage Example 3- Retrieving a specific custom feed based on CustomFeed Id

Usage Example 4 - Retrieving a specific infected-host custom feed based on CustomFeed Id

Usage Example 5- Retrieving the list of custom feeds

Usage Example 6- Updating a custom feed

Usage Example 7- Deleting a custom feed

Geo IP API Usage Examples

The following are usage examples for Geo IP API:

Usage Example 1 - Creating a new Geo IP

where:

  • The value of action can be BLOCK_INBOUND, BLOCK_OUTBOUND, or BLOCK_BOTH.

  • The value of secondaryAction can be LOG or NONE.

Note

The values for action and secondaryAction are only needed for SDSN.

Usage Example 2 - Retrieving a specific Geo IP based on geoIpId

Usage Example 3 - Retrieving the list of Geo IPs

Usage Example 4 - Deleting Geo IP

Log API Usage Examples

The following is a usage example for Log API:

Usage Example - Retrieving all log files in zip format