Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Smart Web Security
  • Getting started
    • All guides
      • Creating a profile
      • Editing basic profile settings
      • Getting information about a profile
      • Deleting a profile
      • Configuring a basic rule set
      • Adding an exclusion rule
      • Updating an exclusion rule
      • Deleting an exclusion rule
    • Managing address lists
    • Viewing operations with profiles
    • Configuring monitoring
    • Setting up alerts
    • Configuring logging
    • Overview
    • Security profiles
    • WAF
    • ARL (request limit)
    • Rules
    • Conditions
    • Lists
    • Quotas and limits
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Managing WAF profiles
  3. Updating an exclusion rule

Updating a WAF exclusion rule

Written by
Yandex Cloud
Updated at April 22, 2025
Management console
Terraform
API
  1. In the management console, select the folder the WAF profile is in.
  2. In the list of services, select Smart Web Security.
  3. In the left-hand panel, select WAF profiles.
  4. Select the profile you want to update an exclusion rule in.
  5. In the left-hand menu, go to the Exclusion rules tab.
  6. In the rule row, click and select Edit. In the window that opens:
    1. Edit the exclusion rule name and description.

    2. (Optional) Enable Write logs to log exception rule triggering.

    3. Under Scope of use, update rules from the basic set for which the exclusion will be valid:

      • All rules: Exclusion will be valid for all rules.

      • Selected rules: Exclusion will be valid for the selected rules.

        Click Add rules to select rules from the basic set.

    4. Under Traffic conditions, specify which traffic the rule will be used to analyze:

      • All traffic: The rule will be used to analyze the whole traffic.

      • On condition: The rule will be used to analyze the traffic specified in the Conditions field:

        • IP: IP address, IP address range, or IP address region.
        • HTTP header: HTTP header string.
        • HTTP body: String in the HTTP body.
        • Request URI: Request path.
        • Host: Domain receiving the request.
        • HTTP method: Request method.
        • Cookie: Cookie header string.

        You can set multiple conditions of the same type. To do this, select all the condition types you need in the Conditions field.

        You can also set multiple conditions of the same type at the same time. To do this, click and or or in the section with the condition you need.

        To delete a condition, click .

    5. Click Save.

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

  1. Open the Terraform configuration file and edit the exclusion_rule section with the exclusion rule in yandex_sws_waf_profile description.

    # WAF profile
    resource "yandex_sws_waf_profile" "default" {
      name = "waf-profile-default"
      core_rule_set {
        inbound_anomaly_score = 2
        paranoia_level        = local.waf_paranoia_level
        rule_set {
          name    = "OWASP Core Ruleset"
          version = "4.0.0"
        }
      }
    
      ...
    
      # Exclusion rule
      exclusion_rule {
        name = "<exclusion_rule_name>"
        exclude_rules {
          exclude_all = <true_or_false>
          rule_ids    = ["rule_1_ID","rule_2_ID"]
        }
      }
    }
    

    For more information about the sws_waf_profile parameters in Terraform, see the relevant Terraform article.

  2. Apply the changes:

    1. In the terminal, change to the folder where you edited the configuration file.

    2. 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.
      
    3. 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.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

You can check the resources’ updates in the management console.

Use the update REST API method for the WafProfile resource or the WafProfile/Update gRPC API call.

See alsoSee also

  • Adding a WAF exclusion rule
  • Deleting a WAF exclusion rule
  • Configuring a WAF basic rule set

Was the article helpful?

Previous
Adding an exclusion rule
Next
Deleting an exclusion rule
Yandex project
© 2025 Yandex.Cloud LLC