Replace an edge WAF rule
import requests
url = "https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules/{rule_id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules/{rule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules/{rule_id} \
--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
Replace an edge WAF rule
Replaces every field of a rule set at this zone; a field left out takes its default. Requires an organisation admin; Ankra Cloud checks the zone is the organisation account’s own and audits the change.
PUT
/
api
/
v1
/
org
/
dns
/
zones
/
{zone}
/
waf
/
rules
/
{rule_id}
Replace an edge WAF rule
import requests
url = "https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules/{rule_id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules/{rule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/dns/zones/{zone}/waf/rules/{rule_id} \
--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.