-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Stop using the default / completely random SECRET_KEY value #721
Comments
Hi, thanks for reporting this @TwizzyDizzy! Can you please try generating a random string once and setting it in your config under I think that our default |
That sounds entirely possible! Indeed I have two WSGI processes running. Also read up on what that static key is actually about (CSRF prevention) and after reading it, your answer makes sense even more. Thanks for the hint, will give it a shot and report back tomorrow. Cheers |
I have set the Indeed, I'd say that the following default is... at least misleading and should be commented upon accordingly:
Want a PR for that? Cheers |
Glad that it helped! A PR would be nice, but I am not sure how to deal with this in a best way. I am afraid that a comment might go unnoticed. Perhaps assuming that the Puppetboard is usually not set up in public we should hardcode a default value? 🤔 |
Yep, also thought about this and you're probably right. But then again, setting the same You could automatically generate it, but then you would run into the problem that you would need to generate a (locally) stable key across (local) instances [1] which kinda works against the randomness requirement. So the options are:
I guess the minimal impact really is to document it and keep the [1] imagine a scenario where you want to have a redundant Puppetboard setup with different load balancer backends on different hosts. Then all instances on ONE instance would have a stable Cheers |
Yes, I’ve had a similar thought process. :) But I realized that the current default is also bad even with a single process of the app. It generates a problem like yours when the app restarts. And restarts may be happening often with harakiri in uWSGI or if the app is running in k8s. Perhaps we should remove the default value and require everyone to set their own secret? The only downside is that technically it would be a backward-incompatible change, so we should uptick the app’s major version and it feels wrong with such a minor change.. |
Maybe better docs and an appropriate warning in the logs if the default is used? We could use a semi-random default, f.e. with a „default-” prefix which would trigger the warning. |
Indeed, didn't think of that.
Yeah, thought about that, too, though it seemed a bit too unwelcoming to new users. But in the end it's the most sane solution, all things considered.
It is breaking. And if the rule is to major-bump on backwards-incompatible changes, that is how it needs to be, despite of any feeling (even though I share it). Sometimes a big initial error (in hindsight, I mean - putting the
That seems like a half-baked solution in order to not to make a proper decision. Docs, yes, but adding additional code to work around a breaking change seems undecisive. After all, reading the changelogs of software you use should not be optional :) Cheers |
Closing. Has been concluded with the release of Cheers |
Starting with Puppetboard 5.0.0 providing own $secret_key is required. See voxpupuli/puppetboard#721 for more info. If you run Puppetboard on a single node with static FQDN then you can set it the following code to generate a random but not changing value: ${fqdn_rand_string(32)}
Starting with Puppetboard 5.0.0 providing own $secret_key is required. See voxpupuli/puppetboard#721 for more info. If you run Puppetboard on a single node with static FQDN then you can set it the following code to generate a random but not changing value: ${fqdn_rand_string(32)}
(Original issue title: Query sometimes returns results, sometimes not)
Describe the bug
Query page sometimes shows a result, sometimes does not, even when sending the same query several times.
Javascript console doesn't show obvious errors... it is known to occur in several OS/Browser scenarios (Windows, OS X, Chromium, Firefox).
What I did notice though: in cases that do not return a result, the PuppetDB access log shows one query, while in cases that show a result, the PuppetDB access log shows two queries:
Not showing results
Showing results
Should be easily reproducable by simply sending the query
environments{}
multiple times in a row... if nobody can reproduce this, it must be an error on our side, then I'd need to dig deeper on my side... so any feedback is appreciated.Puppetboard version
4.1.1
Environment and installation method
settings.py
The text was updated successfully, but these errors were encountered: