Skip to content

Block brute-force login attempts  #1580

Closed

Description

@LukasReschke

ownCloud should block and log brute force attempts.

We have multiple possibilities to mitigate this:

  1. Block IP address for an increasing timespan after every failed login attempt
    • e.g. three failed logins: blocked for 10 mins, ten failed attempts: blocked for 2h etc...
      • give admins the possibility to unblock + whitelist IP adresses
  2. Block user account for an increasing timespan after every failed login attempt
    • safest method but very bad from an UX point of view
  3. Force users to solve a captcha after some failed login attempts

I'd prefer the first attempt. \cc @jancborchardt @karlitschek

Activity

  1. LukasReschke commented on Feb 10, 2013

    @LukasReschke
    ContributorAuthor

    @danimo @dragotin How could we handle this with mirall and other WebDAV clients?

  2. karlitschek commented on Feb 10, 2013

    @karlitschek
    Contributor

    Totally agreed. We need that and option 1 is probably the best.

    We have to make sure that the clients stops to try to connect after one failed attempt so that users are not blocked because of a wrong typed password.
    @dragotin What do you think?

    Frank

  3. karlitschek commented on Feb 10, 2013

    @karlitschek
    Contributor

    LOL. Same thought :-)

  4. j-ed commented on Feb 10, 2013

    @j-ed
    Contributor

    It's also possible to delegate this kind of work to external software, like fail2ban (http://www.fail2ban.org/) . As soon as the problem with change #1556 has been sorted out and it has been merged successfully I plan to add additional log entries for failed authentication attemps etc.

  5. LukasReschke commented on Feb 10, 2013

    @LukasReschke
    ContributorAuthor

    It's also possible to delegate this kind of work to external software, like fail2ban

    Since fail2ban isn't cross-platform compatible and also usually not available on shared hosting environments we can't just rely on that.

    However, it might be a good idea to make this in config.php configurable, so that people which don't want to use our internal solution can easily use fail2ban or other software.

  6. karlitschek commented on Feb 10, 2013

    @karlitschek
    Contributor

    fail2 ban is not always available and the logic that we need here is actually just a few lines of PHP I would suggest to just implement this internally instead of created not needed complexity here. I can look into that next week.

  7. jancborchardt commented on Feb 10, 2013

    @jancborchardt
    Contributor

    Yup. I think we agree that there needs to be a certain timeout after a certain number of failed log ins. Just want to be clear that we should absolutely not use a captcha anywhere, it’s a nightmare for people (I’d love to show you usability test videos, it’s actually hilarious and very sad at the same time).

    Now the question is: how long is the timeout, and how big is the number after which we start to introduce the timeout.

    After 2 failed logins there should probably be a timeout of 5 seconds. That’s already enough to slow down brute force attacks, but still wouldn’t inhibit the experience much, because instead of showing »yo yo you need to wait for 5 seconds now« you can just let the Log in process take a bit longer in the background.

    Then after, say, 7 failed attempts, block for 10 minutes and explicitly say that in the dialog. Then whatever … 15 failed attempts and blocked for an hour.

    Is that ok for limits?

  8. j-ed commented on Feb 10, 2013

    @j-ed
    Contributor

    Since fail2ban isn't cross-platform compatible and also usually not
    available on shared hosting environments we can't just rely on that.

    However, it might be a good idea to make this in config.php
    configurable, so that people which don't want to use our internal
    solution can easily use fail2ban or other software.

    Ok, I agree. Due to the fact that my idea is to use the already existing owncloud.log file for this log message, instead of creating a new file, there will be no need for further configuration parameters.

  9. Tie-fighter commented on Feb 28, 2013

    @Tie-fighter

    I would like you to consider, that with botnets and mix networks an attacker might have a huge amount of IPs at their disposal. Also please consider IPv6.

    It might be sensible to also block on username base if multiple ips failed to log in with that username.
    (I am not sure the increasing timespan is a good idea though, because it amplifies DoS)

  10. jancborchardt commented on Aug 6, 2013

    @jancborchardt
    Contributor

    Closing this in favor of the pull request #1603

  11. MorrisJobke commented on Aug 26, 2013

    @MorrisJobke
    Contributor

    @jancborchardt The pull request is far from being merged. Please close only issues, that are solved in master. (github does this automatically of in the commit message or pull request message is something like "fixes #NUMBER")

  12. enoch85 commented on Jul 1, 2014

    @enoch85

    Stumbled across this looking trough issues with the OC7 milestone. Is this planned for OC7, or is there not enough time?

    Would be very nice indeed.

  13. 106 remaining items

  14. JKawohl commented on Mar 27, 2017

    @JKawohl
    Contributor

    closing in favor of #27507

  15. karakayasemi commented on Dec 14, 2017

    @karakayasemi
    Contributor

    We have already security app for this purpose, if you have any enhancement request, we can talk in app's issue page imho.

  16. PVince81 commented on Dec 15, 2017

    @PVince81
    Contributor

    @karakayasemi I was told that the security app blocks by ip regardless of account, so if someone within a company network tries to connect, it would block the ip of the whole company. Is that true ?

    If that's correct, we can raise a ticket for the security app to block by ip+account name combination instead.

  17. karakayasemi commented on Dec 15, 2017

    @karakayasemi
    Contributor

    Yes, it is correct. In my pov ip+account combination is sound good. There is nothing to do in core for this purpose. imho we can close this issue and move to the security app to discuss about blocking policy.

  18. phil-davis commented on Dec 15, 2017

    @phil-davis
    Contributor

    Just a note about blocking by IP. These days a lot of households/SMBs can be hidden (NATed) behind a single public IP. More and more, ISPs route/NAT quite large sets of clients in their internal address space out over just a few public IPs. So blocking just by public IP address means that 1 offender effectively blocks access to quite a large set of households/SMBs. Depending on where genuine users and attackers are located it can result in seemingly "random" denial of service.

  19. karakayasemi commented on Jan 10, 2018

    @karakayasemi
    Contributor

    owncloud-archive/security#29 fixes the discussed problem. I guess we can close this if everyone agrees?

  20. lock commented on Jul 31, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  21. locked as resolved and limited conversation to collaborators on Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions