Deleting a WAF profile
Before deleting a WAF profile, delete all WAF rules from the associated security profiles.
-
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.
-
Save or memorize the ID of the profile you want to delete.
-
In the left-hand panel, select Security profiles and then the security profile that uses the WAF profile you want to delete.
-
In the Security rules tab, delete the WAF profile rules:
- In the Rule type: filter, select
Web Application Firewall. - Next to the rule associated with the WAF profile with the relevant ID, click
and select Delete. - Confirm the deletion.
- In the Rule type: filter, select
-
Similarly, delete the WAF rules from all associated security profiles.
-
In the left-hand panel, select WAF profiles.
-
Next to the profile in question, click
and select Delete. -
Confirm the deletion.
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 delete a Yandex Smart Web Security WAF profile created with Terraform:
-
Open the Terraform configuration file and delete 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 } } analyze_request_body { is_enabled = true size_limit = 8 size_limit_action = "IGNORE" } } -
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 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.
-
You can check the deletion of the resources in the management console
Use the delete REST API method for the WafProfile resource or the WafProfile/Delete gRPC API call.