create_dfw_rule
Create a distributed firewall rule under an existing DFW security policy. Set policy ID, rule ID, display name, and optional sources, destinations, services, and action to control traffic.
Instructions
[WRITE] Create a firewall rule under an existing DFW security policy.
Returns the created rule dict (id, path, action, ...), else {"error", "hint"}; a bad action/direction/ip_protocol lists the valid values. PUT semantics: reusing a rule_id overwrites that rule, enforced immediately unless disabled=True. Pick policy_id with list_dfw_policies first; prefer update_dfw_rule to edit one and delete_dfw_rule to remove one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | Applied-to group/segment paths; omit for the whole DFW. | |
| action | No | ALLOW, DROP, REJECT or JUMP_TO_APPLICATION (default ALLOW); JUMP_TO_APPLICATION needs an Environment policy. | ALLOW |
| logged | No | Log matched traffic (default False). | |
| target | No | Target name from config; default if omitted. | |
| rule_id | Yes | Unique rule id within that policy. | |
| sources | No | Source group paths like ['/infra/domains/default/groups/web']; omit for any. | |
| disabled | No | Create the rule unenforced (default False). | |
| services | No | Service paths; omit for all. | |
| direction | No | IN, OUT or IN_OUT (default IN_OUT). | IN_OUT |
| policy_id | Yes | Parent policy id, from list_dfw_policies. | |
| description | No | Optional free text. | |
| ip_protocol | No | IPV4, IPV6 or IPV4_IPV6 (default IPV4_IPV6). | IPV4_IPV6 |
| destinations | No | Destination group paths; omit for any. | |
| display_name | Yes | Human-readable name. | |
| sequence_number | No | Priority; lower matches first (default 10). |