f5-appsvcs-extension icon indicating copy to clipboard operation
f5-appsvcs-extension copied to clipboard

WAF Policy Encoding always set to default w/AS3 but works w/tmsh

Open joelkeener opened this issue 4 years ago • 0 comments

Describe the solution you'd like

It is not possible to set a WAF Policy encoding with AS3 like you can with tmsh.

Describe alternatives you've considered

For now there is no alternative. We are not able to set this in any new FAST template, like you could with iApp templates.

Additional context

AS3 does provide a way of updating the encoding on an ASM policy via text (json string assigned to the policy attribute on a WAF_Policy) but encoding is always set to the default of utf-8 on the new asm policy.

Here is the tmsh that creates it [in /Common]: tmsh load asm policy c_WAF_policy file /var/tmp/wafPolicy.json overwrite

Here are the AS3 declarations that are not working when used with the following tmsh command after saving to /var/tmp/wafPolicy.json:

Without modifications set in the policy text's json string --

{
  "class": "ADC",
  "schemaVersion": "3.0.0",
  "id": "urn:uuid:a858e55e-bbe6-42ce-a9b9-0f4ab33e3bf7",
  "a": {
    "class": "Tenant",
    "b": {
      "class": "Application",
      "template": "generic",
      "c_waf_policy": {
        "class": "WAF_Policy",
        "policy": {
          "text": "{ \"policy\": { \"encoding\": \"gbk\", \"template\": { \"name\": \"POLICY_TEMPLATE_RAPID_DEPLOYMENT\" } } }"
        },
        "ignoreChanges": true
      }
    }
  }
} 

With modifications set in the policy text's json string --

{
  "class": "ADC",
  "schemaVersion": "3.0.0",
  "id": "urn:uuid:a858e55e-bbe6-42ce-a9b9-0f4ab33e3bf7",
  "a": {
    "class": "Tenant",
    "b": {
      "class": "Application",
      "template": "generic",
      "c_waf_policy": {
        "class": "WAF_Policy",
        "policy": {
          "text": "{ \"policy\": { \"encoding\": \"gbk\", \"template\": { \"name\": \"POLICY_TEMPLATE_RAPID_DEPLOYMENT\" }, \"modifications\": [ { \"encoding\": \"gbk\" } ] } }"
        },
        "ignoreChanges": true
      }
    }
  }
} 

joelkeener avatar Nov 19 '21 20:11 joelkeener