1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-05 00:27:25 +00:00
Commit Graph

2121 Commits

Author SHA1 Message Date
downtownallday
0f20b97709 looks like miab 'auto' setting won't work on travis 2020-11-05 16:48:36 -05:00
downtownallday
87142fb194 change comment 2020-11-05 16:33:44 -05:00
downtownallday
68ac593d7f load vars ahead of functions 2020-11-05 16:32:23 -05:00
downtownallday
c8ab05ebf1 skip network checks 2020-11-05 16:31:50 -05:00
downtownallday
e43c01e6fe Enable caching of Nextcloud downloads as well as downloading Nextcloud from github instead of Nextcloud servers 2020-11-05 16:19:42 -05:00
downtownallday
5a023f7868 Ensure system php is used 2020-11-04 14:26:20 -05:00
downtownallday
4fdbad5ef8 Be ciab-aware and use php version used by nextcloud 2020-11-04 14:13:59 -05:00
downtownallday
aeb27f74e3 Break out MiaB-LDAP code from _init.sh so _init.sh can be shared with cloud-in-a-box 2020-11-02 12:59:59 -05:00
downtownallday
34d968a2cd Prep for ubuntu 20.
This file is shared with cloud-in-a-box, which will support ubuntu 20 before MiaB-LDAP.
2020-11-02 12:57:57 -05:00
downtownallday
b634188ac0 Merge branch 'master' of https://github.com/mail-in-a-box/mailinabox
# Conflicts:
#	management/daemon.py
#	management/mfa.py
2020-10-31 11:43:35 -04:00
downtownallday
ad3174f08e Merge branch 'totp' 2020-10-31 11:39:35 -04:00
downtownallday
484ffd64ec do upgrade tests against maib master 2020-10-31 11:32:28 -04:00
downtownallday
d1110c4c02 merge from upstream 2020-10-31 11:31:44 -04:00
Joshua Tauberer
0bd3977cde CHANGELOG updates 2020-10-31 10:36:40 -04:00
Joshua Tauberer
6a979f4f52
Add TOTP two-factor authentication to admin panel login (#1814)
* add user interface for managing 2fa

* update user schema with 2fa columns

* implement two factor check during login

* Use pyotp for validating TOTP codes

* also implements resynchronisation support via `pyotp`'s `valid_window option

* Update API route naming, update setup page

* Rename /two-factor-auth/ => /2fa/
* Nest totp routes under /2fa/totp/
* Update ids and methods in panel to allow for different setup types

* Autofocus otp input when logging in, update layout

* Extract TOTPStrategy class to totp.py

* this decouples `TOTP` validation and storage logic from `auth` and moves it to `totp`
* reduce `pyotp.validate#valid_window` from `2` to `1`

* Update OpenApi docs, rename /2fa/ => /mfa/

* Decouple totp from users table by moving to totp_credentials table

* this allows implementation of other mfa schemes in the future (webauthn)
* also makes key management easier and enforces one totp credentials per user on db-level

* Add sqlite migration

* Rename internal validate_two_factor_secret => validate_two_factor_secret

* conn.close() if mru_token update can't .commit()

* Address review feedback, thanks @hija

* Use hmac.compare_digest() to compare mru_token

* Safeguard against empty mru_token column

* hmac.compare_digest() expects arguments of type string, make sure we don't pass None
 * Currently, this cannot happen but we might not want to store `mru_token` during setup

* Do not log failed login attempts for MissingToken errors

* Due to the way that the /login UI works, this persists at least one failed login each time a user logs into the admin panel. This in turn triggers fail2ban at some point.

* Add TOTP secret to user_key hash

thanks @downtownallday
* this invalidates all user_keys after TOTP status is changed for user
* after changing TOTP state, a login is required
* due to the forced login, we can't and don't need to store the code used for setup in `mru_code`

* Typo

* Reorganize the MFA backend methods

* Reorganize MFA front-end and add label column

* Fix handling of bad input when enabling mfa

* Update openAPI docs

* Remove unique key constraint on foreign key user_id in mfa table

* Don't expose mru_token and secret for enabled mfas over HTTP

* Only update mru_token for matched mfa row

* Exclude mru_token in user key hash

* Rename tools/mail.py to management/cli.py

* Add MFA list/disable to the management CLI so admins can restore access if MFA device is lost

Co-authored-by: Joshua Tauberer <jt@occams.info>
2020-10-31 10:27:38 -04:00
Joshua Tauberer
545e7a52e4 Add MFA list/disable to the management CLI so admins can restore access if MFA device is lost 2020-10-31 10:23:43 -04:00
David Duque
48c233ebe5
Update Roundcube to version 1.4.9 (#1830) 2020-10-31 10:01:14 -04:00
Michael Kroes
9a588de754
Upgrade Nextcloud to version 20.0.1 (#1848) 2020-10-31 09:58:26 -04:00
downtownallday
a7370beae0 Merge remote-tracking branch 'fspoettel/admin-panel-2fa' into totp
# Conflicts:
#	management/daemon.py
#	management/mfa.py
2020-10-29 16:56:36 -04:00
Joshua Tauberer
601c23d91b Add MFA list/disable to the management CLI so admins can restore access if MFA device is lost 2020-10-29 15:42:00 -04:00
Joshua Tauberer
ac9ecc3bd3 Rename tools/mail.py to management/cli.py 2020-10-29 15:41:54 -04:00
downtownallday
521b72653c Fix #4 2020-10-26 15:46:19 -04:00
downtownallday
9057c12c38 Merge branch 'master' of https://github.com/mail-in-a-box/mailinabox 2020-10-16 21:07:36 -04:00
David Duque
8b166f3041
Display certificate expiry dates in ISO format (#1841) 2020-10-16 16:22:36 -04:00
Joshua Tauberer
5509420637 s/Days/Retention Days/ on the backup settings page 2020-10-15 14:11:43 -04:00
downtownallday
6589a31883 Merge branch 'master' of https://github.com/mail-in-a-box/mailinabox 2020-10-13 20:22:18 -04:00
Jeff Volkenant
840f84da1a Custom spamassassin rules for bad SPF/DMARC headers 2020-10-07 11:29:19 -07:00
Jeff Volkenant
3a59fe834f OpenDKIM/OpenDMARC header checks 2020-10-07 11:05:52 -07:00
Felix Spöttel
7d6c7b6610
Increase mta-sts max_age to one week (#1829)
This aligns the policy with the example policy found in the  spec
see https://tools.ietf.org/html/rfc8461#section-3.2
2020-10-02 21:27:21 -04:00
downtownallday
a78e6eb3fa Speed up vm creation 2020-09-30 13:33:40 -04:00
downtownallday
f6b04b314f Add totpMruTokenTime to upgrade 2020-09-30 11:50:49 -04:00
downtownallday
100acb119b Add a totpMruTokenTime value to record the time when the mru token was used
Use the totpMruTokenTime as the id to uniquely identify a totp entry
2020-09-30 11:00:58 -04:00
downtownallday
a5ebd07549 Merge remote-tracking branch 'fspoettel/admin-panel-2fa' into totp
# Conflicts:
#	management/auth.py
#	management/mfa.py
2020-09-30 09:05:03 -04:00
Felix Spöttel
1f0e493b8c Exclude mru_token in user key hash 2020-09-30 12:34:26 +02:00
downtownallday
5deb88ab60 Merge remote-tracking branch 'fspoettel/admin-panel-2fa' into totp
# Conflicts:
#	management/daemon.py
#	management/mfa.py
#	setup/mail-users.sh
2020-09-29 22:20:15 -04:00
Felix Spöttel
ada2167d08 Only update mru_token for matched mfa row 2020-09-29 20:05:58 +02:00
Felix Spöttel
be5032ffbe Don't expose mru_token and secret for enabled mfas over HTTP 2020-09-29 19:46:02 +02:00
Felix Spöttel
00b3a3b0a9 Remove unique key constraint on foreign key user_id in mfa table 2020-09-29 19:39:40 +02:00
downtownallday
60771b7615 Merge branch 'master' of https://github.com/mail-in-a-box/mailinabox 2020-09-29 09:12:25 -04:00
downtownallday
e2dea39e5b Advance the x-ordered counter 2020-09-29 08:55:32 -04:00
downtownallday
75fb6d2a5d Rename a function 2020-09-29 08:55:04 -04:00
downtownallday
18d9cd99ea Restart management daemon in case it was already started 2020-09-29 08:54:16 -04:00
downtownallday
2bdcbc9b6c Run upgrade tests before default ones 2020-09-29 08:52:33 -04:00
downtownallday
37777ae904 Add a vagrant vanilla install with port forwarding 2020-09-29 08:33:57 -04:00
downtownallday
042e8b4a56 Merge remote-tracking branch 'fspoettel/admin-panel-2fa' into totp 2020-09-28 23:25:29 -04:00
downtownallday
00fc94d3c1 Merge remote-tracking branch 'fspoettel/admin-panel-2fa' into totp
# Conflicts:
#	management/auth.py
#	management/daemon.py
#	management/mailconfig.py
#	setup/mail-users.sh
2020-09-28 23:25:16 -04:00
Felix Spöttel
6d82c0035a Update openAPI docs 2020-09-28 21:27:24 +02:00
Felix Spöttel
4dced10a3f Fix handling of bad input when enabling mfa 2020-09-28 21:06:59 +02:00
Joshua Tauberer
b80f225691 Reorganize MFA front-end and add label column 2020-09-27 08:31:23 -04:00
0pis
7f0f28f8e3
Use tabs instead of spaces in nginx conf (#1827)
* conf/nginx-primaryonly.conf: Use tabs instead of spaces
* management/web_update.py: Includes the tabs so they display with the correct indentation when added to the local.conf

Co-authored-by: 0pis <0pis>
2020-09-27 07:13:33 -04:00