Skip to main content
Version: 10.0

Zone Ruleset Revision

Description​

This resource is for listing rulesets in a zone or creating new ones. Currently rulesets map exclusively to AT61 regexes.

GET /zones/:ZONEID/revisions/:REVISIONID/rulesets​

Get the list of rulesets used at this revision. This is a paged query.

GET Parameters​

NameRequiredTypeDescriptionDefault Value
:ZONEIDYesURL ParameterThe unique numeric ID of the zone. 
:REVISIONIDYesURL ParameterThe revision number of the ruleset. 
qNoQuery ParameterFilter returned entries in the revision by their application, protocol, or description.    

GET Response Values​

Each returned element will be a ruleset resource represented as an object.

Example GET Request​

GET /zones/2031/revisions/26/rulesets

Example GET Response​

{
"rows": 1,
"data": [
{
"description": "Gigabot",
"protocol": "TCP",
"application": "regex",
"port": 80,
"enabled": true,
"ruleset_resource": "/rulesets/121",
"zone_resource": "/zones/2031",
"rules": [
{
"field": "Regex",
"predicate": "is",
"value": "(?i)\\x0d\\x0aUser-Agent: [^\\x0d]*Gigabot[^\\x0d]*\\x0d\\x0a",
"rule_resource": "/rules/109"
}
]
}
],
"start": 0
} 

POST /zones/:ZONEID/revisions/:REVISIONID/rulesets​

Create a new set of rulesets to use in the zone. Any entries created will be in addition to existing ruleset entries in the zone. The POST will only be accepted if the :REVISIONID is the current ruleset revision for the zone.

POST Parameters​

NameRequiredTypeDescriptionDefault Value
:ZONEIDYesURL ParameterThe unique numeric ID of the zone you want to add ruleset entries. 
:REVISIONIDYesURL ParameterThe revision number of the ruleset. In order to successfully perform the POST, this must be the zone's current ruleset revision number. 
descriptionNoJSON StringA description of the new ruleset.null
protocolYesJSON StringThe protocol that the ruleset should apply to. Must be one of "TCP", "UDP", or "ICMP". 
portYesJSON NumberThe destination port to which this ruleset applies. If 0, applies to any traffic over the selected protocol. 
enabledNoJSON BooleanWhether or not the ruleset is enabled.null
rulesYesJSON ArrayA list of rules in the ruleset. Currently this should contain a single object, containing each of the elements listed below. 
fieldYesJSON StringUse the default value of "Regex". 
predicateYesJSON StringUse the default value of "is". 
valueYesJSON StringUse a backslash escaped representation of the rule. Practically speaking, this will be the regex that is applied in the listed zone.

Example POST Request​

POST /zones/2031/revisions/26/rulesets
 
JSON Body:
{
"data": {
"description": "Wordpress",
"protocol": "TCP",
"application": "regex",
"port": 80,
"enabled": true,
"rules": [
{
"field": "Regex",
"predicate": "is",
"value": "(?i)\\x0d\\x0aUser-Agent: [^\\x0d]*Wordpress[^\\x0d]*\\x0d\\x0a"
}
]
}
}

Example POST Response​

HTTP/1.1 201 Created