21 Commits

Author SHA1 Message Date
mik2k2
621ae1b0d3
Add /allowlist command (#399)
* move loading whitelist+ops from file to auth and save the loaded files fro reloading

* add /whitelist command with lots of open questions

* add test for /whitelist

* gofmt

* use the same auth (the tests don't seem to care, but htis is more right)

* mutex whitelistMode and remove some deferred TODOs

* s/whitelist/allowlist/ (user-facing); move helper functions outside the handler function

* check for ops in Auth.CheckPublicKey and move /allowlist handling to helper functions

* possibly fix the test timeout in HostNameCollision

* Revert "possibly fix the test timeout in HostNameCollision" (didn't work)

This reverts commit 664dbb0976f8f10ea7a673950a879591c2e7c320.

* managed to reproduce the timeout after updating, hopefully it's the same one

* remove some unimportant TODOs; add a message when reverify kicks people; add a reverify test

* add client connection with key; add test for /allowlist import AGE

* hopefully make test less racy

* s/whitelist/allowlist/

* fix crash on specifying exactly one more -v flag than the max level

* use a key loader function to move file reading out of auth

* add loader to allowlist test

* minor message changes

* add --whitelist with a warning; update tests for messages

* apparently, we have another prefix

* check names directly on the User objects in TestHostNameCollision

* not allowlisted -> not allowed

* small message change

* update test
2022-01-06 09:09:51 -05:00
Andrey Petrov
db14517499 cmd/ssh-chat: Accept multiple --identity keys
Fixes #401
2021-10-13 10:27:04 -04:00
mik2k2
7413539965
main, sshd: Refactor authentication, add IP throttling, improve passphrase auth
* Move password authentication handling into sshd/auth (fixes #394).

Password authentication is now completely handeled in Auth. The normal
keyboard-interactive handler checks if passwords are supported and asks
for them, removing the need to override the callbacks.

Brute force throttling is removed; I'd like to base it on IP address
banning, which requires changes to the checks.

I'm not sure, but I think timing attacks against the password are fixed:
- The hashing of the real password happens only at startup.
- The hashing of a provided password is something an attacker can do
themselves; It doesn't leak anything about the real password.
- The hash comparison is constant-time.

* refactor checks, IP-ban incorrect passphrases, renames

- s/assword/assphrase/, typo fixes
- bans are checked separately from public keys
- an incorrect passphrase results in a one-minute IP ban
- whitelists no longer override bans (i.e. you can get banned if you're 
whitelisted)

* (hopefully) final changes
2021-05-31 10:08:30 -04:00
Andrey Petrov
3f81d84cf1 cmd/ssh-chat: Use x/term instead of howeyc/gopass, update prompt
Fixes #380
2021-03-26 12:26:18 -04:00
Andrey Petrov
53ae43fb1b /motd: Add reload functionality when msg is @ 2020-08-03 13:26:12 -04:00
Andrey Petrov
daad9ba07b main: Use x/crypto/ssh helpers for parsing passworded keys 2020-04-20 15:34:42 -04:00
Andrey Petrov
b9aa7a6a0c main: Sort flags, unhide --unsafe-passphrase for now 2020-04-16 12:56:15 -04:00
Andrey Petrov
99d303e196 main: Add extraHelp 2020-04-16 12:44:20 -04:00
Andrey Petrov
6e9705faf5 main: Clarify passphrase shenanigans 2020-04-16 12:32:12 -04:00
Andrey Petrov
b1bce027ad main: Force passphrase auth even with pubkey auth 2020-04-16 11:30:13 -04:00
Andrey Petrov
77143ad1e6 main: Add --unsafe-passphrase 2020-04-15 14:19:28 -04:00
Andrey Petrov
0b06b56c0e main: --admin and --whitelist: Skip non-key lines
Closes #298
2019-03-15 18:30:21 -04:00
Andrey Petrov
3813360d91 cmd/ssh-chat: Set ServerVersion to include ssh-chat 2019-02-11 15:21:56 -05:00
Ulisse mini
81d7e16862 cmd, main: Return instead of os.Exit(0), use ioutil.Discard for default logger
* logger: change nil bytes.Buffer into ioutil.Discard

* cmd.go: Clearify imports

* cmd.go: Use return instead of os.Exit(0)
2019-01-25 13:42:27 -05:00
Nick Scheibenpflug
55c1def24d Windows support (fixed #217)
* Swap out gopass dependency

Remove github.com/mewbak/gopass in favor of github.com/howeyc/gopass

* Add Windows to Makefile and build_release

Added Windows/386 and Windows/amd64 to the Makefile.  Some minor changes
needed to be made to build_release to give the windows binary the ".exe"
extension.

* Makefile: remove windows/amd64
2016-09-15 13:52:55 -04:00
Greg Wedow
87d38405ae motd: Don't trim surrounding whitespace from the --motd file input. 2016-08-21 12:17:30 -04:00
Andrey Petrov
50d2be3a88 Fixed message buffer timeout 2016-07-24 16:17:02 -04:00
Andrey Petrov
39ac1f44ed Build/release script and fix version annotation. 2016-07-10 17:57:39 -04:00
Chris Gahan
f643653344 Updated the URL for the 'gopass' dependency 2016-02-13 06:19:11 -05:00
Andrey Petrov
3d307ac686 More forgiving connection limiter. 2015-01-28 23:12:58 -06:00
Andrey Petrov
8188deef30 Root sshchat package, main moved into cmd/ssh-chat/. 2015-01-21 11:47:59 -08:00