3 ms·
If I understand the article properly, what the author is suggesting is that instead of writing lines into the database that contain information about users, the
by steven2012 12y ago
If I understand the article properly, what the author is suggesting is that instead of writing lines into the database that contain information about users, they create a hash that has some secret + user-supplied information, and if it matches, then that's considered validation.
The reason why I completely disagree with this is because this is embedded in code. All your developers will have access to this code, and you have people joining and leaving your company all the time. If this scheme is used to protect more important information and if it leaks, then it could cause chaos.
The difference is that all developers generally have access to code, but only some well-trusted people have database access in prod. If I care about security, that is a more secure way to do things.
- ars 12y agoSounds like security by obscurity to me. If you are worried about the secret part of the MAC then keep that secret, or change it when someone leaves.
- baby 12y agoYou could make the secret of the MAC an environment variable. PS: I don't understand why you are getting downvoted, your comment is more relevant than most of the comments here who don't understand a MAC.
- wtbob 12y agoHow do you prevent your developers from accessing the production database? Use the same mechanism to prevent them from knowing the production HMAC secret. If the production DB credentials are hard-coded, developers would indeed have access to the prod DB; if the production HMAC secret were hard-coded, developers would indeed be able to forge tokens. So don't do that. That's why we use environment variables.