How to Plan Separate WAF Rate Limits for Different URL Paths

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

How to Plan Separate WAF Rate Limits for Different URL Paths

如何规划针对不同 URL 路径的独立 WAF 速率限制

A login endpoint and a product catalog rarely need the same traffic policy. Login attempts can be expensive or security-sensitive, while browsing often produces legitimate bursts. If you are researching how to apply separate WAF rate limits to different URL paths, start by separating your policy requirements from the controls your deployment actually documents. SafeLine’s official overview lists IP-based rate limiting and describes throttling traffic that exceeds defined limits. However, the supplied documentation does not describe URL-path matching for rate limits, independent counters for different paths, rule priority, or the configuration procedure for those controls. This guide therefore provides a numbered setup and verification checklist without claiming that SafeLine supports a particular per-path configuration. Source: SafeLine overview

登录端点和产品目录很少需要相同的流量策略。登录尝试可能成本高昂或涉及安全敏感信息,而浏览行为通常会产生合法的流量突发。如果您正在研究如何对不同的 URL 路径应用独立的 WAF 速率限制,请首先将您的策略需求与部署文档中实际记录的控制功能区分开来。雷池(SafeLine)的官方概述列出了基于 IP 的速率限制,并描述了对超出定义限制的流量进行限速。然而,所提供的文档并未描述用于速率限制的 URL 路径匹配、针对不同路径的独立计数器、规则优先级或这些控制功能的配置过程。因此,本指南提供了一份编号的设置和验证清单,但并不声称雷池支持特定的路径配置。来源:雷池概述

  1. Group URL paths by application behavior Create an inventory of the endpoints you want to protect. Group them by workload and user behavior before choosing limits. For example, your planning worksheet might contain: /login: credential submission, with relatively few expected attempts per user. /api/search: interactive queries, with bursts during normal browsing. /reports/export: expensive jobs that may consume significant application resources. /assets/: static resources that browsers request together. These are illustrative application paths, not SafeLine configuration examples. Record the HTTP methods as well: loading a login page and submitting credentials can have different operational consequences even when they share a path.

  2. 按应用程序行为对 URL 路径进行分组 创建您想要保护的端点清单。在选择限制条件之前,根据工作负载和用户行为对它们进行分组。例如,您的规划工作表可能包含:/login:凭据提交,预期每个用户的尝试次数相对较少。/api/search:交互式查询,在正常浏览期间会有流量突发。/reports/export:可能会消耗大量应用程序资源的昂贵作业。/assets/:浏览器共同请求的静态资源。这些是说明性的应用程序路径,而非雷池的配置示例。同时记录 HTTP 方法:即使共享同一路径,加载登录页面和提交凭据也可能产生不同的操作后果。

  3. Define what each proposed limit should count For every group, write down the intended identity, measurement window, threshold, and response. Treat these as requirements to verify, not as available product settings. One key question is whether requests should count against an IP address, an authenticated account, or another identifier. SafeLine explicitly documents IP-based rate limiting; the supplied sources do not establish account-based or token-based counters. Source: SafeLine overview With an IP-based policy, consider legitimate users who share an outbound address, such as employees behind a corporate gateway. Also consider a client that calls several endpoints in one workflow. Your requirements should state whether activity on one path may consume another path’s allowance.

  4. 定义每个拟议限制的统计对象 对于每个组,写下预期的标识、测量窗口、阈值和响应。将这些视为需要验证的需求,而不是现成的产品设置。一个关键问题是请求应该针对 IP 地址、已认证账户还是其他标识符进行计数。雷池明确记录了基于 IP 的速率限制;所提供的来源并未建立基于账户或令牌的计数器。来源:雷池概述。在使用基于 IP 的策略时,请考虑共享同一个出站地址的合法用户,例如位于企业网关后的员工。还要考虑在一次工作流中调用多个端点的客户端。您的需求应说明在一个路径上的活动是否会消耗另一个路径的配额。

  5. Establish the documented SafeLine deployment foundation If SafeLine is not installed, first check the official deployment prerequisites. The installation guide lists Linux, Docker version 20.10.14 or above, Docker Compose version 2.0.0 or above, and a minimum environment of one CPU core, 1 GB of memory, and 5 GB of disk space. Consult the guide for architecture and CPU instruction requirements before selecting a host. Source: Install SafeLine Follow the installation guide’s deployment procedure. It documents the web console at https://:9443/ and the administrator account command docker exec safeline-mgt resetadmin. These establish administrative access; they do not configure path-specific rate limits. Source: Install SafeLine

  6. 建立有据可查的雷池部署基础 如果尚未安装雷池,请先检查官方部署先决条件。安装指南列出了 Linux、Docker 20.10.14 或更高版本、Docker Compose 2.0.0 或更高版本,以及至少一个 CPU 核心、1 GB 内存和 5 GB 磁盘空间的最低环境要求。在选择主机之前,请查阅指南了解架构和 CPU 指令要求。来源:安装雷池。遵循安装指南的部署程序。它记录了位于 https://:9443/ 的 Web 控制台以及管理员账户命令 docker exec safeline-mgt resetadmin。这些操作建立了管理访问权限;它们并不配置特定于路径的速率限制。来源:安装雷池

  7. Add the application and verify routing In the SafeLine Web Admin Console, open Applications and select Add Application. The documented application settings include the domain, listening port, and upstream address. For HTTPS applications, the guide instructs you to select the SSL option. After configuration, resolve the application domain to the SafeLine server’s IP address. Source: Protecting an application SafeLine operates as an HTTP/HTTPS reverse proxy, receiving application traffic and forwarding accepted traffic to the upstream application. Verify ordinary application behavior through that route before evaluating traffic policies. Source: Protecting an application

  8. 添加应用程序并验证路由 在雷池 Web 管理控制台中,打开“应用程序”并选择“添加应用程序”。记录的应用程序设置包括域名、监听端口和上游地址。对于 HTTPS 应用程序,指南指示您选择 SSL 选项。配置完成后,将应用程序域名解析到雷池服务器的 IP 地址。来源:保护应用程序。雷池作为 HTTP/HTTPS 反向代理运行,接收应用程序流量并将接受的流量转发到上游应用程序。在评估流量策略之前,请通过该路由验证正常的应用程序行为。来源:保护应用程序

  9. Verify path-specific controls before configuring a policy Use your endpoint worksheet to evaluate the controls documented for your installed release. Establish whether they can express all of the following: An exact path or a path prefix. Separate thresholds for different path groups. Independent counters for those groups. Predictable behavior when matching rules overlap. Defined treatment of query strings, trailing slashes, and encoded paths. The supplied SafeLine sources do not answer these questions. Do not infer rate-limit matching behavior from the presence of application routing or a Web Access Control List in the product overview. Those documented capabilities do not, by themselves, establish per-path rate-limit rules. Source: SafeLine overview If path-specific controls cannot be verified, keep separate URL limits as an unresolved requirement. Evaluate a documented enforcement mechanism in your application or existing traffic infrastructure before promising the behavior to stakeholders.

  10. 在配置策略前验证特定路径的控制功能 使用您的端点工作表来评估您所安装版本中记录的控制功能。确定它们是否能够表达以下所有内容:精确路径或路径前缀。针对不同路径组的独立阈值。针对这些组的独立计数器。匹配规则重叠时的可预测行为。对查询字符串、尾部斜杠和编码路径的明确处理。所提供的雷池来源并未回答这些问题。不要根据产品概述中存在应用程序路由或 Web 访问控制列表来推断速率限制的匹配行为。这些记录的功能本身并不能建立针对路径的速率限制规则。来源:雷池概述。如果无法验证特定路径的控制功能,请将独立的 URL 限制作为未解决的需求。在向利益相关者承诺该行为之前,请评估您的应用程序或现有流量基础设施中记录的执行机制。

  11. Test the intended separation under controlled traffic Once you have a documented mechanism that meets the requirements, validate it in an authorized test environment. Send traffic to one path group until its configured threshold is reached, then check whether another group remains available as intended. Repeat the test with shared client addresses, overlapping prefixes, and normal multi-endpoint workflows. Record the observed response and application impact. Do not assume a particular rejection status code, response header, or counter reset behavior without documentation or direct verification. Does the supplied documentation confirm separate SafeLine limits for each URL path? No. It confirms IP-based rate limiting and throttling above defined limits, but does not document path-specific matching or separate path counters. Source: SafeLine overview Can I choose thresholds before configuring the WAF? Yes. Use representative application traffic and endpoint cost to propose thresholds. Keep those values provisional until testing shows that ordinary user workflows remain usable. Should static assets and login requests share one policy? Assess the

  12. 在受控流量下测试预期的隔离效果 一旦您拥有了符合要求的记录机制,请在授权的测试环境中对其进行验证。向一个路径组发送流量,直到达到其配置的阈值,然后检查另一个组是否仍按预期可用。使用共享客户端地址、重叠前缀和正常的多端点工作流重复测试。记录观察到的响应和应用程序影响。在没有文档或直接验证的情况下,不要假设特定的拒绝状态码、响应头或计数器重置行为。所提供的文档是否确认了雷池对每个 URL 路径的独立限制?不。它确认了基于 IP 的速率限制和对超出定义限制的流量进行限速,但并未记录特定于路径的匹配或独立的路径计数器。来源:雷池概述。我可以在配置 WAF 之前选择阈值吗?可以。使用具有代表性的应用程序流量和端点成本来提出阈值。在测试表明普通用户工作流仍然可用之前,请将这些值保持为临时值。静态资源和登录请求应该共享一个策略吗?请评估。