Updating a Policy with the REST API

Veracode APIs

This use case scenario provides the Policy REST API command and payload for updating a security policy.

Use this command to update a policy:
http --auth-type=veracode_hmac PUT “https://api.veracode.com/appsec/v1/policies/{policyGuid}” < updated_policy.json”
The API passes the JSON file that you populate with the necessary values as shown in this example:
{
        "name": "TestPolicy",
        "type": "CUSTOMER",
        "description": "Policy to test updating endpoint in end-to-end testing",
        "vendor_policy": false,
        "finding_rules": [
          {
             "type": "MAX_SEVERITY",
             "scan_type": [
                  "DYNAMIC",
                  "MANUAL",
                  "STATIC"
             ],
             "value": "4"
          }
             ],
           "type": "BLACKLIST",
           "scan_type": [
                "SCA"
             ],
            "value": "14212"
}

The example payload specifies to update an existing policy with a new name and to change the finding-severity rating of the MAX_SEVERITY rule to 4. Policy API Rules Properties describes each of the rule properties.