update_firewall_policy
Modify specific fields of an existing firewall policy, such as source/destination addresses, services, or action, while leaving other settings unchanged.
Instructions
Update an existing firewall policy.
Only the specified fields will be updated; other fields remain unchanged.
Args:
adom: ADOM name
package: Policy package name
policyid: Policy ID to update
name: New policy name (optional)
srcintf: New source interfaces (optional)
dstintf: New destination interfaces (optional)
srcaddr: New source addresses (optional)
dstaddr: New destination addresses (optional)
service: New services (optional)
action: New action - "accept" or "deny" (optional)
schedule: New schedule (optional)
nat: Enable/disable NAT (optional)
logtraffic: New log mode (optional)
status: New status (optional)
comments: New comments (optional)
global_label: Policy section label (optional)
global_label_color: Policy section color ID 0-31 (optional)
srcaddr_negate: Match all sources EXCEPT srcaddr (optional; None
leaves the field untouched, like every other optional field)
dstaddr_negate: Match all destinations EXCEPT dstaddr (optional)
service_negate: Match all services EXCEPT service (optional)
utm_status: Enable/disable security profile inspection (optional)
av_profile: Antivirus profile name (optional)
ips_sensor: IPS sensor name (optional)
webfilter_profile: Web filter profile name (optional)
dnsfilter_profile: DNS filter profile name (optional)
application_list: Application control list name (optional)
file_filter_profile: File filter profile name (optional)
ssl_ssh_profile: SSL/SSH inspection profile name (optional)
profile_protocol_options: Protocol options profile name (optional).
Mutually exclusive with profile_group in the same call -- it is
itself a member of the FortiOS firewall profile-group object
profile_group: Security profile group name (optional). Mutually
exclusive with av_profile, ips_sensor, webfilter_profile,
dnsfilter_profile, application_list, file_filter_profile,
ssl_ssh_profile, and profile_protocol_options in the same call
Note:
Sending any individual security-profile field (av_profile,
ssl_ssh_profile, profile_protocol_options, etc.) on a policy that is
currently in group mode flips profile-type to "single" on the
appliance. The previously-stored profile-group value becomes
dormant (not deleted) rather than staying active alongside the new
field -- FortiOS only honors one profile-type at a time.
Returns: dict: Update result with keys: - status: "success" or "error" - policyid: Updated policy ID - message: Status or error message
Example: >>> # Disable a policy >>> result = await update_firewall_policy( ... adom="root", ... package="default", ... policyid=10, ... status="disable" ... )
>>> # Update source addresses
>>> result = await update_firewall_policy(
... adom="root",
... package="default",
... policyid=10,
... srcaddr=["New-Subnet", "Other-Subnet"]
... )
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"adom": "<adom>",
"package": "<package>",
"policyid": "<policyid>"
},
"name": "update_firewall_policy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nat | No | ||
| adom | Yes | ||
| name | No | ||
| action | No | ||
| status | No | ||
| dstaddr | No | ||
| dstintf | No | ||
| package | Yes | ||
| service | No | ||
| srcaddr | No | ||
| srcintf | No | ||
| comments | No | ||
| policyid | Yes | ||
| schedule | No | ||
| av_profile | No | ||
| ips_sensor | No | ||
| logtraffic | No | ||
| utm_status | No | ||
| global_label | No | ||
| profile_group | No | ||
| dstaddr_negate | No | ||
| service_negate | No | ||
| srcaddr_negate | No | ||
| ssl_ssh_profile | No | ||
| application_list | No | ||
| dnsfilter_profile | No | ||
| webfilter_profile | No | ||
| global_label_color | No | ||
| file_filter_profile | No | ||
| profile_protocol_options | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||