F5 Programmability Training > Class 3: Introduction to SecDevOps > Module 2: Programmatic WAF (ASM) Configuration Source | Edit on
Module 2, Lab 1: Provisioning ASM¶
Overview¶
In this lab, the iControl REST API will be used to provision a module on the BIG-IP. More specifically, the Application Security Manager (ASM) module will be provisioned for use in Module 2: Programmatic WAF (Application Security Module) Configuration.
Note
- Use Postman collection to complete this lab.
- Some response content has been removed for brevity.
2.1.1. Retrieve single module provision state¶
To retrieve the provisioning state for a single module, send a HTTP GET to the REST endpoint for /mgmt/tm/sys/provision and include the name of the module. For example, /mgmt/tm/sys/provision/afm
Hint
Prior to performing the below steps, validate the {{module}} Postman environment variable is set to asm.
Send a Request with the following details.
MethodGETURLhttps://{{bigip-dev_mgmt}}/mgmt/tm/sys/provision/{{module}}
HeadersX-F5-Auth-Token: {{bigip-dev_auth_token}}
Body
Example Response
{
"kind": "tm:sys:provision:provisionstate",
"name": "asm",
"fullPath": "asm",
"generation": 5609,
"selfLink": "https://localhost/mgmt/tm/sys/provision/afm?ver=13.1.0.8",
"cpuRatio": 0,
"diskRatio": 0,
"level": "nominal",
"memoryRatio": 0
}
2.1.2. Provision ASM module¶
The asm module is provisioned using an HTTP PATCH with a body containing a provisioning level to the REST endpoint for mgmt/tm/sys/provision/{{module}}.
Warning
- This step is optional and should only be performed if asm is not provisioned.
- Performing a provision/deprovision operation takes some time to complete. If the original request is still being processed, the below error may be encountered.
Hint
Send a Request with the following details.
MethodPATCHURLhttps://{{bigip-dev_mgmt}}/mgmt/tm/sys/provision/{{module}}
HeadersContent-Type: application/json X-F5-Auth-Token: {{bigip-dev_auth_token}}
Body{ "level":"nominal" }
Example Response
{
"kind": "tm:sys:provision:provisionstate",
"name": "asm",
"fullPath": "asm",
"generation": 10636,
"selfLink": "https://localhost/mgmt/tm/sys/provision/afm?ver=13.1.0.8",
"cpuRatio": 0,
"diskRatio": 0,
"level": "nominal",
"memoryRatio": 0
}