Getting information about a WAF rule set
- In the management console
, select the folder containing the WAF profile. - In the list of services, select Smart Web Security.
- In the left-hand panel, select WAF profiles.
- Select the profile with the rule set you need.
- The Rule sets in order of priority section will display the information on rule sets:
- Rule set version.
- Number of active rules.
- Anomaly threshold and paranoia level (for the OWASP set).
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To get information about a WAF rule set using Terraform:
-
Add the
dataandoutputsections to the Terraform configuration file:data "yandex_sws_waf_rule_set_descriptor" "owasp4" { name = "OWASP Core Ruleset" version = "4.0.0" } output "waf_rules" { value = data.yandex_sws_waf_rule_set_descriptor.owasp4.rules }Where:
data "yandex_sws_waf_rule_set_descriptor": Description of the WAF rule set as a data source:name: Name of the WAF rule set.version: Rule set version.
output "waf_rules": Output variable that contains information about the WAF rule set:value: Return value.
You can replace
ruleswith any other parameter to get the information you need. For more information about theyandex_sws_waf_rule_set_descriptordata source properties, see this Terraform provider article. -
Create the resources:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
Terraform will create the required resources and display their output variables. To check the results, run this command:
terraform outputResult:
waf_rules = tolist([ { "anomaly_score" = 5 "id" = "owasp-crs-v4.0.0-id******-method-enforcement" "paranoia_level" = 1 }, ... { "anomaly_score" = 5 "id" = "owasp-crs-v4.0.0-id******-attack-java" "paranoia_level" = 4 }, ]) -
Use the get REST API method for the WafProfile resource or the WafProfile/Get gRPC API call.