SmartWebSecurity WAF API, gRPC: WafProfileService.Create
- gRPC request
- CreateWafProfileRequest
- WafProfileRule
- WafProfileExclusionRule
- Condition
- AuthorityMatcher
- StringMatcher
- HttpMethodMatcher
- RequestUriMatcher
- QueryMatcher
- HeaderMatcher
- IpMatcher
- IpRangesMatcher
- GeoIpMatcher
- ExcludeRules
- CoreRuleSet
- RuleSet
- AnalyzeRequestBody
- WafProfileRuleSet
- WafProfileCoreRuleSet
- WafProfileYaRuleSet
- RuleGroup
- WafProfileMlRuleSet
- operation.Operation
- CreateWafProfileMetadata
- WafProfile
- WafProfileRule
- WafProfileExclusionRule
- Condition
- AuthorityMatcher
- StringMatcher
- HttpMethodMatcher
- RequestUriMatcher
- QueryMatcher
- HeaderMatcher
- IpMatcher
- IpRangesMatcher
- GeoIpMatcher
- ExcludeRules
- CoreRuleSet
- RuleSet
- AnalyzeRequestBody
- WafProfileRuleSet
- WafProfileCoreRuleSet
- WafProfileYaRuleSet
- RuleGroup
- WafProfileMlRuleSet
Creates a WAF profile in the specified folder using the data specified in the request.
gRPC request
rpc Create (CreateWafProfileRequest) returns (operation.Operation)
CreateWafProfileRequest
{
"folder_id": "string",
"name": "string",
"description": "string",
"labels": "map<string, string>",
"rules": [
{
"rule_id": "string",
"is_enabled": "bool",
"is_blocking": "bool"
}
],
"exclusion_rules": [
{
"name": "string",
"description": "string",
"condition": {
"authority": {
"authorities": [
{
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
}
]
},
"http_method": {
"http_methods": [
{
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
}
]
},
"request_uri": {
"path": {
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
},
"queries": [
{
"key": "string",
"value": {
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
}
}
]
},
"headers": [
{
"name": "string",
"value": {
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
}
}
],
"source_ip": {
"ip_ranges_match": {
"ip_ranges": [
"string"
]
},
"ip_ranges_not_match": {
"ip_ranges": [
"string"
]
},
"geo_ip_match": {
"locations": [
"string"
]
},
"geo_ip_not_match": {
"locations": [
"string"
]
}
}
},
"exclude_rules": {
"exclude_all": "bool",
"rule_ids": [
"string"
]
},
"log_excluded": "bool"
}
],
// Includes only one of the fields `core_rule_set`
"core_rule_set": {
"inbound_anomaly_score": "int64",
"paranoia_level": "int64",
"rule_set": {
"name": "string",
"version": "string",
"type": "RuleSetType",
"id": "string"
}
},
// end of the list of possible fields
"analyze_request_body": {
"is_enabled": "bool",
"size_limit": "int64",
"size_limit_action": "Action"
},
"rule_sets": [
{
// Includes only one of the fields `core_rule_set`, `ya_rule_set`, `ml_rule_set`
"core_rule_set": {
"rule_set": {
"name": "string",
"version": "string",
"type": "RuleSetType",
"id": "string"
},
"inbound_anomaly_score": "int64",
"paranoia_level": "int64"
},
"ya_rule_set": {
"rule_set": {
"name": "string",
"version": "string",
"type": "RuleSetType",
"id": "string"
},
"rule_groups": [
{
"id": "string",
"action": "Action",
"inbound_anomaly_score": "int64",
"is_enabled": "bool"
}
]
},
"ml_rule_set": {
"rule_set": {
"name": "string",
"version": "string",
"type": "RuleSetType",
"id": "string"
},
"rule_groups": [
{
"id": "string",
"action": "Action",
"inbound_anomaly_score": "int64",
"is_enabled": "bool"
}
]
},
// end of the list of possible fields
"priority": "int64",
"is_enabled": "bool",
"action": "RuleSetAction"
}
],
"match_all_rule_sets": "bool"
}
|
Field |
Description |
|
folder_id |
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 |
object (map<string, string>) Labels as |
|
rules[] |
Settings for each rule in rule set. |
|
exclusion_rules[] |
List of exclusion rules. See Rules. |
|
core_rule_set |
Core rule set settings. See Basic rule set for details. Includes only one of the fields |
|
analyze_request_body |
Parameters for request body analyzer. |
|
rule_sets[] |
List of rule sets. See Rules. |
|
match_all_rule_sets |
bool Parameter determines should all rule sets be matched. |
WafProfileRule
WafProfileRule object. Determines settings for each rule_id in rule set.
|
Field |
Description |
|
rule_id |
string Required field. Rule ID. |
|
is_enabled |
bool Determines is it rule enabled or not. |
|
is_blocking |
bool 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. |
|
exclude_rules |
Required field. Exclude rules. |
|
log_excluded |
bool 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). |
|
http_method |
Match HTTP method. |
|
request_uri |
Match Request URI. |
|
headers[] |
Match HTTP headers. |
|
source_ip |
Match IP. |
AuthorityMatcher
AuthorityMatcher object.
|
Field |
Description |
|
authorities[] |
List of authorities. OR semantics implied. |
StringMatcher
StringMatcher object.
|
Field |
Description |
|
exact_match |
string Includes only one of the fields |
|
exact_not_match |
string Includes only one of the fields |
|
prefix_match |
string Includes only one of the fields |
|
prefix_not_match |
string Includes only one of the fields |
|
pire_regex_match |
string Includes only one of the fields |
|
pire_regex_not_match |
string Includes only one of the fields |
HttpMethodMatcher
HttpMethodMatcher object.
|
Field |
Description |
|
http_methods[] |
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 |
|
ip_ranges_match |
|
|
ip_ranges_not_match |
|
|
geo_ip_match |
|
|
geo_ip_not_match |
IpRangesMatcher
IpRangesMatcher object.
|
Field |
Description |
|
ip_ranges[] |
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 |
|
exclude_all |
bool Set this option true to exclude all rules. |
|
rule_ids[] |
string List of rules to exclude. |
CoreRuleSet
|
Field |
Description |
|
inbound_anomaly_score |
int64 Anomaly score. |
|
paranoia_level |
int64 Paranoia level. |
|
rule_set |
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. |
|
type |
enum RuleSetType Type of rule set.
|
|
id |
string ID of rule set. |
AnalyzeRequestBody
|
Field |
Description |
|
is_enabled |
bool Possible to turn analyzer on and turn if off. |
|
size_limit |
int64 Maximum size of body to pass to analyzer. In kilobytes. |
|
size_limit_action |
enum Action Action to perform if maximum size of body exceeded.
|
WafProfileRuleSet
|
Field |
Description |
|
core_rule_set |
Core rule set settings. See Basic rule set for details. Includes only one of the fields |
|
ya_rule_set |
Yandex rule set settings. Includes only one of the fields |
|
ml_rule_set |
Yandex Machine learning rule set settings. Includes only one of the fields |
|
priority |
int64 Priority of rule set. |
|
is_enabled |
bool Determines is it rule set enabled or not. |
|
action |
enum RuleSetAction Action to perfome on rule set match.
|
WafProfileCoreRuleSet
|
Field |
Description |
|
rule_set |
Required field. Rule set. |
|
inbound_anomaly_score |
int64 Anomaly score. |
|
paranoia_level |
int64 Paranoia level. |
WafProfileYaRuleSet
|
Field |
Description |
|
rule_set |
Required field. Rule set. |
|
rule_groups[] |
List of rule groups. |
RuleGroup
|
Field |
Description |
|
id |
string ID of the rule group. |
|
action |
enum Action Action to perfome on rule group match.
|
|
inbound_anomaly_score |
int64 Anomaly score. |
|
is_enabled |
bool Determines is it rule group enabled or not. |
WafProfileMlRuleSet
|
Field |
Description |
|
rule_set |
Required field. Rule set. |
|
rule_groups[] |
List of rule groups. |
operation.Operation
{
"id": "string",
"description": "string",
"created_at": "google.protobuf.Timestamp",
"created_by": "string",
"modified_at": "google.protobuf.Timestamp",
"done": "bool",
"metadata": {
"waf_profile_id": "string"
},
// Includes only one of the fields `error`, `response`
"error": "google.rpc.Status",
"response": {
"id": "string",
"folder_id": "string",
"cloud_id": "string",
"name": "string",
"description": "string",
"labels": "map<string, string>",
"created_at": "google.protobuf.Timestamp",
"rules": [
{
"rule_id": "string",
"is_enabled": "bool",
"is_blocking": "bool"
}
],
"exclusion_rules": [
{
"name": "string",
"description": "string",
"condition": {
"authority": {
"authorities": [
{
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
}
]
},
"http_method": {
"http_methods": [
{
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
}
]
},
"request_uri": {
"path": {
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
},
"queries": [
{
"key": "string",
"value": {
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
}
}
]
},
"headers": [
{
"name": "string",
"value": {
// Includes only one of the fields `exact_match`, `exact_not_match`, `prefix_match`, `prefix_not_match`, `pire_regex_match`, `pire_regex_not_match`
"exact_match": "string",
"exact_not_match": "string",
"prefix_match": "string",
"prefix_not_match": "string",
"pire_regex_match": "string",
"pire_regex_not_match": "string"
// end of the list of possible fields
}
}
],
"source_ip": {
"ip_ranges_match": {
"ip_ranges": [
"string"
]
},
"ip_ranges_not_match": {
"ip_ranges": [
"string"
]
},
"geo_ip_match": {
"locations": [
"string"
]
},
"geo_ip_not_match": {
"locations": [
"string"
]
}
}
},
"exclude_rules": {
"exclude_all": "bool",
"rule_ids": [
"string"
]
},
"log_excluded": "bool"
}
],
// Includes only one of the fields `core_rule_set`
"core_rule_set": {
"inbound_anomaly_score": "int64",
"paranoia_level": "int64",
"rule_set": {
"name": "string",
"version": "string",
"type": "RuleSetType",
"id": "string"
}
},
// end of the list of possible fields
"analyze_request_body": {
"is_enabled": "bool",
"size_limit": "int64",
"size_limit_action": "Action"
},
"rule_sets": [
{
// Includes only one of the fields `core_rule_set`, `ya_rule_set`, `ml_rule_set`
"core_rule_set": {
"rule_set": {
"name": "string",
"version": "string",
"type": "RuleSetType",
"id": "string"
},
"inbound_anomaly_score": "int64",
"paranoia_level": "int64"
},
"ya_rule_set": {
"rule_set": {
"name": "string",
"version": "string",
"type": "RuleSetType",
"id": "string"
},
"rule_groups": [
{
"id": "string",
"action": "Action",
"inbound_anomaly_score": "int64",
"is_enabled": "bool"
}
]
},
"ml_rule_set": {
"rule_set": {
"name": "string",
"version": "string",
"type": "RuleSetType",
"id": "string"
},
"rule_groups": [
{
"id": "string",
"action": "Action",
"inbound_anomaly_score": "int64",
"is_enabled": "bool"
}
]
},
// end of the list of possible fields
"priority": "int64",
"is_enabled": "bool",
"action": "RuleSetAction"
}
],
"match_all_rule_sets": "bool"
}
// 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. |
|
created_at |
Creation timestamp. |
|
created_by |
string ID of the user or service account who initiated the operation. |
|
modified_at |
The time when the Operation resource was last modified. |
|
done |
bool 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 |
|
waf_profile_id |
string ID of the WAF profile that is being created. |
WafProfile
|
Field |
Description |
|
id |
string Required field. ID of the WAF profile. |
|
folder_id |
string Required field. ID of the folder that the WAF profile belongs to. |
|
cloud_id |
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 |
object (map<string, string>) Labels as |
|
created_at |
Creation timestamp in RFC3339 |
|
rules[] |
Settings for each rule in rule set. |
|
exclusion_rules[] |
List of exclusion rules. See Rules. |
|
core_rule_set |
Core rule set settings. See Basic rule set for details. Includes only one of the fields |
|
analyze_request_body |
The parameter is deprecated. Parameters for request body analyzer. |
|
rule_sets[] |
List of rule sets. |
|
match_all_rule_sets |
bool Determines |
WafProfileRule
WafProfileRule object. Determines settings for each rule_id in rule set.
|
Field |
Description |
|
rule_id |
string Required field. Rule ID. |
|
is_enabled |
bool Determines is it rule enabled or not. |
|
is_blocking |
bool 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. |
|
exclude_rules |
Required field. Exclude rules. |
|
log_excluded |
bool 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). |
|
http_method |
Match HTTP method. |
|
request_uri |
Match Request URI. |
|
headers[] |
Match HTTP headers. |
|
source_ip |
Match IP. |
AuthorityMatcher
AuthorityMatcher object.
|
Field |
Description |
|
authorities[] |
List of authorities. OR semantics implied. |
StringMatcher
StringMatcher object.
|
Field |
Description |
|
exact_match |
string Includes only one of the fields |
|
exact_not_match |
string Includes only one of the fields |
|
prefix_match |
string Includes only one of the fields |
|
prefix_not_match |
string Includes only one of the fields |
|
pire_regex_match |
string Includes only one of the fields |
|
pire_regex_not_match |
string Includes only one of the fields |
HttpMethodMatcher
HttpMethodMatcher object.
|
Field |
Description |
|
http_methods[] |
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 |
|
ip_ranges_match |
|
|
ip_ranges_not_match |
|
|
geo_ip_match |
|
|
geo_ip_not_match |
IpRangesMatcher
IpRangesMatcher object.
|
Field |
Description |
|
ip_ranges[] |
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 |
|
exclude_all |
bool Set this option true to exclude all rules. |
|
rule_ids[] |
string List of rules to exclude. |
CoreRuleSet
|
Field |
Description |
|
inbound_anomaly_score |
int64 Anomaly score. |
|
paranoia_level |
int64 Paranoia level. |
|
rule_set |
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. |
|
type |
enum RuleSetType Type of rule set.
|
|
id |
string ID of rule set. |
AnalyzeRequestBody
|
Field |
Description |
|
is_enabled |
bool Possible to turn analyzer on and turn if off. |
|
size_limit |
int64 Maximum size of body to pass to analyzer. In kilobytes. |
|
size_limit_action |
enum Action Action to perform if maximum size of body exceeded.
|
WafProfileRuleSet
|
Field |
Description |
|
core_rule_set |
Core rule set settings. See Basic rule set for details. Includes only one of the fields |
|
ya_rule_set |
Yandex rule set settings. Includes only one of the fields |
|
ml_rule_set |
Yandex Machine learning rule set settings. Includes only one of the fields |
|
priority |
int64 Priority of rule set. |
|
is_enabled |
bool Determines is it rule set enabled or not. |
|
action |
enum RuleSetAction Action to perfome on rule set match.
|
WafProfileCoreRuleSet
|
Field |
Description |
|
rule_set |
Required field. Rule set. |
|
inbound_anomaly_score |
int64 Anomaly score. |
|
paranoia_level |
int64 Paranoia level. |
WafProfileYaRuleSet
|
Field |
Description |
|
rule_set |
Required field. Rule set. |
|
rule_groups[] |
List of rule groups. |
RuleGroup
|
Field |
Description |
|
id |
string ID of the rule group. |
|
action |
enum Action Action to perfome on rule group match.
|
|
inbound_anomaly_score |
int64 Anomaly score. |
|
is_enabled |
bool Determines is it rule group enabled or not. |
WafProfileMlRuleSet
|
Field |
Description |
|
rule_set |
Required field. Rule set. |
|
rule_groups[] |
List of rule groups. |