Hello HA Community,
I have been thinking a lot about security lately as we all have been. And I have come up with an idea that will help boost security and protect our API passwords by not needing to store them on external services like IFTTT, Stringify and others.
NB: I am not a developer, I am a network and security engineer by trade so I do not have the means to implement this myself.
Currently, if I want to execute a script externally, I will run a http POST to a url like the below:
https://myurl.duckdns.org:8123/api/services/script/lights_on?api_password=MYSECUREPASSWORD
Now we can all see the problem with this. My password is stored in cleartext on an external service and the security of my whole HA ecosystem is dependent on protecting that password. If someone were to get that password they could do horrible things to me and my family. They would have undetected access into my home network and do unimaginable things.
My proposed solution is a hashed API password. The hash would take two inputs, being:
1.) The URI (path) of the request, in this example it would be “api/services/script/lights_on”
2.) My actual password, in this example it would be “MYSECUREPASSWORD”
So the http POST request would look more like:
https://myurl.duckdns.org:8123/api/services/script/lights_on?api_hash=fg34h3#$%T34gf24TG@$t
This would result in a unique hash for each unique API call to my HA. For example, “api/services/script/lights_on” would have a different hash to “api/services/script/lights_off”. Furthermore, if the URI (path) were to be discovered, or if IFTTT was to be compromised, my API password has not been revealed.
I know this would not be trivial to implement, but I believe a lot of the community would be very appreciative of something like this.