-
-
Notifications
You must be signed in to change notification settings - Fork 758
Add support to the client (CLI, http client) for sending additional basic auth credentials (aka MFA) #5152
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
Conversation
endpoints (api, auth, stream) using additional basic auth credentials in addition to the standard auth token / api key auth. This should come handy in situation where SSO is not used, but MFA is desired or similar
…i_basic_auth_support
endpoint since this one also utilizes basic auth based authentication mechanism. This approach is not ideal, but it's a comprompose - in case additional proxy based basic auth is enabled, user will still need to provide those additional basic auth credentials header for rest of the API operations (just not the /auth/tokens one).
74f940d
to
2f39b06
Compare
I'm not hugely happy with this. I think putting our efforts into an SSO backend that handles MFA itself would be better. Also, I'm afraid that this change would give users more undeserved confidence in running StackStorm exposed to the internet, which I don't think has been our security model/mindset so far. I'm already aware of one such instance, and I hope it's the only one. |
I'm pretty sure Github and lot of other services support But if that's not possible in some situations, user can also handle that in nginx config level (similar as tokens auth endpoint) so that can be documented.
Security is all about layers and I think it's good to give users a choice of adding additional layer on top StackStorm auth (+optionally SSO with MFA). SSO + MFA is definitely a good choice, but for some more security conscious users, it's better to have another layer somewhere outside of the app layer. There were definitely cases in the past where it was possible to bypass login + mfa due to the bug in the app code. |
Oh, right, yes they do, nevermind. |
e67d40e
to
566f1ba
Compare
@Kami Would you mind rebasing the branch against master so we can merge it for the 3.7 release? |
@nmaludy I've added changelog entry and synced it up with latest master. Will go ahead and merge it once CI passes - thanks. |
This pull request adds support for new
credentials.basic_auth = username:password
StackStorm CLI config option and-basic-auth
CLI argument.This argument allows client to use additional set of basic auth credentials when talking to the StackStorm API endpoints (api, auth, stream) - that is, in addition to the token / api key native StackStorm auth.
Background, Context
I'm running a StackStorm instance which I want to put behind additional auth wall (think second factor auth). I could probably achieve that using SSO and handling multi factor auth on the SSO side, but I'm not using SSO nor want to use it (and even with SSO used, if there is a bug in StackStorm auth code for SSO, dual factor auth on SSO side would not help in this case while having additional auth in another layer like nginx would).
The easiest way to add second factor to any kind of application which runs behind some kind of http proxy (nginx, Apache, etc.) is to simply utilize existing basic auth primitives of the proxy - this PR does exactly that.
Notes, Limitations
Current CLI and http client code is very messy and hard to work it. We don't have good abstractions for it (a lot of kwargs hacks all over the place) so it's a PITA to update it and work with it (something which has been a known issue for a long time already).
If this second factor auth is enabled and user wants to use webhook integrations, they will also need to send basic auth credentials with webhooks (which shouldn't be an issue since most 3rd party service support that and if they don't, they could also add exceptions in http proxy layer to not require it for webhooks API endpoint or similar).
Currently
/v1/auth/tokens
API endpoint also utilizes basic auth for authentication which means you should disable proxy based basic auth wall for/v1/auth/tokens
API endpoint. This is of course not ideal since it means actuallyauth
endpoint won't be behind MFA wall (aka user may be able to auth and obtain a valid st2 auth token without additional basic auth auth, but other operations and endpoints won't work if valid basic auth header is not provided), but all other endpoints will be.In nginx proxy, this would look something like this:
TODO