Skip to content
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

Basic Auth and JWT #2809

Closed
a1fred opened this issue Apr 4, 2019 · 11 comments
Closed

Basic Auth and JWT #2809

a1fred opened this issue Apr 4, 2019 · 11 comments
Labels
area/authentication kind/enhancement Applied to Feature Requests

Comments

@a1fred
Copy link

a1fred commented Apr 4, 2019

Can't secure portainer behind nginx with basic-auth. Portainer's JWT auth and http basic uses same header name and overwrites each other.

May be rename JWT header name or add configuration for change JWT header name?

Related:

@ghost
Copy link

ghost commented Apr 4, 2019

Hi there,
What is your use case for this?

@ghost ghost self-assigned this Apr 4, 2019
@ghost ghost added the status/need-info label Apr 4, 2019
@a1fred
Copy link
Author

a1fred commented Apr 4, 2019

I want to use portainer's web ui behind nginx reverse proxy with http basic authentication.
Basic authentication uses 'Authorization' header. Portainer's authentication uses same header for JWT token sending.

This conflict makes not possible scheme reverse proxy with basic authentication.

@deviantony
Copy link
Member

deviantony commented Apr 4, 2019

@a1fred Portainer already provides an authentication mecanism. Why would you try to add another one on top of that?

@a1fred
Copy link
Author

a1fred commented Apr 4, 2019

@deviantony i dont want to show portainer login page to public, i dont fully trust one authentication mechanism. Access to portainer gives access to all services and access to entire server. Its very important and completely unacceptable.

I want more security to allow my paranoia sleep calmly :)

@deviantony deviantony added area/authentication kind/enhancement Applied to Feature Requests and removed status/need-info labels Apr 5, 2019
a1fred added a commit to a1fred/portainer that referenced this issue Apr 5, 2019
@a1fred
Copy link
Author

a1fred commented Apr 5, 2019

Just created #2815 .
But i'm not very advanced on golang and angular and no idea how to run and test it.
Can somebody check it?

@deviantony
Copy link
Member

Sorry, we've decided that we were not going to support this scenario for the reason that using the Authorization header is the standard way when using the JWT authentication scenario.

We already support advanced authentication scenarios (more secure) by allowing you to use an external OAuth provider where you can enable extra security layers (such as 2FA) and we would recommend this approach for a more secure setup.

@uroni
Copy link

uroni commented Jan 20, 2020

If you proxy it from a random location (say https://portainer.example.com/30aa9eeb-2f1c-49e8-91ec-2037f269a5fc/ ) that should be nearly as good as basic auth. The only danger is that someone accidentally copy & pastes the URL somewhere public, or that the web server lists the location somewhere.

Basic auth should still be supported, in my opinion, however.

@modem7
Copy link

modem7 commented Feb 17, 2020

Sorry, we've decided that we were not going to support this scenario for the reason that using the Authorization header is the standard way when using the JWT authentication scenario.

We already support advanced authentication scenarios (more secure) by allowing you to use an external OAuth provider where you can enable extra security layers (such as 2FA) and we would recommend this approach for a more secure setup.

It's unfortunate that it costs as much as it does. Great pricing for businesses, not so much for a small home network that isn't generating profit.

If there were a residential pricing tier, single user licence, single MFA user account etc, for a quarter of the price, then that would certainly be worthwhile!

@ncresswell
Copy link
Member

ncresswell commented Feb 17, 2020 via email

@toussa
Copy link

toussa commented Jun 3, 2020

Sorry, we've decided that we were not going to support this scenario for the reason that using the Authorization header is the standard way when using the JWT authentication scenario.

We already support advanced authentication scenarios (more secure) by allowing you to use an external OAuth provider where you can enable extra security layers (such as 2FA) and we would recommend this approach for a more secure setup.

Actually, it's not the same at all, and I wouldn't say OAuth is more secure. It's just not the same level. Using Basic Authentication (and TLS) with a reverse proxy will prevent the access to any pages, even the one that doesn't need portainer account to access.
You cannot even see and access to the door to try to open it.
For critical services like portainer, that's not used by too much people, I also prefer adding Basic Auth.

Anyway, I totally agree on respecting the standard. It should be the job of the reverse proxy

@freekk
Copy link

freekk commented Oct 31, 2022

Hello,

Sorry to say that, but I think you miss the point here.
You may have a great product, that "supports" oauth authentication, your implementation of the auth flow CAN have issues.

Specifically when targeting serious businesses, you must provide a way to allow them to use the security gateway of their choice and not increase the attack surface.
When a reverse proxy has been reviewed, accepted from a security viewpoint, and battle-tested, you cannot just say "create a specific backdoor and trust us for security".

You may chose to regard us a paranoid enthousiasts, but as someone who works in IT, not addressing this issue is a no-go.
I really hope you change your mind about this one, and I wish you the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/authentication kind/enhancement Applied to Feature Requests
Projects
None yet
Development

No branches or pull requests

7 participants