Skip to content

RANGER-5690: Distinct-IP fan-out delay for UnixAuth (replace account hard lockout)#1102

Draft
ramackri wants to merge 2 commits into
masterfrom
RANGER-5690-account-lockout-master
Draft

RANGER-5690: Distinct-IP fan-out delay for UnixAuth (replace account hard lockout)#1102
ramackri wants to merge 2 commits into
masterfrom
RANGER-5690-account-lockout-master

Conversation

@ramackri

@ramackri ramackri commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Hard account lockout on UnixAuth could be abused to block a real user with bogus attempts, with no self-service unlock. This PR replaces that with opt-in account throttling: track distinct failing source IPs per username, apply a short exponential delay before the OS validator, and never hard-reject on account. Per-IP lockout is unchanged.

How it works (when account.lockout.enabled=true)

We track which IPs failed against a username, not total failure count. Delay starts once distinct failing IPs reach the threshold (default 3). Delay doubles for each additional distinct IP, capped at 5s. The validator always runs after the wait.

Distributed attack against alice (threshold=3, step=1s, max=5s):

Attempt Source IP Distinct failing IPs for alice Delay Validator
1 10.0.0.1 1 0 ms invoked
2 10.0.0.2 2 0 ms invoked
3 10.0.0.3 3 (threshold) 1 s invoked
4 10.0.0.4 4 2 s invoked
5 10.0.0.5 5 4 s invoked
6 10.0.0.6 6 5 s (cap) invoked

Same IP retrying alice does not add a new distinct IP — no extra account delay (IP throttling still applies).

Admin users (admin.users) are exempt from account tracking. Successful login clears the distinct-IP set for that account.

Defaults

  • account.lockout.enabled=false — upgrades unchanged; enable explicitly for fan-out throttling
  • distinct.ip.threshold=3, delay.step.ms=1000, max.delay.ms=5000

Test plan

  • unixauthservice unit tests (33 pass)
  • ranger-3.0.0-SNAPSHOT-usersync.tar.gz builds

…guessing

Track failed login attempts per username in addition to per-source-IP throttling.
Account lockout uses separate configurable threshold, window, and lockout duration.
Defaults match IP policy; account lockout can be disabled via config.
Replace hard account lockout with opt-in throttling that tracks distinct
failing source IPs per username, applies exponential backoff before the OS
validator, and exempts admin.users. IP hard lockout is unchanged; account
throttling defaults to disabled on upgrade.
@ramackri ramackri changed the title RANGER-5690: Add account-associated lockout for UnixAuth distributed guessing RANGER-5690: Distinct-IP fan-out delay for UnixAuth (replace account hard lockout) Jul 23, 2026
@ramackri
ramackri marked this pull request as draft July 23, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant