Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

ASM - Adding Allowed URL's via CLI in 2023

quangtran
Cirrus
Cirrus

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)?

1 ACCEPTED SOLUTION

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.

View solution in original post

2 REPLIES 2

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.

Thank you, this is fantastic.