# Block user after 6 login attempts

**URL:** <https://forum.opensearch.org/t/block-user-after-6-login-attempts/1967>\
**Category:** Security\
**Created:** [December 5, 2019, 1:07pm UTC](https://forum.opensearch.org/t/block-user-after-6-login-attempts/1967 "2019-12-05T13:07:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xexer49142](https://avatars.discourse-cdn.com/v4/letter/x/df788c/32.png) [@xexer49142](https://forum.opensearch.org/u/xexer49142)\
**Post date:** [December 5, 2019, 1:07pm UTC](https://forum.opensearch.org/t/block-user-after-6-login-attempts/1967/1 "2019-12-05T13:07:21Z")

</div>

Is there a way to block a user during X hours after 6 failed login attempts?.

Also, it would be useful to index this event (User XXXX blocked).

---

<div class="post-metadata">

**Author:** ![Anthony](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/anthony/32/9939_2.png) [@Anthony](https://forum.opensearch.org/u/Anthony)\
**Post date:** [May 14, 2021, 4:09pm UTC](https://forum.opensearch.org/t/block-user-after-6-login-attempts/1967/2 "2021-05-14T16:09:25Z")

</div>

@xexer49142 There is a section in config.yml file:

```
auth_failure_listeners:
      ip_rate_limiting:
        type: ip
        allowed_tries: 3
        time_window_seconds: 3600
        block_expiry_seconds: 600
        max_blocked_clients: 100000
        max_tracked_clients: 100000
      internal_authentication_backend_limiting:
        type: username
        authentication_backend: internal        
        allowed_tries: 3
        time_window_seconds: 3600
        block_expiry_seconds: 600
        max_blocked_clients: 100000
        max_tracked_clients: 100000

```

You can block per username or per IP.  
Hope this helps
