Update the comment on a security policy version

Overview

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.


Before you begin

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 NginxDefaultPolicy or NginxStrictPolicy policies.

  1. Log in to NGINX Instance Manager.
  2. From the Launchpad, select NGINX Instance Manager.
  3. Select WAF > Policies.
  4. Select Create to create a new policy, or select Edit from the Actions column for the policy you want to update.
  5. Make your changes in the policy editor.
  6. Select Save & Add Comment. The Add Comment dialog opens and shows the policy name and version number.
  7. Enter a comment in the Comment box, then select Save. A counter shows how many of the 150 characters you’ve used.

  1. Select WAF > Policies, then select the policy.
  2. Select the Versions tab.
  3. Select Edit Comment from the Actions column for the version you want to update. The Edit Comment dialog opens and shows the current comment.
  4. 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}

  1. 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 versionNumber you want in the response, then use its uid value. A version label such as v2 isn’t the UID.

  2. Send a PATCH request 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 200 and the updated policy version metadata.

Send a PATCH request with an empty versionComment value:

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":""}'

See also