Skip to content
Myra Online Help Updated · 21 Aug 2026

Changing the setting of a WAF rule of a subdomain

Note

The body must include the attributes id and modified to identify the corresponding entry.

Note

The ID of the entry in the path of the request must match the value of the attribute id in the body.

Sends a PUT request to the endpoint /domain/{domainId}/{vHostName}/waf-rules/{id}.

Description

The Change-WAF-Rule request allows the user to change the settings of a WAF rule for a subdomain of the organisation.

Requirements

Values of the request: Domain-ID {domainId}, Subdomain name {vHostName}, WAF-ID {id}

Objects: WafRuleVO

Request

To change the setting of a WAF rule of a subdomain, the Domain-ID {domainId}, the Subdomain name {vHostName}, and the WAF-ID {id} need to be added to the path of the request.

For a detailed specification of which information is required to change the settings of a WAF rule, the object WafRuleVO with the following attributes needs to be defined in the body:

Attributes Description Values
ruleType The category of the WAF rule. For domain WAF rules: Domain
name The name of the WAF rule. string
description An individual description for the WAF rule. string
logIdentifier The short name which is shown in the log to identify the WAF rule. string
subDomainName The level at which the rule should take effect. Specify the name of a subdomain or, for general WAF rules, ALL-<Domain-ID> or ALL-<domain name>.
direction The phase of the WAF rule for handling incoming or outgoing requests. Possible values:
  • in -> Request
  • out -> Response
sync
actions An array of all actions of a WAF rule. WafActionVO
conditions An array of all conditions of a WAF rule with the object. WafConditionVO
sort The ascending order for the entry. Possible values: 0 or upper
enabled The availability of the WAF rule. Default value : true
Possible values:
  • true
  • false
expireDate The date as ISO 8601 until the WAF rule is valid. Default: NULL
id The ID of the entry. integer
modified The last modification date in ISO 8601 format. string($date-time)

The following attributes are optional:

Attributes Description Values
comment An individual comment for the WAF rule. string
template Indicate whether the WAF rule is part of a template.
processNext Defines if the conditions of a WAF rule continue after a condition is matched. Default value: false
Possible values:
  • true
  • false
copiedFrom Defines if the WAF rule is a copy of another rule.

The following objects must be added for action and condition:

Object WafActionVO

Attributes Description Values
name The name of the condition in the Myra App.
  • Allow
  • Block
  • Log
  • Modify header
  • Add header
  • Remove header
  • Remove Header Value Regex
  • CAPTCHA
  • Change upstream
  • Rate limit
  • Score
  • URI substitution
  • Set HTTP status
  • Remove Query String
type The internal name of the action.
  • allow
  • block
  • log
  • modify_header
  • add_header
  • remove_header
  • remove_header_value_regex
  • verify_human
  • change_upstream
  • origin_rate_limit
  • score
  • uri_subst
  • set_http_status
  • del_qs_param
availablePhases The support for different phases.
  • 1 -> Redirects
  • 2 -> IP Whitelist & Blacklist
  • 3 -> WAF
  • 4 -> Request Limiter
  • 5 -> Antibot
customKey The customize key for the action. Depending on the type of the action, this can be a header name, a value, a path, or an error code. string
value The value for the action. string

WafConditionVO object

Attributes Description Values
name The internal name of the condition.
  • custom_header
  • host
  • user_agent
  • accept
  • accept_encoding
  • cookie
  • url
  • method
  • arg
  • postarg
  • querystring
  • query_decode
  • fingerprint
  • remote_addr
  • score
  • set_cookie
  • content_type
key The customize key for the condition. Depending on the type of the condition, this can be a header name, a value, a path, or an error code. string
value The value for the condition. Depending on the type of the condition, this can be a value for the customize key or a comparison parameter for the matching type. string
matchingType The regex condition. For all conditions except score:
  • EXACT
  • IREGEX
  • PREFIX
  • SUFFIX
  • NOT IREGEX
  • NOT REGEX
  • NOT EXACT
  • NOT SUFFIX
  • NOT PREFIX
  • For score: EQUALS
  • GREATER_THAN
  • LESS_THAN
availablePhases The support for different phases.
  • 1 -> Redirects
  • 2 -> IP Whitelist & Blacklist
  • 3 -> WAF
  • 4 -> Request Limiter
  • 5 -> Antibot
alias The name of the condition in the Myra App.
  • Custom header
  • Host header
  • User-Agent header
  • Accept header
  • Accept-Encoding header
  • Cookie
  • Path
  • Request method
  • Query string argument
  • Post argument
  • Query string
  • Query string decode
  • Fingerprint
  • Remote IP address
  • Score
  • Set-Cookie header
  • Content-Type header

The system returns the object WafRuleVO with the changed information.

Example

Example request body:

{
  "objectType": "string",
  "comment": "string",
  "ruleType": "string",
  "name": "string",
  "description": "string",
  "logIdentifier": "string",
  "template": true,
  "subDomainName": "string",
  "vhostId": 0,
  "tagId": 0,
  "direction": "string",
  "uuid": "string",
  "processNext": true,
  "sync": true,
  "actions": [
    {
      "objectType": "string",
      "comment": "string",
      "name": "string",
      "type": "string",
      "availablePhases": 0,
      "customKey": "string",
      "value": "string",
      "forceCustomValues": 0
    }
  ],
  "conditions": [
    {
      "objectType": "string",
      "comment": "string",
      "category": "string",
      "name": "string",
      "key": "string",
      "value": "string",
      "matchingType": "string",
      "availablePhases": 0,
      "forceCustomValues": true,
      "alias": "string"
    }
  ],
  "sort": 0,
  "copiedFrom": 0,
  "expireDate": "string",
  "enabled": true
}

Responses

The following responses are available:

STATUS CODE DESCRIPTION
200 The request has succeeded.
400 The request was unsuccessful. The request was invalid or information is missing.
401 The request has not succeeded because the user authentication was incorrect.
403 The request has not succeeded because the user does not have the right permissions.