open-appsec
WebsiteManagement PortalPlaygroundGitHub
  • open-appsec Documentation
  • What is open-appsec?
  • open-appsec Video Tutorials
  • Release Notes
  • Getting started
    • Getting Started
    • Start With Kubernetes
      • Install Using Interactive CLI Tool (Ingress NGINX)
      • Configuration Using Interactive CLI Tool
      • Install Using Helm
      • Install Using Helm - new flow (beta)
      • Configuration Using CRDs
      • Configuration Using CRDs - v1beta2
      • Configuration using CRDs - special options for Large Scale Deployments
        • Using appsec class for assigning separate custom resources to specific deployments
        • Using namespace-scoped custom resources
      • Monitor Events
    • Start With Linux
      • Install open-appsec for Linux
      • Using the open-appsec-ctl Tool
      • Configuration Using Local Policy File (Linux)
      • Local Policy File (Advanced)
      • Local Policy File v1beta2 (beta)
      • Monitor Events
    • Start with Docker
      • Install With Docker (Centrally Managed)
      • Install With Docker (Locally Managed)
      • Deploy With Docker-Compose (Beta)
      • Configuration Using Local Policy File (Docker)
      • Local Policy File (Advanced)
    • Using the Web UI (SaaS)
      • Sign-Up and Login to Portal
      • Agents Deployment
      • Connect Deployed Agents to SaaS Management Using Tool (K8s & Linux)
      • Connect Deployed Agents to SaaS Management Using Helm (K8s)
      • Connect Deployed Agents to SaaS Management (Docker)
      • Create a Profile
      • Protect Additional Assets
      • Monitor Events
    • Using the Advanced Machine Learning Model
  • Concepts
    • Agents
    • Management & Automation
    • Security Practices
    • Contextual Machine Learning
  • SETUP INSTRUCTIONS
    • Setup Web Application Settings
    • Setup Custom Rules and Exceptions
    • Setup Web User Response Pages
    • Setup Log Triggers
    • Setup Behavior Upon Failure
    • Setup Agent Upgrade Schedule
  • Additional Security Engines
    • Anti-Bot
    • API Schema Enforcement
    • Data Loss Prevention (DLP) Rules
    • File Security
    • Intrusion Prevention System (IPS)
    • Rate Limit
  • Snort Rules
    • Import Snort Rules
    • Write Snort Signatures
  • HOW TO
    • Configuration and Learning
      • Track Learning and Move From Learn/Detect to Prevent
      • Configure Contextual Machine Learning for Best Accuracy
      • Track Learning and Local Tuning in Standalone Deployments
      • Move From Detect to Prevent in K8s With Many Ingress Rules
  • Deployment and Upgrade
    • Load the Attachment in Proxy Configuration
    • Upgrade Your Reverse Proxy/API Gateway When an Agent is Installed
    • Integration in GitOps CD (K8s)
    • Build open-appsec Based on Source Code
  • Management Web UI
    • Track Agent Status
    • Delete or Reset Management Tenant (SaaS)
    • Disconnect an open-appsec agent from Central Management
  • Integrations
    • About Integrations With 3rd Party Solutions
    • CrowdSec
      • CrowdSec Bouncer Support
      • CrowdSec Intelligence Sharing Using open-appsec Parser/Scenario
    • NGINX Proxy Manager
      • Install NGINX Proxy Manager with open-appsec managed from NPM WebUI
      • Install NGINX Proxy Manager with open-appsec managed from central WebUI (SaaS)
      • Frequently Asked Questions
      • How to Migrate from an Existing NGINX Proxy Manager Deployment and Keep Configuration
    • NPMplus
    • Docker SWAG
      • Install Docker SWAG with open-appsec (locally managed)
      • How to connect locally managed Docker SWAG with open-appsec to WebUI
      • Install Docker SWAG with open-appsec (centrally managed)
      • Deploy Docker SWAG with docker-compose (beta)
      • Frequently Asked Questions
  • Troubleshooting
    • Troubleshooting
    • Troubleshooting Guides
      • Configuration contains ingress/asset with URL which already has asset attached to it in your tenant
      • HTTP Request to Port 80 Not Returning as Expected
      • Agent Fails to Recognize HTTP Transactions with NGINX
      • Agent Not Recognizing Initial HTTP Requests
      • Handling Large Requests (413 Responses)
      • open-appsec on Docker HTTP Transaction Handler Is Set To Ready
      • Traffic Recognition Issue on Single-Core Machine/Connection Timed Out
      • Installing open-appsec on CentOS 7
      • SELinux: checking status and disabling
      • Deploy open-appsec directly on the web server hosting the application to protect
      • object is locked or remote, and therefore cannot be modified
      • Failed to Register to Fog
  • references
    • Agent CLI
    • Event Query Language
    • Events/Logs Schema
    • WAF Comparison Project
