-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
triggerUri exposes plain text Blue Iris Username and Password #371
Comments
That's a pretty solid idea. The system already uses Docker secrets to load settings.json and triggers.json. Conceptually what you describe makes a ton of sense: have the username/password in a secrets file somewhere then mustache template it. By all means if you want to take a crack at coding this up feel free. Before opening a PR I suggest drafting up a plan for where you'll pull the username/password from. I'm not entirely sure the best place to be honest. Should it be in Here is where the mustache template is set up: You'd need to add the username and password there, and make use of the |
Here's a link to the contribution guide that gives some info on how to get up and running using VSCode dev containers: https://github.com/danecreekphotography/node-deepstackai-trigger/blob/main/CONTRIBUTING.md. You'll probably hit some hiccups, the dev containers can be a smidge touchy. If you decide to give it a go and have any issues getting the first F5 going let me know. |
One other thought: environment variables that then populate into settings.json seems like overkill. The whole point to Docker secrets is the files themselves can have the secret in them and then you just don't back up the file. To make that really work as Docker expects it's probably best to split them out to a file that isn't settings.json, so settings.json can still get checked in but a separate secrets file holds the actual secrets and doesn't get checked in. |
@danecreekphotography Thanks for the response. I gave this all a read and I think we're mostly on the same page. When I have some time to dig in further I will; I'm not sure when that will be, hopefully the next few days. |
I'll just leave this sit for a bit, you're welcome to poke around and take your time. If you have questions just comment back here and I'll do my best to answer. |
@danecreekphotography Just wanted to pop in to mention that this is still on my mind and something I am planning to contribute on, assuming everything works out; I haven't looked into the implementation details much yet, I've been pretty busy with other things in life. Feel free to assign this to me, I don't think I'm able to. Thinking a bit more into this, just wanted to add my thoughts and get some feedback from you.
with some sort of secret file, I'm not sure if this would be a
I also think it is necessary to allow secrets in If this seems ok to you, I'll start looking more specifically into implementation details and the information you mentioned in previous comments. I also believe strongly in TDD, so I plan to do all of this with a test-first approach. |
No rush, whenever you get to it. For the secret file please use json as the format as it's the format used for all other configurations in the system. You could do something as simple as: {
"blueIrisUsername": "username",
"blueIrisPassword": "password"
} You'll need to decide where you want them to work. Each place where they get used will have to go through the mustache formatter and it's probably overkill to try and make it work for every property and a user-defined list of values. I suggest sticking to ones that are likely to have secrets in them rather than trying to make fully generic: the URLs and the various API keys for the different services. This means you can include a json schema for the secrets file, validate against it at runtime, and also have Intellisense for end users during editing. jest is already integrated into the project so you should have no trouble doing TDD. |
@danecreekphotography I created a PR to add tests where I plan to modify code. #378 |
I added a couple of super minor things, take a peek and let me know what you think. Then I can merge it. |
Re-opening, was auto-closed by github on merge. |
When you do your next PR make sure you pull in my change for #380 from main. |
@danecreekphotography Am I right in thinking that |
I had to go double-check the settings schema, it's been a while. Yes, deepstackUri is required and that is the only required property. |
@danecreekphotography This is still a work in progress. But this is where I'm at, at the moment. #383 Happy path is working, I need to consider a few more edge cases in |
I'm always up for logging more stuff in verbose mode. Since there's no UI to this thing it's only the logs that saves people when there are issues. |
Merged to the |
Why do you even need username and password - just setup Blue Iris to not need authentication from the local lan. In Blue Iris - go to settings then Web Server then Advanced, in there change Authentication to Require from Non-LAN only. - then limit access by IP Address to what ever - in my example it is ^192.168.0.* |
@schford With security it is recommended to have many layers of security. Access to my network is one layer of security, requiring username/password to Blue Iris is another layer. If it's possible to have more layers, I will. |
@schford This isn't specific to BlueIris username/password. The API keys and whatnot for the other notification methods are required and considered secrets as well. |
Merged and released as v5.5.0. The |
Is your feature request related to a problem? Please describe.
When adding a
triggerUri
for a Blue Iris system that requires authentication, myuser
andpw
are in a file in plain text.Describe the solution you'd like
Preferably this would be a secret, environment variable, or in a file of key/value pairs that get's ignored when a user backs up their configuration (similar to home assistant: https://www.home-assistant.io/docs/configuration/secrets/).
The best solution in my mind would be to take mustache templating further. For example in the docs there is:
This could become:
This could look inside
settings.json
. Then alternativelysettings.json
could use mustache templating to look to an environment variable or secret or key/value pair file; which would be a benefit to all the other settings that have a username/password. Then the mustache templating intriggerUri
could consistently look tosettings.json
. Something like:...or possibly
SECRET.BLUE_IRIS_PASSWORD
or something along those lines.Describe alternatives you've considered
I described a couple alternatives above.
Additional context
I think the main problem here is the need to separate configuration from secrets. If my server dies, how do I get my configuration back to get up and running again; ideally it's backed up, but it shouldn't be backed up with plain text secrets. With my other docker containers I have written a shell script that grabs usernames/passwords from LastPass using their cli and then uses
sed
to drop them in.env
files and then I reference those.env
files in mydocker-compose
(https://docs.docker.com/compose/environment-variables/#the-env_file-configuration-option).ALSO, I love node/typescript and can probably provide some assistance in this implementation.
ALSO ALSO, thanks to everyone that has contributed to this project. I absolutely love it!
The text was updated successfully, but these errors were encountered: