Deleting a WAF profile
Before you delete a WAF profile, delete all WAF rules from the associated security profiles.
-
In the management console
, select the folder containing the WAF profile. -
Navigate
to 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. - Click
→ Delete next to the rule associated with the WAF profile with the relevant ID. - 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, click
→ Delete. -
Confirm the deletion.
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the guides on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
To delete the Yandex Smart Web Security WAF profile you created with the help of Terraform:
-
Open the Terraform configuration file and delete the fragment describing the WAF profile.
Example of a WAF profile description in the Terraform configuration
# Declaring local variables locals { # In the basic set, rules of this paranoia level and below will be enabled waf_paranoia_level = 1 # OWASP Core Ruleset identification ruleset_name = "OWASP Core Ruleset" ruleset_version = "4.0.0" ruleset_id = "OWASP_CRS_4_0_0" ruleset_type = "CORE" } # OWASP Core Rule Set data source data "yandex_sws_waf_rule_set_descriptor" "source" { name = local.ruleset_name version = local.ruleset_version } # WAF profile resource "yandex_sws_waf_profile" "default" { name = "waf-profile-owasp" # Rule set rule_set { action = "DENY" is_enabled = true priority = 1 # Basic rule set core_rule_set { inbound_anomaly_score = 2 paranoia_level = local.waf_paranoia_level rule_set { name = local.ruleset_name version = local.ruleset_version id = local.ruleset_id type = local.ruleset_type } } } # 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.source.rules : rule if rule.paranoia_level <= local.waf_paranoia_level ] content { rule_id = rule.value.id is_enabled = true is_blocking = false } } } -
Apply the changes:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration 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.