-
Notifications
You must be signed in to change notification settings - Fork 226
[WIP] feat: implement brute force protection for public shares #11864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
|
Will this go into Curie? |
|
@kobergj there are some unit tests failing, likely caused by the change in the middleware here, so I'm not sure if we should remove those tests of explore a different solution. |
| Public links will be protected by default, allowing up to 5 wrong password | ||
| attempts per hour. If such rate is exceeded, the link will be blocked for | ||
| all the users until the failure rate goes below the configured threshold | ||
| (5 failures per hour by default, as said). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have questions on the behavior:
- One mad user can block the whole PL for the time defined.
- If there is another user typing in the wrong pwd, the counter starts from the beginning.
- No user can see when the blocking time ends.
- No user can login even with a correct password if the treshold has been exeeded before.
- Consequently, if a user would be able to login with the correct pwd (which is a violation of the description above), login would be reenabled for all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Technically yes. However, that could also be considered as an attack, which is what we want to prevent.
Public links are intended for external anonymous access, and the security team decided that trying to block access by IP could be bypassed, so the access will be blocked for everyone, including regular logged-in users. - There is no counter. We're tracking the timestamp of each failed attempt (no longer useful data will be removed eventually) and ensuring that, given a duration, there are less than the maximum allowed failed attempts in it.
- Correct. I'm not entirely sure how useful showing that information will be related to the effort to implement it. If we need to show an accurate information, we'll need to propagate the information from very deep; alternatively, we could show the worst case ("retry after one hour", by default). It could also give information to potential attackers. Definitely something to check with the security team.
- Right. However, if a user could login with a correct password during the block, an attacker could keep trying passwords ignoring the block until he succeeds, which would defeat the purpose of the feature.
- Point 4 explains it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Expected bahaviour. This is the point of the whole story
- The counter should be global and not reset when another user enters a wrong password
- Expected behaviour. We do not want attackers to automate waiting time between brute force attacks.
- Expected behaviour. As stated above it would render the whole feature useless if we allow access to blocked resources.
- NO user should be able to access the link while it is blocked due to an attack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the insight 😄
Addon question:
- If one has entered a valid pwd for the PL and accesses the resource and another user triggers the limit and blocks access, will the first user be kicked out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends. I would expect ongoing Office session to not break. But I would expect the user cannot upload/download the file from this point. @jvillafanez is this the actual behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I would expect the user cannot upload/download the file from this point.
Really? First you successfully login, then you cant do anything without being notified?
As logged in user, I would expect at least a notification on the screen. Then it would be ok.
Would this also affect any running up/download? Means, they will get interrupted and the session closed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First you successfully login
No login involved - this is about public links.
As logged in user, I would expect at least a notification on the screen.
Ideally yes - but from a security POV not needed.
Would this also affect any running up/download? Means, they will get interrupted and the session closed?
I would expect not. Once the download has started it uses a different sort of access token that is not bound to the user. So download should succeed. Not sure about Upload. Needs to be tested.
|
|
@jvillafanez why is this unit test failing? Could we increase the threshold of failed tries to make this tests pass? |
|
https://github.com/owncloud/ocis/pull/11864/files#diff-6d13e529ff282391653d164b7fe8654c0580bf59dd90e7b81e26a2c84ad12a92L94-L122 is likely the cause. It was needed because there was a double authentication going on that was messing with the failure count (#11862)
The feature is mainly in reva, and this PR doesn't update it, so there shouldn't be any brute force protection going on. This PR is mostly configuration for the reva service. |
|
I think I'll need to look at a different solution for the double authentication. There is a 401 error when trying to open a docx file from the public link with onlyoffice. |



Description
Requires owncloud/reva#460
Configuration for the brute force protection from oCIS
Note that the authentication done in the middleware will be fully delegated to reva (related to #11862)
Related Issue
Motivation and Context
How Has This Been Tested?
Manually tested. After several failed attempts the access to the public share is blocked.
Screenshots (if appropriate):
Types of changes
Checklist:
Notes: