OpenSearch login rate limiting

Configure OpenSearch login rate limiting to slow password guessing by username, IP address or both. Plan allowed tries, time windows, block expiry and client tracking limits before production.

On this page

How OpenSearch login rate limiting slows password guessing

The Security plugin's login rate limiting counts failed logins per username, per client IP address, or both, and blocks further attempts for a set period once a limit is reached. Teams need it when a cluster accepts internal password logins from users, service accounts or scripts that can be reached from networks where guessing is possible, and when a security review asks how repeated failed logins are slowed. It is a configuration choice made in config.yml, so it is planned alongside the authentication backends, not added afterward. The OpenSearch project is released under the Apache License, Version 2.0, and the rate limiting feature is part of that open-source Security plugin, so no paid tier is involved in enabling it.

Rate limiting does not replace the rest of the login design. A username limit slows guessing against one account but can lock out a real user whose name an attacker has targeted, and an IP limit can throttle many users behind a shared NAT or proxy. Both controls also work only as well as the identity source behind them: if SAML, OpenID Connect or directory logins are used for people, the identity provider's own lockout and MFA policy carries most of the load, and the OpenSearch limit mainly protects internal accounts and API paths. Confirm which login paths reach the cluster, including the REST API and Dashboards, before deciding which limit applies to each.

Choosing values is the decision that needs the most care. The main settings are allowed_tries, time_window_seconds and block_expiry_seconds, along with limits on how many clients are tracked and blocked, which bound heap use. Test the chosen values against your own monitoring, load balancer addresses and automation retry behavior before production, and confirm the exact key names and defaults for your OpenSearch version in the API rate limiting documentation. Document the chosen values, who may unblock an account, and how blocks are reported to the security team, since reviewers will ask for that evidence.

Username, IP address or both: choosing the rate limit scope

This table compares username rate limiting, IP address rate limiting and both together, and maps each to the attack pattern it slows. Read it to choose the scope first, then decide how the allowed tries, time window, block expiry and client tracking limits should be set for your environment.

Option or settingWhat it protects againstTrade-offWhen it fits
Username rate limitingOne account under targeted password guessing, whatever source the attempts come fromA distributed attacker can spread guesses across many accounts, and a lockout can be used to deny a legitimate user access to their accountAccounts with high value or known usernames, such as administrator accounts
IP address rate limitingMany accounts tried from one source, such as a single host running a password sprayUsers behind a shared NAT or proxy may share one address and block each other; attackers with many addresses are less affectedInternal clusters where client addresses are stable and well understood
Both username and IP addressTargeted guessing against one account and broad spraying from one source at the same timeTwo sets of counters must be sized and monitored, and the stricter limit applies, so false positives can increaseInternet-facing Dashboards or REST endpoints where credential attacks are expected
allowed_triesThe number of failed attempts permitted before a block is appliedA low value reduces guessing room but raises the chance of blocking a user who mistypes, so confirm the value with your help desk processSet it from your password policy and the number of legitimate retries you accept
time_window_secondsThe period over which failed attempts are counted toward allowed_triesA short window lets slow, patient guessing avoid the count; a long window can accumulate failures from ordinary users over timeMatch it to the pace at which an attacker could realistically guess within your password policy
block_expiry_secondsHow long a blocked username or address stays blocked before it is allowed againA long expiry frustrates attackers but can lock out real users for longer; a short expiry gives attackers more cyclesChoose with your incident response team, who may need a longer block during an active attack
Tracked and blocked client limitsHeap exhaustion from an attacker who generates many unique usernames or addressesLow limits protect memory but can evict counters early, weakening the limit; high limits use more heapSize against the heap available to the nodes handling authentication and confirm the values in the Security plugin docs

Configuring rate limits in config.yml

