Deleting a rule from an ARL profile
Basic rules, as well as Smart Protection and WAF rules, are deleted from a security profile.
- In the management console
, select the folder with the ARL profile. - In the list of services, select Smart Web Security.
- In the left-hand panel, select
ARL profiles. - Select the profile where you want to delete a rule.
- Under Rules, next the rule 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 an ARL profile rule created with Terraform:
-
Open the Terraform configuration file and remove the
advanced_rate_limiter_rulesection from theyandex_sws_advanced_rate_limiter_profiledescription.Example of an ARL profile description in the Terraform configuration
# ARL profile resource "yandex_sws_advanced_rate_limiter_profile" "arl-profile" { name = "<profile_name>" description = "<profile_description>" ... # Rule 2 advanced_rate_limiter_rule { name = "<rule_name>" priority = <rule_priority> description = "<rule_description>" dry_run = true static_quota { action = "DENY" limit = <rule_limit> period = <rule_period> condition { source_ip { geo_ip_match { locations = ["ru", "kz"] } } } } } }Where:
name: ARL profile name.description: ARL profile description. This is an optional setting.labels: ARL profile labels. This is an optional setting.advanced_rate_limiter_rule: Rule section.name: Rule name.priority: Rule priority, a unique number from1to999999. Rules with smaller numerical values apply first.description: Rule description. This is an optional setting.dry_run: Dry run flag. Set it totrueto test the rule and estimate the load on your web service. Requests will not be blocked in this mode. However, the system will log triggered rules. This is an optional setting.static_quota: Request count mode where each request is counted individually without grouping. You can only specify eitherstatic_quotaordynamic_quota.action: Action if the limit is exceeded. Always set it toDENY.limit: Maximum number of allowed requests per period.period: Time period in seconds during which the limit applies.condition: Condition for applying the rule. This is an optional setting. For more information, see theadvanced_rate_limiter_rule.static_quota.conditiondescription in this provider article.
dynamic_quota: Request count mode where groups of requests sharing one or more properties are counted. You can only specify eitherstatic_quotaordynamic_quota.action: Action if the limit is exceeded. Always set it toDENY.limit: Maximum number of allowed requests per period.period: Time period in seconds during which the limit applies.condition: Condition for applying the rule. This is an optional setting. For more information, see theadvanced_rate_limiter_rule.dynamic_quota.conditiondescription in this provider article.characteristic: Description of properties to group requests by. You can only specify eithersimple_characteristicorkey_characteristic.case_insensitive: Case insensitive, iftrue, or sensitive, iffalse.key_characteristic: Section of parameters requiring a key (string) to group requests by.type: Grouping type. The possible values areCOOKIE_KEY,HEADER_KEY, andQUERY_KEY.value: Key value (string) to group requests by.
simple_characteristic: Section with parameters for autogrouping, i.e., requests are automatically grouped by the specified parameter.type: Grouping type. The possible values areREQUEST_PATH,HTTP_METHOD,IP,GEO, andHOST.
-
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 update REST API method for the AdvancedRateLimiterProfile resource or the AdvancedRateLimiterProfile/Update gRPC API call.