FortiManager icon

FortiManager

Interact with FortiManager API

Firewall → Create Policy

AI-generated

Summary

Create a firewall policy in the specified Policy Manager domain

Inputs

  • domain (required) — Domain of FortiManager API to operate on
  • adom (required) — Administrative Domain name
  • packageName (required) — Name of the policy package
  • policyName (required) — Name of the firewall policy
  • srcintf (required) — Comma-separated list of source interface names (e.g., "port1,port2" or "any")
  • dstintf (required) — Comma-separated list of destination interface names (e.g., "port3,port4" or "any")
  • srcaddr (required) — Comma-separated list of source address object names (e.g., "all,subnet1")
  • dstaddr (required) — Comma-separated list of destination address object names (e.g., "all,subnet2")
  • service (required) — Comma-separated list of service object names (e.g., "ALL,HTTP,HTTPS")
  • action (required) — Action to take when policy matches
  • policyid — Specific policy ID (leave 0 for auto-assignment)
  • status — Enable or disable the policy
  • schedule — Schedule object name (default: "always")
  • nat — Enable or disable NAT
  • poolname — Comma-separated list of IP pool names (when IP Pool is enabled)
  • comments — Comments for the policy
  • logtraffic — Log traffic matching this policy
  • av_profile — Antivirus profile name
  • webfilter_profile — Web filter profile name
  • ips_sensor — IPS sensor name
  • application_list — Application control list name
  • ssl_ssh_profile — SSL/SSH inspection profile name

Output shape

a single policy object

Returns the created policy details; may include error information if creation fails

Examples

Example 1: Create a deny policy on port1 to port2 for HTTP traffic

domain=pm,adom=root,packageName=policy1,policyName=block_http,srcintf=port1,dstintf=port2,service=HTTP,action=deny

Discussion