This sequence turns login rate limiting from a plan into a verified control: the scope is fixed, the Security plugin settings are written and applied through the cluster's standard configuration process, and controlled failed logins confirm that blocks, logging and recovery after expiry behave as intended.

  1. Decide the rate limiting scope

    The security owner and the cluster administrator agree which login paths are covered (Dashboards, REST API clients, or both) and whether limits apply per username, per IP address or both. They also record which source addresses are trusted proxies or load balancers, because rate limiting by IP address is only meaningful if the client address reaches the cluster correctly. Confirm the proxy headers your ingress forwards before writing any setting. The step is done when the decision is written down with a named owner and a list of protected entry points.

  2. Set rate limit keys in config.yml

    The administrator edits the Security plugin's config.yml to enable username rate limiting, IP address rate limiting or both, then sets allowed_tries, time_window_seconds and block_expiry_seconds to the values chosen in the first step. The limits on tracked and blocked clients are set at the same time so that heap use stays bounded under a flood of distinct usernames or addresses. Check the current OpenSearch security configuration reference for the exact key names and nesting before editing. The step is done when the file validates against your review checklist and the values are recorded in version control.

  3. Apply the configuration through the standard process

    The administrator applies the updated config.yml with the same process the cluster uses for other security configuration changes, such as the securityadmin.sh workflow with an admin certificate, so the change is recorded and can be rolled back. Confirm that every node in the cluster reports the new configuration, since a node that missed the update would enforce different limits. The step is done when the change is applied on all nodes and the security configuration version matches the one in version control.

  4. Confirm the baseline with a test account

    Before triggering blocks, the tester confirms that a dedicated test account can log in normally and that the rate limit settings are active. Use a non-production user that has no privileges beyond a read-only test role, and record the source address used for testing so the audit trail is easy to follow. The step is done when a successful login is recorded and the test account is confirmed to be usable.

  5. Trigger controlled failed logins

    The tester submits wrong passwords for the test account from a single known address until the configured allowed_tries count is exceeded, then confirms the next attempt is refused even when the password is correct. Repeat the exercise with a different username from the same address if IP-based limits are enabled, so both limit types are exercised. Keep the number of attempts within the agreed test window. The step is done when the block is observed for each limit type that was enabled.

  6. Verify block logging and alerting

    The security team checks that the blocked attempts appear in the audit logs or security logs that the cluster is configured to produce, and that the log entries identify the account or address being limited. If the logs are forwarded to a central platform, confirm that the events arrive there and that any alert rule your team planned for repeated failures fires. The step is done when the block events are visible in the place the security team will actually review them.

  7. Confirm expiry and legitimate recovery

    After the configured block_expiry_seconds has passed, the tester logs in with the correct password from the same address and confirms the login succeeds. This shows that blocks lift as designed and that legitimate users are not locked out permanently. Record the observed time between the block and the successful login against the configured value. The step is done when recovery after expiry is confirmed and the test results, settings and log evidence are filed with the change record.

Why client tracking limits protect heap memory

The Security plugin keeps counters for failed login attempts per username and per IP address, and it uses the same mechanism to remember which clients are currently blocked. Each distinct username or address that fails a login occupies an entry in memory until its window closes or it expires. That is why the settings for tracked and blocked clients matter as much as allowed_tries and time_window_seconds: they set a ceiling on how much heap the rate limiter can consume. Confirm the exact setting names and default values for your version in the OpenSearch API rate limiting docs before you write them into config.yml, and confirm how the plugin behaves when a limit is reached.

A password spray from many addresses is the case the limits are designed for. An attacker who tries one or two passwords against thousands of usernames, or who rotates through many source IPs, creates a large number of distinct tracked entries in a short period. Without an upper bound, that growth competes with the heap used by searches and indexing, and an attack on the login path could degrade the cluster. With bounds in place, the cluster accepts a predictable number of entries, and the trade-off is that some tracking records may be dropped or not created once the cap is reached. Ask your vendor or test environment to show what happens at the cap, including whether new clients are still blocked, so the team knows what protection remains during a spray.

Size the limits from your own traffic profile rather than from a generic number. Count the normal population of users and service clients that authenticate from each network segment, add headroom for peak onboarding or batch jobs, and check how many of those clients legitimately fail a login, for example after a password rotation. In operations, track the heap usage of the nodes that handle authentication, the number of tracked and blocked clients over time, the rate of failed logins from the audit log, and any log messages from the Security plugin about limits being reached. A sustained rise in tracked clients is an early sign of a spray, and a plateau at the cap means the limits need review.

Security risks that rate limiting does not solve alone

Rate limiting in the Security plugin slows guessing but does not decide who gets in, who gets locked out, or how attacks are noticed. The cards below cover the places where throttling needs help from network design, the identity provider, the authentication backend and your alerting.

Lockout as a denial of service

A block on a username applies to everyone who types that name, including a real user who mistypes a password or an attacker who never needed the account. Because block_expiry_seconds is the main recovery path for locked users, a short expiry limits the damage while a long one makes targeted lockouts easy to cause. Check which service accounts and automation users share names with people or pipelines that must keep signing in, and decide who can clear a block before go-live.