Powered by GitBook
On this page

Was this helpful?

  1. Additional Security Engines

Rate Limit

Rate Limit / DDOS Control

PreviousIntrusion Prevention System (IPS)NextSnort Rules

Last updated 3 months ago

Was this helpful?

open-appsec agents can limit the number of requests to a matched URI within a configured time scope, according to the source identifier.

How to set up rate-limiting

Prerequisites

An agent from version 1.1.2 and up is required.

Step 1: Activate Rate Limit from the Practices tab when editing an asset

Browse to Assets and edit the relevant Web Application asset. Choose the RATE LIMIT tab.

Pay attention to the configuration of Source Identity. When counting requests to see if a limit was exceeded, the source identity is the key according to which they are counted,

i.e. "X requests from the same source identifier...".

In the community edition, only IP and X-Forwarded-For are supported as Source Identities.

If the source identity configuration doesn't match a value, the source IP address is used instead to count the request.

Step 2: Determine the mode of the Rate Limit configuration:

There are 3 optional modes:

  • Prevent - Rate limit is enforced.

  • Detect/Learn - Only logs will be issued if the rate limit is reached.

  • Inactive - Temporarily disable the rate limit function, instead of deleting the practice altogether.

Step 3: Configure Rate Limit Rules

When creating a new rule or editing an existing rule, a configuration window will open:

A rate limit rule consists of:

  • Action configuration. there are 3 options:

    1. According to practice - The action will be determined by the practice mode previously configured.

    2. Detect - Only logs will be issued if the rate limit for this rule is reached. This will override the practice mode unless it is Inactive.

    3. Prevent - Rate limit for this rule is enforced. This will override the practice mode unless it is Inactive.

Match conditions:

  • URI - A string written in this field is concatenated as a suffix to all defined URLs of the Web Application or Web API asset. The concatenation result is considered the prefix for all requests that will match this rule. While the URI field does not accept a regular expression, it does support usage of '*' wildcard character. Example - If the Asset's defined URLs are "http://www.myapp.com" and "https://www.mysecureapp.com" and the URI in the rule is "/docs", it will be matched on all requests starting with either http://www.myapp.com/docs or https://www.mysecureapp.com/docs.

    Use "/" to match all requests to the asset's domains.

  • Additional Conditions - An optional logical expression in addition to the main URI regular expression. The logical expression can use AND/OR/NOT between matching key-value pairs to decide what traffic should be counted to determine if rate of requests has exceeded. There are several keys that can be used:

    • URI - A regular expression that is matched on the URI field. Since the main URI field already creates an initial prefix match of the URI path, the regular expression is usually used to match specific states if a wildcard was used, or strings in the full URI beyond the prefix.

    • Source Identifier - A regular expression matching the source identifier values according to Source Identity configuration of the asset. If source identifier is not detected in traffic according to configuration, the value will be matched vs the source IP address.

    • Source IP - A network IP address in X.X.X.X format or CIDR (e.g. 11.22.33.44/24).

  • Limit configuration:

    • Limit - the maximum number of requests in a specific time scope.

    • Time Unit - the time scope in which the limit is enforced.

If Limit is set to 7000 and Unit is set to "Minute" then an Active Rate Limit practice will prevent requests to the matched URI if they exceed 7000 requests from the same source identifier, in a single minute.

  • Trigger configuration: Configure the trigger (usually the log trigger) that will activate when a Rate Limit rule is fully matched by URI as well as requests rate.

    In Detect/Learn mode, the Trigger is the only action that will occur if the rate of matched URIs from the same source identifier has exceeded configured limits.

After clicking OK, you will see the full rule:

Match priority - The rate is enforced according to a single-matched rule. When the URI of the request matches multiple URIs in multiple rules, the longest match takes precedence and determines the rate limit count.

For example - if there are 2 rules - one limiting the URI "/docs" for 10000 requests from the same source identifier in one minute, and the second limiting "/docs/external" for 3000 requests from the same source identifier in one minute, then requests to /docs/external/latest will be blocked if they exceed 3000 requests from the same source identifier in one minute, as this rule creates a longer match.

In the community edition, only one rule is supported.

Step 4: Enforce Policy

Click Enforce on the top banner of the open-appsec portal.