Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Smart Web Security
  • Getting started
    • All guides
      • Creating a profile
      • Editing basic profile settings
      • Getting profile information
      • Deleting a profile
      • Configuring rule sets
      • Getting information about a rule set
      • Adding an exclusion rule
      • Updating an exclusion rule
      • Deleting an exclusion rule
    • Address lists
    • Viewing operations
    • Configuring monitoring
    • Setting up alerts
    • Configuring logs via Smart Web Security
    • Configuring logs via Application Load Balancer
    • Migrating to the new condition format in the API, CLI, and Terraform
    • Overview
    • Security profiles
    • WAF
    • ARL (request limit)
    • Rules
    • Conditions
    • Lists
    • Managing bot traffic
    • Protecting domains
    • Response templates
    • Logging
    • Quotas and limits
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. WAF profiles
  3. Adding an exclusion rule

Adding a WAF exclusion rule

Written by
Yandex Cloud
Updated at August 5, 2026
View in Markdown
Management console
Terraform
API
  1. In the management console, select the folder containing the WAF profile.

  2. Navigate to Smart Web Security.

  3. In the left-hand panel, select WAF profiles.

  4. Select the profile where you want to add an exclusion rule.

  5. In the left-hand menu, select Exclusion rules and click Create exception rule.

  6. Name the exclusion rule.

  7. Optionally, provide a description.

  8. Optionally, enable Write logs to log exception rule triggering.

  9. Under Excluded checks, select:

    • All rules: Exclusion will apply to all rules.
      Use this option if you need to completely disable WAF rules for the selected traffic. For example, use it if a certain endpoint accepts data formats that consistently trigger false positives.
    • Selected rules: Exclusion will apply to the specified rules. Click Add rules and select the rules that trigger false positives.
  10. Under Scope, select the traffic to exclude from the check:

    • Entire request: The exclusion will apply to the entire HTTP request.

    • Request part: The exclusion will apply only to selected parts of the request, thus allowing you to exclude only the particular questionable parameter. The rest of the request will be checked according to the WAF profile settings.

      In the Request parts field, select one or more of the following:

      • HTTP body: HTTP request body. Use if you get a false positive when parsing the request body, e.g., JSON, XML, forms.
      • Cookie: Cookie value.
      • HTTP header: HTTP header. Use if you get a false positive in a specific header's value, e.g., User-Agent, Referer, Authorization, or a custom header.
      • Query params: Query string parameters.

      Set one or more values for each parameter other than HTTP body. To add one more value for a parameter, click or. Enable Case sensitive as needed.

  11. Under Traffic conditions, specify the traffic the rule will apply to:

    • All traffic: Rule will apply to all traffic.

    • On condition: Rule will apply to the traffic defined in the Conditions field:

      • IP: IP address, IP address range, or IP address region.
      • HTTP header: HTTP header string.
      • Request URI: Request path.
      • Host: Domain receiving the request.
      • HTTP method: Request method.
      • Cookie: Cookie header string.
      • Bot name: Names of legitimate bots owned by various companies and services.
      • Bot category: Verified bot categories based on their purpose or nature of action.
      • Verified bot: Filtering based on whether the bot is verified (yes or no).
      • Bot score: Filtering based on request bot score, from 0 (the lowest, represents a human) to 100 (the highest, represents a bot).
      • FingerPrint: SSL/TLS connection fingerprint.

      You can set multiple conditions of the same type by selecting all the condition types you need in the Conditions field.

      You can also set multiple conditions of the same type at the same time by clicking and or or in the section with the condition you need.

      To delete a condition, click .

  12. Click Create.

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 guides on the Terraform website or its mirror.

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.

  1. Open the Terraform configuration file and edit the yandex_sws_waf_profile description: add the exclusion_rule section with a WAF exclusion rule.

    # 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>"
        condition {
          source_ip {
            ip_ranges_match {
              ip_ranges = [
                "<IP_address_range_1>",
                "<IP_address_range_2>",
                ...
                "<IP_address_range_n>"
              ]
            }
            ip_ranges_not_match {
              ip_ranges = [
                "<IP_address_range_3>",
                "<IP_address_range_4>",
                ...
                "<IP_address_range_y>"
              ]
            }
          }
        }
    
        exclude_rules {
          exclude_all = <true_or_false>
          rule_ids    = [
            "rule_ID_1",
            "rule_ID_2",
            ...
            "rule_ID_n",
          ]
        }
      }
    }
    

    Where:

    • exclusion_rule:
      • name: Exclusion rule name.

      • condition: Conditions for the exception rule to trigger. The above example uses a condition based on the traffic source IP address.

        Under condition, you can specify multiple different condition types at the same time.

      • exclude_rules: Exclusion rule settings:

        • exclude_all: Exclusion will apply to all rules. It can be either false or true.
        • rule_ids: List of IDs of rules from the basic set to which the exclusion will apply. To specify individual rules, set exclude_all to false.

    For more on the properties of the sws_waf_profile resource, see this provider guide.

  2. Create the resources:

    1. In the terminal, navigate to the configuration file directory.

    2. Make sure the configuration is correct using this command:

      terraform validate
      

      If the configuration is valid, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You 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.

    4. Apply the configuration changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

You can check the resource update in the management console.

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

Useful linksUseful links

  • Configuring WAF rule sets
  • Deleting a WAF exclusion rule
  • Adding a rule to a security profile

Was the article helpful?

Previous
Getting information about a rule set
Next
Updating an exclusion rule
© 2026 Direct Cursus Technology L.L.C.