Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joelkeener opened this issue Nov 19, 2021 · 0 comments
Open

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

joelkeener opened this issue Nov 19, 2021 · 0 comments
Labels
enhancement New feature or request untriaged Issue needs to be reviewed for validity

Comments

@joelkeener
Copy link
Contributor

joelkeener commented Nov 19, 2021

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 joelkeener added enhancement New feature or request untriaged Issue needs to be reviewed for validity labels Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged Issue needs to be reviewed for validity
Projects
None yet
Development

No branches or pull requests

1 participant