cloudposse / bastion

🔒Secure Bastion implemented as Docker Container running Alpine Linux with Google Authenticator & DUO MFA support
https://cloudposse.com/accelerate
Apache License 2.0
640 stars 112 forks source link

SLACK_FATAL_ERRORS does not actually do anything in sshrc #66

Closed jonmchan closed 1 year ago

jonmchan commented 1 year ago

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

when enabling SLACK_FATAL_ERRORS, the user should be logged out when the slack notification fails. However, this does not happen when using sshrc SLACK_HOOK method.

The reason is that exit 1 in https://github.com/cloudposse/bastion/blob/master/rootfs/etc/ssh/sshrc does not do anything. The ssh command runs that and happily goes into the shell after the error exit code.

For this to be effective, replacing exit 1 with kill -TERM $PPID makes this actually die and the ssh connection to close when the SLACK_FATAL_ERRORS occur.