Consider you are in the middle of a party and you get a call from your boss that your job is at stake because of the security flaw you made in your code. Worst Nightmare, right?
Today we are going to talk about the common mistakes developers make when developing an application. Whether the application is small or big when you make your code vulnerable then you are doing something wrong. Don't worry, I have shared some of the best practices we follow to keep the code secure.
This is one of the common mistakes developers do by hardcoding the secret key or API key at App level or Frontend code, usually we think who is going to take it or see it. It may be perceived less vulnerable when it comes to no impact on your business. But consider you have hardcoded your 'twillio' or 'sendgrid' secret key or API key, then BOOM someone will use your service.
All the third-party service should be consumed by your backend application, whichever you have decided to go with.
Saving sensitive information at App Level, Cookies
Always encrypt or hash the value, even its less secure value. Keep in mind every value is of some significance to someone. If you are saving in the local database, try to encrypt the whole database or encrypt the value and save it.
This is another problem where developers think backend is really backend, when in reality it will be visible at browser or app level. Hackers can get access to your backend in a matter of minutes, believe me, it is doable.
All your backend applications should be HTTPS, no HTTP There are many ways to secure your backend app, following are few of the options.
Oauth 2.0 is a winner when it comes to securing your backend application from the frontend.
In olden days, when some application requires access through your Gmail, they will simply ask you to type your Gmail account and Gmail password to access your Gmail or google photos etc, in which you are sharing your sensitive information to some third-party application where you will not know how they are going to use it. Weird right? But we used to live in those days.
So Oauth was born, where your application will request for access rights from Gmail and Gmail will give you an access token, through which you can access Gmail with some level of restriction. Eg: Your application wants to read the Gmail inbox. You request Gmail with Read access for Gmail inbox and you get back an access token. You might think, now that I acquired an access token I will try to Write emails with it, but this is where OAuth will intervene and stop the action.
I hope the above explanation helps you understand OAuth usage. There are many players in the market related to IAM, Authentication. I have listed a few for you:
I will explain more on OAuth in the upcoming blogs :)