The new version of SafeLine WAF supports API Token authentication.
Usage Requirements
- You must log in using the default admin user to see this feature.
- The version must be >= 6.6.0.
How to Use
- Create an API TOKEN in System Management
- Make a Request Add an extra parameter in the request header as follows:
"X-SLCE-API-TOKEN": "API Token generated by SafeLine management terminal"
Example Reference
Python Example for Adding a Site Using API Token
import requests
import json
header = {
"X-SLCE-API-TOKEN": "API Token generated by the Thunder Pool management terminal"
}
# URL for adding a site
url = 'https://ThunderPoolIP:9443/api/open/site'
payload = {
"ports": ["80"],
"server_names": ["*"],
"upstreams": ["http://127.0.0.1:9443"],
"comment": "",
"load_balance": {"balance_type": 1}
}
payload = json.dumps(payload)
requests.post(url=url, headers=header, data=payload, verify=False)
Other API Interfaces
- Get the System Version
https://10.10.10.18:9443/api/open/system
- Get Daily Access Statistics
https://10.10.10.18:9443/api/dashboard/requests
- Get Attack Detection Information
https://10.10.10.18:9443/api/open/events?page=1&page_size=20
- Get Blocking Information
https://115.238.109.74:9443/api/open/records/acl?page=1&page_size=20
- Get Real-time QPS (Queries Per Second)
https://10.10.10.18:9443/api/stat/qps
- Get Access Statistics for Each Province
https://10.10.10.18:9443/api/dashboard/map/counts
- Daily Interception Statistics
https://10.10.10.18:9443/api/dashboard/intercepts
- Same-day Interception Statistics
https://10.10.10.18:9443/api/stat/basic/access
- Webpage 4xx and 5xx Statistics
https://10.10.10.18:9443/api/dashboard/counts
- Human Verification Access Statistics
https://10.10.10.18:9443/api/open/records/challenge?page=1&page_size=20
- Authentication Access Statistics
https://10.10.10.18:9443/api/open/records/auth_defense?page=1&page_size=20
- Rate Limiting
https://10.10.10.18:9443/api/open/global/acl
- Custom Rules
https://10.10.10.18:9443/api/open/policy?page=1&page_size=20&action=-1
- Protection Modules
https://10.10.10.18:9443/api/open/global/mode
- Enhanced Rules
https://10.10.10.18:9443/api/open/skynet/rule
- General Configuration
https://10.10.10.18:9443/api/open/ipgroup?top=20
- System Settings
https://10.10.10.18:9443/api/open/users
Top comments (0)