Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML Services
    • Business tools
  • 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
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 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
    • API Gateway protection with Smart Web Security
    • Emergency L7 DDoS protection in Application Load Balancer
    • Centralized online publication and DDoS protection of applications
    • 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
    • Protecting domains
    • Logging
    • Quotas and limits
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Conditions to implement the described solution
  • Steps to set up protection
  • Required paid resources
  • Create a security profile
  • Associate the security profile with the virtual host
  • Configure an existing security profile
  • Test the security profile
  • Monitoring
  • Logging
  • Set up additional DDoS protection rules
  • Set a request limit
  • Configure blocking by IP address lists
  • Configure blocking by IP address region
  • How to delete the resources you created
  1. Tutorials
  2. Emergency L7 DDoS protection in Application Load Balancer

Emergency DDoS protection in Application Load Balancer, L7

Written by
Yandex Cloud
Updated at July 23, 2025
  • Conditions to implement the described solution
  • Steps to set up protection
  • Required paid resources
  • Create a security profile
  • Associate the security profile with the virtual host
  • Configure an existing security profile
  • Test the security profile
    • Monitoring
    • Logging
  • Set up additional DDoS protection rules
    • Set a request limit
    • Configure blocking by IP address lists
    • Configure blocking by IP address region
  • How to delete the resources you created

This guide will help you stop a live DDoS attack.

Conditions to implement the described solutionConditions to implement the described solution

  • Your services are hosted in Yandex Cloud or connected to Application Load Balancer via Cloud Interconnect.
  • You used an L7 Application Load Balancer to publish your services online.
  • The DDoS attack targets the application layer (L7) by flooding it with HTTP requests (GET/POST).

Tip

Estimate your standard service load. You can do this in Application Load Balancer under Monitoring. The RPS chart displays the total number of incoming requests per second the load balancer receives. To analyze the normal load, select a period before the DDoS attack.

Steps to set up protectionSteps to set up protection

To stop a DDoS attack, you need to connect Smart Web Security and set up rules to block malicious traffic.

  1. Create a security profile.

  2. Associate the security profile with a virtual host.

    If you have an existing security profile associated with a host, check the profile settings.

  3. Test the security profile.

  4. Set up additional DDoS protection rules.

After you stop the attack, you can set up dedicated protection for your service in Smart Web Security. If you no longer need the resources you created, delete them.

Required paid resourcesRequired paid resources

The cost of infrastructure for DDoS protection includes a fee for requests processed by security profile rules (see Yandex Smart Web Security pricing).

Create a security profileCreate a security profile

Security profiles are the main component of Smart Web Security. A profile consists of rules for handling HTTP traffic. Such rules define filtering conditions and actions to apply to the traffic flowing through a virtual host of an L7 load balancer.

To quickly deploy protection, you can use the preset template. The template contains optimal settings for basic protection of web services.

To create a security profile:

Management console
  1. In the management console, select the folder the protected resources are in.
  2. In the list of services, select Smart Web Security.
  3. In the left-hand panel, select Security profiles.
  4. Click Create profile and select From a preset template.
  5. Enter a name for the profile, e.g., anti-ddos.
  6. In the Action for the default base rule field, select Deny.
  7. In the SmartCaptcha list, leave the Default value.
  8. Click Create.

Associate the security profile with the virtual hostAssociate the security profile with the virtual host

If the load balancer is managed by an Application Load Balancer ingress controller, use the ingress resource annotation.

Management console
  1. At the top right of the page with security profile properties, click Connect to host.

  2. Select the following in the given order:

    • Load balancer.

    • HTTP router.

    • Virtual host. You can associate the security profile with multiple virtual hosts at once.

      To connect another L7 load balancer, click Add load balancer.

  3. Click Connect.

    In the Connected hosts tab, you will see the connected virtual hosts.

Configure an existing security profileConfigure an existing security profile

If you have an existing security profile, check and adjust its parameters:

  1. SmartCaptcha: Default

  2. Make sure there is a rule named sp-rule-1 with the following parameters:

    • Type: Smart Protection
    • Action: Full protection for website protection with suspicious requests redirected to SmartCaptcha or API protection to block suspicious requests.
    • Conditions: All traffic
    • Priority: 999900
  3. Make sure there is a basic rule with the following parameters:

    • Action: Deny
    • Conditions: All traffic
    • Priority: 1000000

Test the security profileTest the security profile

To test your security profile, use information from monitoring charts and logs.

MonitoringMonitoring

