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

"code" value in /declare response is not always numeric

Open JoeBenner opened this issue 4 years ago • 1 comments

Environment

  • Application Services Version: (probably N/A) but repro is on 3.26.0-5
  • BIG-IP Version: (also probably N/A) 16.0.0.12

Summary

There are situations where AS3 returns a non-numeric value for "code". A pretty clean repro is to have an invalid (404) url in a "url" property for a WAF_Policy. This response is from a direct POST to /declare on BIG-IP. When we send the same declaration from BIG-IQ it really messes with our java code.

    {
            "code": "ERR_REQUEST_FAILED",
            "message": "declaration failed",
            "response": "GET https://raw.githubusercontent.com/f5devcentral/f5-asm-policy-templates/master/owasp_ready_template/owasp-auto-tune-v1.1.xmx get asm policy WAF_Policy from url response=404 body=404: Not Found",
            "host": "localhost",
            "tenant": "TestTenant",
            "runTime": 570
        }

Steps To Reproduce

  1. Submit the following declaration (note the url is invalid - ends in xmx not xml)
  2. :
{
    "class": "AS3",
    "action": "deploy",
    "declaration": {
        "class": "ADC",
        "schemaVersion": "3.12.0",
        "id": "xxx",
        "TestTenant": {
            "class": "Tenant",
            "TestApp": {
                "class": "Application",
                "serviceMain": {
                    "class": "Service_Generic",
                    "policyWAF": {
                        "use": "WAF_Policy"
                    },
                    "snat": "auto",
                    "virtualPort": 80,
                    "virtualAddresses": [
                        "10.21.102.2"
                    ]
                },
                "WAF_Policy": {
                    "url": {
                        "url": "https://raw.githubusercontent.com/f5devcentral/f5-asm-policy-templates/master/owasp_ready_template/owasp-auto-tune-v1.1.xmx"
                    },
                    "enforcementMode": "transparent",
                    "class": "WAF_Policy"
                }
            }
        }
    }
}
  1. Observe the following error response:
    {
            "code": "ERR_REQUEST_FAILED",
            "message": "declaration failed",
            "response": "GET https://raw.githubusercontent.com/f5devcentral/f5-asm-policy-templates/master/owasp_ready_template/owasp-auto-tune-v1.1.xmx get asm policy WAF_Policy from url response=404 body=404: Not Found",
            "host": "localhost",
            "tenant": "TestTenant",
            "runTime": 570
        }

Expected Behavior

A numeric value in "code"

Actual Behavior

A non-numeric value in "code"

JoeBenner avatar Apr 19 '21 16:04 JoeBenner

Thank you for reporting this. I have confirmed the bug and added to our internal product backlog as AUTOTOOL-2447.

dstokesf5 avatar Apr 20 '21 22:04 dstokesf5

If you are still looking for a fix, please reach out to us at [email protected]

sunitharonan avatar Oct 25 '22 18:10 sunitharonan

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

github-actions[bot] avatar Nov 24 '22 19:11 github-actions[bot]