Introduction
In the previous chapter, we learned about Go tools such as fmt
, vet
, and race
, which are designed to help you with your code development. Let's now look at how to secure your code by looking at examples of common vulnerabilities. We'll also look at the packages in the standard library that can help you to store your data securely.
Security cannot be an afterthought. It should be part of your code kata, something that you practice every day. Most vulnerabilities in applications stem from the developer not knowing about potential security attacks and from not having a security review of the application before it gets deployed.
If you look at any websites dealing with sensitive data, for example, banking websites, they will have basic security in place, such as the use of a signed SSL certificate. It is always better to design your application with security in mind than to add security layers later, so as to avoid refactoring or redesigning your application...