Rate limiting docs

Shared NAT and proxy addresses

IP-based limits count every client behind a corporate NAT, VPN concentrator or reverse proxy as one address. A single bad actor, or one misconfigured script, can block an entire office or the load balancer that fronts Dashboards. Confirm which address OpenSearch actually sees, whether forwarded headers are trusted at the proxy, and whether IP limits should be paired with username limits rather than used alone.

Credential stuffing at low attempt counts

Credential stuffing tries a few leaked username and password pairs per account across many accounts and many addresses. Per-account and per-IP counters may never reach the configured threshold for any single target, so the attack passes quietly. Rate limiting reduces the volume of guesses but does not detect reuse of breached passwords. Pair it with strong password policy at the identity provider and with monitoring of failed logins across all users.

MFA and SSO at the identity provider

The Security plugin counts failed attempts against its own internal user database or the backend it checks, but it cannot require a second factor. When people sign in to Dashboards through SAML, OpenID Connect or LDAP, the identity provider usually holds the password policy, lockout and MFA. Decide which accounts keep a local OpenSearch password, such as break-glass admins, and whether they are restricted to a network path that MFA cannot cover.

Backend lockout and directory load

When credentials are checked against LDAP or Active Directory, each login attempt reaches the directory, so a guessing run can load the directory servers as well as OpenSearch. Account lockout policy in the directory and in OpenSearch may also disagree about when an account is locked. Confirm which layer is the source of truth for failed-attempt counts, how long a locked account stays locked in each system, and whether the directory's own lockout would hide an OpenSearch block from administrators.

Logging and alerting on blocks

A block is only useful if someone sees it. Blocked attempts and failed logins should flow into the audit logs and then into your alerting, with thresholds that separate one user mistyping a password from a spread of attempts across many accounts. Test that the events are written, that they reach the team on call, and that an alert names the user or address involved. Without this step, rate limiting slows an attacker while nobody notices the attack.

Questions teams ask before configuring login rate limiting

How much effort does configuring OpenSearch login rate limiting take?

The configuration itself is a small change to config.yml in the Security plugin, but the effort that matters sits around it: deciding the thresholds, testing them against real login paths, and coordinating the change with the teams that sign in. Effort rises with the number of clusters, the number of environments that must mirror production, and how many entry points authenticate users, such as Dashboards, REST clients and service integrations. No duration is given here. Ask any partner for a written scope that lists the clusters, environments, backends and test cases covered, since that list is what a quote follows from.

What does our internal team need to provide?

Plan for a few named people. A platform owner needs to approve the thresholds and the change window. A security reviewer should confirm the allowed tries, time window and block expiry match your policy. Someone who administers the identity backend must explain how failed logins propagate, for example whether LDAP or Active Directory accounts lock at the directory before OpenSearch sees them. You also need access to a non-production cluster that resembles production, and an admin certificate or account able to apply security configuration.

Can our own team configure login rate limiting without a partner?

Yes, if your team already administers the OpenSearch Security plugin and has a safe place to test. The settings are documented in the Security plugin's API rate limiting reference, so an experienced operator can make the change. A partner adds most value when the work must be evidenced for an assessment, when several identity backends must be tested together, or when the team lacks time to run failed-login tests and review logs. Decide based on who will own the setting after go-live and who will answer when a lockout ticket arrives.

How do we handle lockouts of legitimate users?

Set block_expiry_seconds so a blocked user or address recovers without manual action, and agree on a path for urgent cases. Typical causes include a service account with a stale password, a shared NAT address that many users share, and a monitoring tool that retries too quickly. Before go-live, list those sources and decide whether they need an IP allowance, a rotated credential or a corrected client. Ask your team to confirm how the helpdesk can see a block and whether an administrator can clear it, because the procedure must be written before the first lockout occurs.

Does login rate limiting replace SSO or multi-factor authentication?

No. Rate limiting slows password guessing against accounts that accept a password, but it does not verify who is signing in or add a second factor. Where users sign in through SAML, OpenID Connect or a directory, the identity provider should enforce its own lockout and multi-factor policy, and OpenSearch rate limiting remains a backstop for the internal and local accounts that still exist. Review which accounts can log in with a password at all, and document that boundary for your security reviewers.

How do we verify that rate limiting works?

