Editing basic WAF profile settings
- 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.
- Click
next to the profile in question and select Edit. - On the profile editing page, update these settings:
- Name.
- Description.
- Labels. To add a label, click Add label.
- Click Save.
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 change the settings of a Yandex Smart Web Security WAF profile created with Terraform:
-
Open the Terraform configuration file and edit the section describing the WAF profile.
Example of a WAF profile description in the Terraform configuration
# In the basic set, rules of this paranoia level and below will be enabled locals { waf_paranoia_level = 1 } # OWASP Core Rule Set data source data "yandex_sws_waf_rule_set_descriptor" "owasp4" { name = "OWASP Core Ruleset" version = "4.0.0" } # WAF profile resource "yandex_sws_waf_profile" "default" { name = "<WAF_profile_name>" # Basic rule set core_rule_set { inbound_anomaly_score = 2 paranoia_level = local.waf_paranoia_level rule_set { name = "OWASP Core Ruleset" version = "4.0.0" } } # Enabling rules from the basic set if their paranoia level is not higher than the value defined in the waf_paranoia_level variable dynamic "rule" { for_each = [ for rule in data.yandex_sws_waf_rule_set_descriptor.owasp4.rules : rule if rule.paranoia_level <= local.waf_paranoia_level ] content { rule_id = rule.value.id is_enabled = true is_blocking = false } }
For more information about
sws_waf_profile
properties, see this Terraform provider article . -
Apply the changes:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validate
If the configuration is correct, you will get this message:
Success! The configuration is valid.
-
Run this command:
terraform plan
You 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
yes
and press Enter to confirm the changes.
-
You can check the resource updates in the management console
Use the update REST API method for the WafProfile resource or the WafProfile/Update gRPC API call.