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 the WAF profile is in. -
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 profile that uses the WAF profile you want to delete.
Security profiles and then the -
In the Security rules tab, delete the WAF profile rules:
- In the Rule type: filter, select
Web Application Firewall
. - In the row with 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. -
In the row with the profile you need, 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 documentation on the Terraform
If you don't have Terraform, 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 fragment with the WAF profile description.
Below is an example of a WAF profile description in the Terraform configuration
# In the basic set, rules of this paranoia level and below will be active 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" } } # Activating rules from the basic set if their paranoia level is not higher than specified 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, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
-
You can check the deletion of the resources using the management console
Use the delete REST API method for the WafProfile resource or the WafProfile/Delete gRPC API call.