Forum Discussion

quangtran's avatar
quangtran
Icon for Cirrus rankCirrus
Nov 16, 2023

ASM - Adding Allowed URL's via CLI in 2023

Hello everyone, I've read this topic : https://community.f5.com/t5/technical-forum/asm-adding-allowed-url-s-via-cli/td-p/29130. Is there any feasible way in 2023 to add the Allow URL through the command line interface (CLI) or some faster method than the graphical user interface (GUI)?

  • You can use the iControl REST API. I use it extensively to configure ASM and besides it is a bit slow, it works like a charme.

    For URLs this should work:

    Endpoint: /mgmt/tm/asm/policies/<policy hash>/urls
    Method: POST
    Payload:
    {
    "disallowFileUploadOfExecutables" : false,
    "isAllowed" : false,
    "mandatoryBody" : false,
    "metacharsOnUrlCheck" : false,
    "method" : "*",
    "name" : "/my-allowed-url",
    "protocol" : "http",
    "type" : "explicit"
    }

    An other option is the policy creation / maintenance thorugh the declarative API.

  • You can use the iControl REST API. I use it extensively to configure ASM and besides it is a bit slow, it works like a charme.

    For URLs this should work:

    Endpoint: /mgmt/tm/asm/policies/<policy hash>/urls
    Method: POST
    Payload:
    {
    "disallowFileUploadOfExecutables" : false,
    "isAllowed" : false,
    "mandatoryBody" : false,
    "metacharsOnUrlCheck" : false,
    "method" : "*",
    "name" : "/my-allowed-url",
    "protocol" : "http",
    "type" : "explicit"
    }

    An other option is the policy creation / maintenance thorugh the declarative API.