-
Notifications
You must be signed in to change notification settings - Fork 24
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
it is safer if the jwt.secret is not set by default #8
Conversation
This change probably warrents attention from the user, as it may invalidate the sessions of logged in users when this change is uptaken. However I believe it is an acceptable interference. As things are now, if a deployment of vouch does not set the jwt.secret then the cookie, copied to another domain would be accepted. With this change, the default behaviour causes vouch to generate a secret.
If you want to see the result of this change, take a look at the vouch logs after the change:
Reference https://github.com/vouch/vouch-proxy/blob/master/pkg/cfg/jwt.go#L19 |
wouldn't it be better to just set it to a random string then? vouch was my first helm chart, so i'm certain there's lots of things that could be done better. |
Hey @halkeye. Thanks for the quick response. That sounds like a good idea. I have two follow up questions. Is it possible in helm to generate a random string once only? Also, given that vouch itself is generating a password at startup when it is not explicitly set, how is generating one in helm a better? The helm chart is great. Thank you for writing it. |
Also there's no reason you can't specify one, just if you don't specify one it would be random. Personally I think required would be better to error if its not set. How about at the top of the configmap do:
and change the default value to '' |
@halkeye thanks for your feedback and apologies for the delay. I have made your suggested changes to the pull request. |
Can yuou update the version in chart.yaml? then i'm going to just yolo and merge it, it looks good |
rawr, i'll fix the build don't worry |
You'll be happy to know newer vouch doesn't even start :) vouch-7b76bb96db-rbws9 vouch {"level":"error","ts":1615659973.9340656,"msg":"Your secret is too short! (37 characters long). Please consider deleting vouch.jwt.secret to automatically generate a secret of 44 characters"} |
This change probably warrents attention from the user, as it may
invalidate the sessions of logged in users when this change is
uptaken.
However I believe it is an acceptable interference. As things are
now, if a deployment of vouch does not set the jwt.secret then the
cookie, copied to another domain would be accepted.
With this change, the default behaviour causes vouch to generate a
secret.