Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • 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 tutorials
    • Basic SWS setup
    • Creating an L7 load balancer with a security profile through an Application Load Balancer ingress controller
    • Managing traffic sources
    • API Gateway protection with Smart Web Security
    • Emergency L7 DDoS protection in Application Load Balancer
    • Centralized online publication and DDoS protection of applications
    • Creating a distributed infrastructure with secure access
    • Deploying a web application on BareMetal servers with an L7 load balancer and Smart Web Security protection
    • 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

In this article:

  • Setup steps
  • Required paid resources
  • Create a security profile
  • Set up a rule for Tor, proxy, and anonymous networks
  • Set up a rule for VPN traffic
  • Set up a rule based on regions
  • Check the order of executing the rules
  • Test the rules in logging mode
  • Activate the production mode
  1. Tutorials
  2. Managing traffic sources

Managing traffic sources

Written by
Yandex Cloud
Updated at May 28, 2026
  • Setup steps
  • Required paid resources
  • Create a security profile
  • Set up a rule for Tor, proxy, and anonymous networks
  • Set up a rule for VPN traffic
  • Set up a rule based on regions
  • Check the order of executing the rules
  • Test the rules in logging mode
  • Activate the production mode

Smart Web Security allows you to configure request processing rules according to the source of traffic. For example, you can separately process requests from the Tor network, VPNs, anonymous networks, public proxies, or from individual countries.

All this is done with the help of preset Yandex Cloud IP address lists. These lists group IP addresses and networks together based on a particular characteristic, e.g., being Tor or VPN. The service maintains and regularly updates the lists.

This guide describes how to set up common traffic filtering rules based on source.

Setup stepsSetup steps

  1. Create a security profile.
  2. Set up a rule for Tor, proxy, and anonymous networks.
  3. Set up a rule for VPN traffic.
  4. Set up a rule based on regions.
  5. Check the order of executing the rules.
  6. Connect a security profile to the resources.
  7. Test the rules in logging mode.
  8. Activate the production mode.

Required paid resourcesRequired paid resources

  • Fee for the number of requests to Smart Web Security based on plans detailed in Yandex Smart Web Security pricing policy.
  • Fee for the infrastructure of the protected resource depending on its location.

This guide assumes that you already have a configured web resource in your Yandex Cloud infrastructure. If your web resource is located in a different infrastructure, connect it to a proxy server as per Setting up basic protection in Smart Web Security.

Create a security profileCreate a security profile

This guide uses a ready-made security profile template.

Management console
  1. In the management console, select the folder the protected resources are in.

  2. Go to Smart Web Security.

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

  4. Click Create profile and select From a preset template.

    A preset profile includes:

    • Basic default rule enabled for all traffic with the Allow action type.
    • Smart Protection rule, sp-rule-1, enabled for all traffic with the Full protection action type.
  5. Enter a name for the profile, e.g., sources-manage.

  6. Enable test mode for the sp-rule-1 Smart Protection rule:

    1. For Action for the default base rule, select Allow.
    2. Click next to sp-rule-1 and select Edit.
    3. Enable Only logging.
    4. Click Save changes.
  7. Under Fine-tuning ML models, do not withdraw your consent to the use of HTTP request info to improve your machine learning models. Otherwise, Smart Web Security will not be getting the data it needs to investigate security incidents.

  8. Click Create.

Set up a rule for Tor, proxy, and anonymous networksSet up a rule for Tor, proxy, and anonymous networks

Such traffic is identified with the help of the is_tor, is_proxy, and is_anonymous lists.

Management console
  1. Open the security profile you created earlier.
  2. Click  Add rule.
  3. Enter a name for the rule, e.g., traffic-sources-rule.
  4. Enable Only logging.
  5. Set a higher priority than the Smart Protection rules, e.g., 9100.
  6. Specify the rule settings:
    • Type: Base.
    • Traffic: On condition.
    • Conditions: IP.
    • Conditions for IP: IP belongs to the list.
  7. For the is_tor list, select Deny.
  8. Create a separate rule or add an additional condition for the is_proxy and is_anonymous lists with the Show CAPTCHA action.
  9. Click Add.

This set of rules helps block traffic from Tor immediately and, separately, check requests from public proxies and anonymous networks via SmartCaptcha.

Set up a rule for VPN trafficSet up a rule for VPN traffic

VPN traffic is identified with the help of the is_vpn and is_ml_vpn lists.

You can set separate processing rules for such traffic as per your security policy: allow, block, require CAPTCHA, or apply further restrictions in the ARL profile.

Warning

VPN traffic detection is based on Yandex Cloud IP addresses and does not guarantee complete accuracy. False positives and false negatives are a possibility. Your decision to block VPN traffic should align with your business scenarios, as some of your real users may be using VPN.

Management console
  1. In the security profile, click Add rule.
  2. Enter a name for the rule, e.g., vpn-traffic-rule.
  3. Enable Only logging.
  4. Set up priority for the rule to be executed in the right order relative to other rules in the lists.
  5. Specify the rule settings:
    • Type: Base.
    • Traffic: On condition.
    • Conditions: IP.
    • Conditions for IP: IP belongs to the list.
  6. Select the list: is_vpn or is_ml_vpn.
  7. Select the VPN traffic action:
    • Allow: If VPN traffic is allowed.
    • Deny: If VPN traffic has to be blocked.
    • Show CAPTCHA: If further verification is required.
  8. Click Add.

To limit the request rate for VPN traffic, create an ARL profile and add to it a rule with conditions for the is_vpn and is_ml_vpn lists.

Set up a rule based on regionsSet up a rule based on regions

Management console
  1. In the security profile, click Add rule.
  2. Enter a name for the rule, e.g., geo-traffic-rule.
  3. Enable Only logging.
  4. Set a higher priority than the Smart Protection rules but with due consideration for existing list-based rules.
  5. Specify the rule settings:
    • Type: Base.
    • Traffic: On condition.
    • Conditions: IP.
    • IP conditions: IP belongs to region or IP does not belong to region.
  6. Select the countries of interest using the two-letter code, e.g., RU, KZ, BY.
  7. Select an action:
    • Allow: To allow traffic.
    • Deny: To bock traffic.
    • Show CAPTCHA: To send requests to SmartCaptcha.
  8. Click Add.

If your service targets only a few countries, it is best to use the IP does not belong to region condition. Then you can explicitly specify allowed regions and restrict the rest of the traffic.

Check the order of executing the rulesCheck the order of executing the rules

Security profile rules are applied on first-to-trigger basis. Therefore, specify the processing order ahead of time:

  • First come the allowing rules for trusted traffic.
  • Then, rules for high-risk sources.
  • Then, rules based on regions.
  • After that, the Smart Protection rules and other general rules.

For more on the order of executing the rules, click here.

Test the rules in logging modeTest the rules in logging mode

Keep the new rules in the Only logging mode for a few days. During which period:

  • Analyze which requests are covered by the rules.
  • Estimate the share of legitimate traffic.
  • Update your lists, regions, and actions.

Use logs and the service's monitoring capabilities for your analysis. For more information, see Configuring logging via Smart Web Security and Monitoring in Smart Web Security.

Activate the production modeActivate the production mode

After testing, disable Only logging for the rules. Keep on monitoring and updating the rules as needed.

See alsoSee also

  • Lists
  • Conditions
  • Managing bot traffic
  • Setting up basic protection in Smart Web Security

Was the article helpful?

Previous
Creating an L7 load balancer with a security profile through an Application Load Balancer ingress controller
Next
Overview
© 2026 Direct Cursus Technology L.L.C.