Add an edge WAF rule or exception
import requests
url = "https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"rule": {
"id": "<string>",
"zone_id": "<string>",
"set_at_zone": "<string>",
"hostname": "<string>",
"description": "<string>",
"action": "block",
"path_prefix": "<string>",
"methods": [
"<string>"
],
"sources": [
"<string>"
],
"rule_ids": [
123
],
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}DNS
Add an edge WAF rule or exception
Adds a block, allow or skip_rules rule at the zone. A SPARQL endpoint, for example, needs skip_rules for 920420, 933160, 942100 and 942151 on its query path. Requires an organisation admin; Ankra Cloud checks the zone is the organisation account’s own and audits the change.
POST
/
api
/
v1
/
org
/
dns
/
zones
/
{zone}
/
waf
/
rules
Add an edge WAF rule or exception
import requests
url = "https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"rule": {
"id": "<string>",
"zone_id": "<string>",
"set_at_zone": "<string>",
"hostname": "<string>",
"description": "<string>",
"action": "block",
"path_prefix": "<string>",
"methods": [
"<string>"
],
"sources": [
"<string>"
],
"rule_ids": [
123
],
"enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Path Parameters
Body
application/json
A customer WAF rule. block answers 403 in every mode; allow forwards without inspection; skip_rules leaves Core Rule Set rules 911000-944999 out. A matching block wins, then allow; skipped rules of every match combine. block and allow need a path_prefix, methods or sources.