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

What is the iControlRest and curl to import the ASM policy

F5 Employee
F5 Employee

Hi folks, may I know what is the command for curl to import the API policy into ASM and and make it visible on GUI?

I have used the following curl and iControlRest to upload the xml policy file, the file could be seen inside /var/ts/var/rest directory, however the policy is not shown on the GUI. May i know is there anything missing and appreciate your advice?

curl --location '
--header 'Content-Type: application/octet-stream' 
--header 'X-F5-Auth-Token: Q7B3ANGIDWULYA5VXK7A3EB5YJ' 
--header 'Content-Range: 0-402287/402288' 
--header 'Cookie: BIGIPAuthCookie=F646C6B41C7A25966D1EE52A69E205E60E53B970; BIGIPAuthUsernameCookie=admin' 
--data '@/C:/Users/external_user/httg.xml'

Thankc you!



See this article Advanced WAF v16.0 - Declarative API



What you are trying to do seems like declarative WAF to me.

Also you can try ansible for this.


With inline you can also try to feed jinja2 template:


"{{ lookup('template', 'templates/asm_xml_policy.j2') }}"


   - name: Import ASM policy inline
        name: foo-policy4
        inline: <xml>content</xml>