Update the comment on a security policy version
Use this guide to add, edit, or clear the comment on a version of an F5 WAF for NGINX security policy. A comment helps you track why you created or changed that version.
When you update a comment, the policy content and version number stay the same. F5 NGINX Instance Manager doesn’t create a new version. To change the policy content itself, see Update a security policy.
Make sure you have permission to update security policies. Keep these limits in mind:
- A comment can contain up to 150 Unicode code points.
- You can’t change the comment on the built-in
NginxDefaultPolicyorNginxStrictPolicypolicies.
- Log in to NGINX Instance Manager.
- From the Launchpad, select NGINX Instance Manager.
- Select WAF > Policies.
- Select Create to create a new policy, or select Edit from the Actions column for the policy you want to update.
- Make your changes in the policy editor.
- Select Save & Add Comment. The Add Comment dialog opens and shows the policy name and version number.
- Enter a comment in the Comment box, then select Save. A counter shows how many of the 150 characters you’ve used.
- Select WAF > Policies, then select the policy.
- Select the Versions tab.
- Select Edit Comment from the Actions column for the version you want to update. The Edit Comment dialog opens and shows the current comment.
- Edit the text in the Comment box, then select Save. A counter shows how many of the 150 characters you’ve used. To clear the comment, remove its text and select Save.
If a policy has more than 100 versions, NGINX Instance Manager warns that memory usage might increase. To reduce memory usage, delete unused versions or increase available memory. This warning doesn’t block you from creating new versions.
Use PATCH to update the comment on a specific policy version.
| Method | Endpoint |
|---|---|
| PATCH | /api/platform/v1/security/policies/{securityPolicyUID} |
-
Get the unique identifier (UID) of the policy version you want to update:
shell curl -G 'https://<NIM_FQDN>/api/platform/v1/security/policies' \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ --data-urlencode 'versions=<POLICY_NAME>'Find the
versionNumberyou want in the response, then use itsuidvalue. A version label such asv2isn’t the UID. -
Send a
PATCHrequest with the new comment:shell curl -X PATCH 'https://<NIM_FQDN>/api/platform/v1/security/policies/<POLICY_VERSION_UID>' \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{"versionComment":"Prepared for production rollout"}'Replace
<NIM_FQDN>with your NGINX Instance Manager host,<ACCESS_TOKEN>with your access token, and<POLICY_VERSION_UID>with the UID of the version you want to update.A successful request returns HTTP
200and the updated policy version metadata.
Send a PATCH request with an empty versionComment value:
curl -X PATCH 'https://<NIM_FQDN>/api/platform/v1/security/policies/<POLICY_VERSION_UID>' \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"versionComment":""}'