feat(security): restrict admin actions to IP ranges#46473
feat(security): restrict admin actions to IP ranges#46473AndyScherzinger merged 3 commits intomasterfrom
Conversation
71c789d to
5fff029
Compare
lib/private/AppFramework/Middleware/Security/Exceptions/AdminIpNotAllowedException.php
Show resolved
Hide resolved
5fff029 to
741dca0
Compare
nickvergessen
left a comment
There was a problem hiding this comment.
No in-if assignments please
90da5d8 to
8b24270
Compare
f534588 to
da6dd95
Compare
nickvergessen
left a comment
There was a problem hiding this comment.
Definitely needs documentation, so that other "admin alike endpoints" are aware and can integrate it and use IGroupManager::isAdmin() instead of checking for the admin group.
da6dd95 to
d1007db
Compare
3391801 to
791b066
Compare
17a6845 to
fb9866d
Compare
6682c99 to
6cdb1c7
Compare
lib/public/Security/Ip/IFactory.php
Outdated
| * Creates a range from string | ||
| * | ||
| * @since 30.0.0 | ||
| * @throws on invalid range |
Check failure
Code scanning / Psalm
UndefinedDocblockClass
lib/public/Security/Ip/IFactory.php
Outdated
| * Creates a address from string | ||
| * | ||
| * @since 30.0.0 | ||
| * @throws on invalid IP |
Check failure
Code scanning / Psalm
UndefinedDocblockClass
6cdb1c7 to
e511bab
Compare
lib/private/Server.php
Outdated
|
|
||
| $this->registerAlias(IRemoteAddress::class, RemoteAddress::class); | ||
|
|
||
| $this->registerAlias(\OCP\Security\Ip\Factory::class, \OC\Security\Ip\Factory::class); |
Check failure
Code scanning / Psalm
UndefinedClass
e511bab to
07264dd
Compare
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
…king for "in range" Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
07264dd to
f1d97a3
Compare
|
Cool feature 🎉🎉🎉🎉🎉 I wonder, would it make sense to document this under https://docs.nextcloud.com/server/latest/admin_manual/installation/harden_server.html? |
Yes, exactly there. I think @sorbaugh already discusses this with @Altahrim - we talked about this 30 minutes ago 😁 |
|
Added here: nextcloud/documentation#12059 |
Summary
Restrict admin actions to IP ranges
When administrator IP address is not in specified range, all admin actions are hidden/forbidden.
Checklist