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

What is the iControlRest and curl to import the ASM policy

qso
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 'https://10.1.1.4/mgmt/tm/asm/file-transfer/uploads/httg.xml
--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!

 

2 REPLIES 2

See this article Advanced WAF v16.0 - Declarative API

 

https://community.f5.com/t5/technical-articles/advanced-waf-v16-0-declarative-api/ta-p/289251

 

 

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

Also you can try ansible for this.

https://clouddocs.f5.com/products/orchestration/ansible/devel/f5_bigip/modules_2_0/bigip_asm_policy_...

 

With inline you can also try to feed jinja2 template:

 

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

 

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