SmartWebSecurity WAF API, REST: WafProfile.Create
- HTTP request
- Body parameters
- WafProfileRule
- WafProfileExclusionRule
- Condition
- AuthorityMatcher
- StringMatcher
- HttpMethodMatcher
- RequestUriMatcher
- QueryMatcher
- HeaderMatcher
- IpMatcher
- IpRangesMatcher
- GeoIpMatcher
- ExcludeRules
- CoreRuleSet
- RuleSet
- AnalyzeRequestBody
- Response
- CreateWafProfileMetadata
- Status
- WafProfile
- WafProfileRule
- WafProfileExclusionRule
- Condition
- AuthorityMatcher
- StringMatcher
- HttpMethodMatcher
- RequestUriMatcher
- QueryMatcher
- HeaderMatcher
- IpMatcher
- IpRangesMatcher
- GeoIpMatcher
- ExcludeRules
- CoreRuleSet
- RuleSet
- AnalyzeRequestBody
Creates a WAF profile in the specified folder using the data specified in the request.
HTTP request
POST https://smartwebsecurity.api.cloud.yandex.net/smartwebsecurity/v1/wafProfiles
Body parameters
{
"folderId": "string",
"name": "string",
"description": "string",
"labels": "string",
"rules": [
{
"ruleId": "string",
"isEnabled": "boolean",
"isBlocking": "boolean"
}
],
"exclusionRules": [
{
"name": "string",
"description": "string",
"condition": {
"authority": {
"authorities": [
{
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
}
]
},
"httpMethod": {
"httpMethods": [
{
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
}
]
},
"requestUri": {
"path": {
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
},
"queries": [
{
"key": "string",
"value": {
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
}
}
]
},
"headers": [
{
"name": "string",
"value": {
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
}
}
],
"sourceIp": {
"ipRangesMatch": {
"ipRanges": [
"string"
]
},
"ipRangesNotMatch": {
"ipRanges": [
"string"
]
},
"geoIpMatch": {
"locations": [
"string"
]
},
"geoIpNotMatch": {
"locations": [
"string"
]
}
}
},
"excludeRules": {
"excludeAll": "boolean",
"ruleIds": [
"string"
]
},
"logExcluded": "boolean"
}
],
// Includes only one of the fields `coreRuleSet`
"coreRuleSet": {
"inboundAnomalyScore": "string",
"paranoiaLevel": "string",
"ruleSet": {
"name": "string",
"version": "string"
}
},
// end of the list of possible fields
"analyzeRequestBody": {
"isEnabled": "boolean",
"sizeLimit": "string",
"sizeLimitAction": "string"
}
}
Field |
Description |
folderId |
string ID of the folder to create a WAF profile in. |
name |
string Name of the WAF profile. The name is unique within the folder. 1-50 characters long. |
description |
string Optional description of the WAF profile. |
labels |
string Labels as |
rules[] |
Settings for each rule in rule set. |
exclusionRules[] |
List of exclusion rules. See Rules. |
coreRuleSet |
Core rule set settings. See Basic rule set for details. Includes only one of the fields |
analyzeRequestBody |
Parameters for request body analyzer. |
WafProfileRule
WafProfileRule object. Determines settings for each rule_id in rule set.
Field |
Description |
ruleId |
string Required field. Rule ID. |
isEnabled |
boolean Determines is it rule enabled or not. |
isBlocking |
boolean Determines is it rule blocking or not. |
WafProfileExclusionRule
A WafProfileExclusionRule object. See Exclusion rules.
Field |
Description |
name |
string Required field. Name of exclusion rule. |
description |
string Optional description of the rule. 0-512 characters long. |
condition |
The condition for matching traffic. |
excludeRules |
Required field. Exclude rules. |
logExcluded |
boolean Records the fact that an exception rule is triggered. |
Condition
Condition object. AND semantics implied.
See documentation for matchers description.
Field |
Description |
authority |
Match authority (Host header). |
httpMethod |
Match HTTP method. |
requestUri |
Match Request URI. |
headers[] |
Match HTTP headers. |
sourceIp |
Match IP. |
AuthorityMatcher
AuthorityMatcher object.
Field |
Description |
authorities[] |
List of authorities. OR semantics implied. |
StringMatcher
StringMatcher object.
Field |
Description |
exactMatch |
string Includes only one of the fields |
exactNotMatch |
string Includes only one of the fields |
prefixMatch |
string Includes only one of the fields |
prefixNotMatch |
string Includes only one of the fields |
pireRegexMatch |
string Includes only one of the fields |
pireRegexNotMatch |
string Includes only one of the fields |
HttpMethodMatcher
HttpMethodMatcher object.
Field |
Description |
httpMethods[] |
List of HTTP methods. OR semantics implied. |
RequestUriMatcher
RequestUriMatcher object. AND semantics implied.
Field |
Description |
path |
Path of the URI RFC3986 |
queries[] |
List of query matchers. AND semantics implied. |
QueryMatcher
QueryMatcher object.
Field |
Description |
key |
string Required field. Key of the query parameter. |
value |
Required field. Value of the query parameter. |
HeaderMatcher
HeaderMatcher object.
Field |
Description |
name |
string Required field. Name of header (case insensitive). |
value |
Required field. Value of the header. |
IpMatcher
IpMatcher object. AND semantics implied.
Field |
Description |
ipRangesMatch |
|
ipRangesNotMatch |
|
geoIpMatch |
|
geoIpNotMatch |
IpRangesMatcher
IpRangesMatcher object.
Field |
Description |
ipRanges[] |
string List of IP ranges. OR semantics implied. |
GeoIpMatcher
GeoIpMatcher object.
Field |
Description |
locations[] |
string ISO 3166-1 alpha 2. OR semantics implied. |
ExcludeRules
Determines list of excluded rules.
Field |
Description |
excludeAll |
boolean Set this option true to exclude all rules. |
ruleIds[] |
string List of rules to exclude. |
CoreRuleSet
Field |
Description |
inboundAnomalyScore |
string (int64) Anomaly score. |
paranoiaLevel |
string (int64) Paranoia level. |
ruleSet |
Required field. Rule set. |
RuleSet
A RuleSet object. Determines name and version of rule set.
Field |
Description |
name |
string Required field. Name of rule set. |
version |
string Required field. Version of rule set. |
AnalyzeRequestBody
Field |
Description |
isEnabled |
boolean Possible to turn analyzer on and turn if off. |
sizeLimit |
string (int64) Maximum size of body to pass to analyzer. In kilobytes. |
sizeLimitAction |
enum (Action) Action to perform if maximum size of body exceeded.
|
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": "boolean",
"metadata": {
"wafProfileId": "string"
},
// Includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": {
"id": "string",
"folderId": "string",
"cloudId": "string",
"name": "string",
"description": "string",
"labels": "string",
"createdAt": "string",
"rules": [
{
"ruleId": "string",
"isEnabled": "boolean",
"isBlocking": "boolean"
}
],
"exclusionRules": [
{
"name": "string",
"description": "string",
"condition": {
"authority": {
"authorities": [
{
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
}
]
},
"httpMethod": {
"httpMethods": [
{
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
}
]
},
"requestUri": {
"path": {
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
},
"queries": [
{
"key": "string",
"value": {
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
}
}
]
},
"headers": [
{
"name": "string",
"value": {
// Includes only one of the fields `exactMatch`, `exactNotMatch`, `prefixMatch`, `prefixNotMatch`, `pireRegexMatch`, `pireRegexNotMatch`
"exactMatch": "string",
"exactNotMatch": "string",
"prefixMatch": "string",
"prefixNotMatch": "string",
"pireRegexMatch": "string",
"pireRegexNotMatch": "string"
// end of the list of possible fields
}
}
],
"sourceIp": {
"ipRangesMatch": {
"ipRanges": [
"string"
]
},
"ipRangesNotMatch": {
"ipRanges": [
"string"
]
},
"geoIpMatch": {
"locations": [
"string"
]
},
"geoIpNotMatch": {
"locations": [
"string"
]
}
}
},
"excludeRules": {
"excludeAll": "boolean",
"ruleIds": [
"string"
]
},
"logExcluded": "boolean"
}
],
// Includes only one of the fields `coreRuleSet`
"coreRuleSet": {
"inboundAnomalyScore": "string",
"paranoiaLevel": "string",
"ruleSet": {
"name": "string",
"version": "string"
}
},
// end of the list of possible fields
"analyzeRequestBody": {
"isEnabled": "boolean",
"sizeLimit": "string",
"sizeLimitAction": "string"
}
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field |
Description |
id |
string ID of the operation. |
description |
string Description of the operation. 0-256 characters long. |
createdAt |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
createdBy |
string ID of the user or service account who initiated the operation. |
modifiedAt |
string (date-time) The time when the Operation resource was last modified. String in RFC3339 To work with values in this field, use the APIs described in the |
done |
boolean If the value is |
metadata |
Service-specific metadata associated with the operation. |
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
CreateWafProfileMetadata
Field |
Description |
wafProfileId |
string ID of the WAF profile that is being created. |
Status
The error result of the operation in case of failure or cancellation.
Field |
Description |
code |
integer (int32) Error code. An enum value of google.rpc.Code |
message |
string An error message. |
details[] |
object A list of messages that carry the error details. |
WafProfile
Field |
Description |
id |
string Required field. ID of the WAF profile. |
folderId |
string Required field. ID of the folder that the WAF profile belongs to. |
cloudId |
string Required field. ID of the cloud that the WAF profile belongs to. |
name |
string Required field. Name of the WAF profile. The name is unique within the folder. 1-50 characters long. |
description |
string Optional description of the WAF profile. |
labels |
string Labels as |
createdAt |
string (date-time) Creation timestamp in RFC3339 String in RFC3339 To work with values in this field, use the APIs described in the |
rules[] |
Settings for each rule in rule set. |
exclusionRules[] |
List of exclusion rules. See Rules. |
coreRuleSet |
Core rule set settings. See Basic rule set for details. Includes only one of the fields |
analyzeRequestBody |
Parameters for request body analyzer. |
WafProfileRule
WafProfileRule object. Determines settings for each rule_id in rule set.
Field |
Description |
ruleId |
string Required field. Rule ID. |
isEnabled |
boolean Determines is it rule enabled or not. |
isBlocking |
boolean Determines is it rule blocking or not. |
WafProfileExclusionRule
A WafProfileExclusionRule object. See Exclusion rules.
Field |
Description |
name |
string Required field. Name of exclusion rule. |
description |
string Optional description of the rule. 0-512 characters long. |
condition |
The condition for matching traffic. |
excludeRules |
Required field. Exclude rules. |
logExcluded |
boolean Records the fact that an exception rule is triggered. |
Condition
Condition object. AND semantics implied.
See documentation for matchers description.
Field |
Description |
authority |
Match authority (Host header). |
httpMethod |
Match HTTP method. |
requestUri |
Match Request URI. |
headers[] |
Match HTTP headers. |
sourceIp |
Match IP. |
AuthorityMatcher
AuthorityMatcher object.
Field |
Description |
authorities[] |
List of authorities. OR semantics implied. |
StringMatcher
StringMatcher object.
Field |
Description |
exactMatch |
string Includes only one of the fields |
exactNotMatch |
string Includes only one of the fields |
prefixMatch |
string Includes only one of the fields |
prefixNotMatch |
string Includes only one of the fields |
pireRegexMatch |
string Includes only one of the fields |
pireRegexNotMatch |
string Includes only one of the fields |
HttpMethodMatcher
HttpMethodMatcher object.
Field |
Description |
httpMethods[] |
List of HTTP methods. OR semantics implied. |
RequestUriMatcher
RequestUriMatcher object. AND semantics implied.
Field |
Description |
path |
Path of the URI RFC3986 |
queries[] |
List of query matchers. AND semantics implied. |
QueryMatcher
QueryMatcher object.
Field |
Description |
key |
string Required field. Key of the query parameter. |
value |
Required field. Value of the query parameter. |
HeaderMatcher
HeaderMatcher object.
Field |
Description |
name |
string Required field. Name of header (case insensitive). |
value |
Required field. Value of the header. |
IpMatcher
IpMatcher object. AND semantics implied.
Field |
Description |
ipRangesMatch |
|
ipRangesNotMatch |
|
geoIpMatch |
|
geoIpNotMatch |
IpRangesMatcher
IpRangesMatcher object.
Field |
Description |
ipRanges[] |
string List of IP ranges. OR semantics implied. |
GeoIpMatcher
GeoIpMatcher object.
Field |
Description |
locations[] |
string ISO 3166-1 alpha 2. OR semantics implied. |
ExcludeRules
Determines list of excluded rules.
Field |
Description |
excludeAll |
boolean Set this option true to exclude all rules. |
ruleIds[] |
string List of rules to exclude. |
CoreRuleSet
Field |
Description |
inboundAnomalyScore |
string (int64) Anomaly score. |
paranoiaLevel |
string (int64) Paranoia level. |
ruleSet |
Required field. Rule set. |
RuleSet
A RuleSet object. Determines name and version of rule set.
Field |
Description |
name |
string Required field. Name of rule set. |
version |
string Required field. Version of rule set. |
AnalyzeRequestBody
Field |
Description |
isEnabled |
boolean Possible to turn analyzer on and turn if off. |
sizeLimit |
string (int64) Maximum size of body to pass to analyzer. In kilobytes. |
sizeLimitAction |
enum (Action) Action to perform if maximum size of body exceeded.
|