Update a security policy
You can update an existing F5 WAF for NGINX security policy using either the NGINX Instance Manager web interface or the REST API.
To update a policy in the web interface:
- In your browser, go to the FQDN for your NGINX Instance Manager host and log in.
- From the Launchpad, select Instance Manager.
- In the left menu, select WAF > Policies.
- On the Security Policies page, select Edit from the Actions column for the policy you want to update.
- The editor opens, allowing you to modify the policy as described in Create a security policy.
- After making your changes, select Save.
To update a policy using the REST API, send either a POST or PUT request to the Security Policies endpoint.
- Use
POSTwith theisNewRevision=trueparameter to create a new revision of an existing policy. - Use
PUTwith the policy UID to overwrite the existing version.
| Method | Endpoint |
|---|---|
| POST | /api/platform/v1/security/policies?isNewRevision=true |
| PUT | /api/platform/v1/security/policies/{policy_uid} |
Example using POST (create new revision):
curl -X POST https://{{NIM_FQDN}}/api/platform/v1/security/policies?isNewRevision=true \
-H "Authorization: Bearer <access token>" \
-H "Content-Type: application/json" \
-d @update-xss-policy.jsonExample using PUT (overwrite existing):
-
Retrieve the policy’s unique identifier (UID):
shell curl -X GET https://{{NIM_FQDN}}/api/platform/v1/security/policies \ -H "Authorization: Bearer <access token>" -
Include the UID in your
PUTrequest:shell curl -X PUT https://{{NIM_FQDN}}/api/platform/v1/security/policies/<policy-uid> \ -H "Authorization: Bearer <access token>" \ -H "Content-Type: application/json" \ -d @update-xss-policy.json
After updating the policy, you can publish it to selected instances or instance groups.