I'm building a (very simple) tool to communicate between two servers. I started by asking if there was a better alternative than making a home made scripts and we came to the conclusion that for starter, a home made script was enough. (On stack-overflow, but since the discussion only occured in the comments, the question was closed)
To set things clear, the project is to send request to a server (web app endpoint) from a web app (manager).
Since the endpoint is accessible from everyone, I implemented a verification system to be a bit more secure. I know that a secure system is something that is known from everyone (and not closed).
So here's what I do :
When the manager sends a request, it concatenate all the value of the parameters that will be POSTed, plus a token. Then it sha256
the resulting string and send this among the parameters as a checksum.
On the endpoint, I concatenate all the parameters (except the checksum) and add the secure token, do a sha256
and compare it with the checksum parameter. If they are the same, everything's good.
This ensure that the data submitted aren't modified (in case someone is listening the network), the data come from a trusted source (with the secure token that is normally only known from my apps).
The only risk I can see here, is if someone get the secure token. Then this protocol fails. But in the same idea, if someone gets my facebook password for instance, he will be able to post anything!
Is this enough ? Do I need to implement more steps. I thought about these ones, what do you thing :
- Adding https in the endpoints
- Verifying the source ip
Thank you