Test in a non-production cluster with the same backends and the same Security plugin configuration as production. Run controlled failed-login attempts for one username and for one source address, confirm the block starts after the allowed tries within the time window, and confirm it ends after the block expiry. Check that the audit or application logs record the failures and blocks, and repeat the test for each identity backend in use. Keep the results as evidence. Ask any partner to show the test cases and results in the written deliverables, and confirm which evidence your own assessors expect.

What ongoing review does login rate limiting need?

Review the settings when identity backends, network paths or login clients change, and after each OpenSearch upgrade, since the Security plugin's configuration may be revisited between releases. Review tracking limits as the user base grows, because the limits on tracked and blocked clients bound heap use and should suit your cluster's memory. Look at blocked-login trends in logs each quarter or as your policy requires, and treat a sudden rise as a possible attack or a broken client. Assign the review to a named owner so it does not lapse after go-live.

How a failed login moves through the rate limiter

A login request reaches the Security plugin, which asks the authentication backend to check the credentials. A failure adds to the username and IP address counters inside the configured time window. When a counter reaches the allowed tries, the client is blocked until the block expiry passes. Check that both counters behave as you expect, and that a correct login below the threshold still succeeds.

Failed logins are counted per username and per IP address until a block applies.

Rolling out limits and reviewing them over time

Introduce login rate limits in a test cluster first, then tune them against real traffic before they reach production. Start with the settings in config.yml that you plan to keep, such as allowed_tries, time_window_seconds and block_expiry_seconds, and run them against a copy of your identity flow with known good and deliberately wrong passwords. Watch what the Security plugin records for blocked attempts and confirm that the same user and address are not locked out by normal retries. Before go-live, agree on who reviews the failed-login logs, how often, and what counts as a false lockout. Confirm with your own identity team whether service accounts, monitoring probes and load balancer health checks authenticate with passwords, since these can trip IP-based limits and look like attacks in the logs.

Evaluate false lockouts with evidence rather than anecdote. Ask the service desk to log every unlock request for the first weeks, and compare each one against the block entries and the time window that produced it. Look for patterns such as a shared NAT address at a branch office, a corporate proxy, a password rotation that left old credentials in a mobile mail client, or a directory outage that caused many authentication failures at once. A lockout caused by a legitimate cause is a signal to adjust the IP or username settings, not to remove the limit. Record each change with the reason, the observed traffic that justified it and the date, so the next reviewer can see why a number is what it is.

Keep the rate limit settings in the same version-controlled repository as the rest of your security configuration, and require a change review for every edit. Assign a named owner for the OpenSearch login limits and a second person who can approve changes. Review the settings after any change to the identity backend, such as moving from a basic internal user store to LDAP, Active Directory, SAML or OpenID Connect, and after changes to load balancers, proxies or NAT that alter the client address OpenSearch sees. Each of these changes can shift which address or username is counted, so a configuration that worked last quarter may block the wrong clients. Confirm the behavior after each change in the test cluster before promoting it.

How DeployOpen scopes and delivers OpenSearch security configuration

DeployOpen plans, implements, tests and documents OpenSearch login rate limiting inside your own infrastructure, as part of a fixed scope agreed in writing before work starts. The work covers the Security plugin settings in config.yml, how they fit with your identity backends, and the evidence your security team needs to review the result.

How we scope

  • Confirm which login paths, identity backends and client types must be covered by username, IP address or combined rate limiting.
  • Agree allowed_tries, time_window_seconds and block_expiry_seconds values with your security team before any configuration change.
  • Record heap limits on tracked and blocked clients and the expected number of client IP addresses in the written scope.

How we build

  • Apply the config.yml changes in a non-production cluster that matches your production node roles and security settings.
  • Test failed-login behavior for normal users, service accounts and attackers, including block expiry and recovery after a lockout.
  • Check that rate limiting does not block legitimate pipelines, Dashboards sign-ins or load balancer health checks.

How we hand over

  • Deliver the final config.yml, the change record and the test results with the values and the reasons behind each one.
  • Document how to roll back the settings and how to clear or review blocked clients during an incident.
  • Walk your operations and security staff through the monitoring points and the runbook for lockout reports.

How we support

  • Retest rate limiting after OpenSearch version upgrades or changes to the identity backend, as covered by the written scope.
  • Ongoing support, upgrades and continuous testing are available as a retainer, with terms agreed in writing.
  • Confirm with your security team how login rate limiting fits with your wider OpenSearch security configuration and audit logging.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.