Management console
  1. From the list of services, select Smart Web Security.
  2. Navigate to Monitoring.
  3. Examine the data displayed on the charts:
    • Denied by Security Profile RPS: Number of incoming requests per second the security profile has checked and blocked.
    • Redirected to SmartCaptcha RPS: Number of incoming requests per second routed to SmartCaptcha for additional verification.
    • Denied by ARL Profile RPS: Number of incoming requests per second exceeding the ARL profile limit and blocked.

For detailed description of charts, see Monitoring in Smart Web Security.

LoggingLogging

Management console
  1. Make sure you have configured logging for the L7 load balancer.

  2. From the list of services, select Application Load Balancer.

  3. Select the load balancer with an associated security profile.

  4. Navigate to Logs.

  5. Select the number of messages per page and the period, e.g., 1 hour.

  6. In the Query field, specify you query using the filter expression language and click Run.

    Request examples:

    • Show requests which triggered a Smart Protection rule with a CAPTCHA challenge:

      json_payload.smartwebsecurity.matched_rule.rule_type = SMART_PROTECTION and json_payload.smartwebsecurity.matched_rule.verdict = CAPTCHA
      
    • Show requests blocked by the ARL profile rules:

      json_payload.smartwebsecurity.advanced_rate_limiter.verdict = DENY
      

For more information about working with logs, see Configuring logging via Smart Web Security.

Set up additional DDoS protection rulesSet up additional DDoS protection rules

To protect your service against load bursts, set a request limit in the ARL (Advanced Rate Limiter) profile.

Set a request limitSet a request limit

Management console
  1. From the list of services, select Smart Web Security.

  2. In the left-hand panel, select ARL profiles.

  3. Click Create ARL profile.

  4. Enter a name for the profile, e.g., anti-ddos-arl.

  5. Click Add rule and specify:

    • Name: arl-rps.
    • Priority: 1000.
    • Traffic: All traffic.
    • Request grouping: Without grouping.
    • Request limit: Specify the average number of requests for your service with a small margin. All requests above the limit will be blocked.
  6. Click Save rule.

  7. Click Create.

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

  9. Click next to the anti-ddos profile and select Edit.

  10. From the list of ARL profiles, select anti-ddos-arl.

  11. Click Save.

Configure blocking by IP address listsConfigure blocking by IP address lists

Smart Web Security has pre-configured lists of untrusted addresses, which get updated on a regular basis. You can create your own lists of trusted or untrusted addresses and add them to request filtering conditions.

Management console
  1. From the list of services, select Smart Web Security.
  2. In the left-hand panel, select Security profiles.
  3. Select the anti-ddos security profile.
  4. Click Add rule.
  5. Enter the Name, e.g., block-by-list.
  6. Specify the rule settings:
    • Priority: Higher than that of sp-rule-1, e.g., 1000.
    • Type: Base.
    • Action: Deny or Show CAPTCHA.
    • Traffic: On condition.
    • Conditions: IP.
    • Conditions for IP: IP belongs to the list.
    • Select the address lists. Requests from these addresses will be blocked.
      • is_ddoser: List of IP addresses used in DDoS attacks.
      • Click + or and select is_tor: IP addresses of the Tor network used for traffic anonymization.
      • Click + or and select is_anonimous: IP addresses of anonymous networks frequently used to hide one’s identity.
  7. Click Add.

Configure blocking by IP address regionConfigure blocking by IP address region

Management console

Block all requests from the region the attack is coming from. If your service does not operate in certain regions, you can block traffic from those regions in advance. DDoS attacks often come from IP addresses of non-target countries.

  1. Select the anti-ddos security profile.

  2. Click Add rule.

  3. Enter the Name, e.g., block-by-geo.

  4. Specify the rule settings:

    • Priority: Higher than that of sp-rule-1 but lower than that of block-by-list, e.g., 2000.

    • Type: Base.

    • Action: Deny or Show CAPTCHA.

    • Traffic: On condition.

    • Conditions: IP.

    • Conditions for IP: IP belongs to the region.

    • Select the region the attack is coming from, e.g., CN, US, or IN.

      To add another region, click + or.

    Tip

    If your service operates only in certain regions, select the IP does not belong to the region condition. In the list, specify the target region, e.g., RU. Traffic from other regions will be blocked.

    You can check the region of an IP address at ipinfo.io or with an ASN provider.

  5. Click Add.

Use information from monitoring charts and logs to test the rules. If necessary, adjust the request limit in the ARL profile.

How to delete the resources you createdHow to delete the resources you created

To stop paying for the resources you created, do one of the following:

  1. Disassociate the security profile from the virtual host.
  2. Delete the security profile.

Was the article helpful?

Previous
API Gateway protection with Smart Web Security
Next
Centralized online publication and DDoS protection of applications
© 2025 Direct Cursus Technology L.L.C.