16-Nov-2023 00:06
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)?
Solved! Go to Solution.
16-Nov-2023 03:21 - edited 16-Nov-2023 03:23
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.
16-Nov-2023 03:21 - edited 16-Nov-2023 03:23
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.
16-Nov-2023 18:27
Thank you, this is fantastic.