Chapter 13: Best Practices
Overall, the security of your ASP.NET Core web application typically relies on the steps a developer takes to implement security measures and write secure code. In the previous chapters and recipes of this book, we've learned what insecure code would look like, the risks such weaknesses introduce, and, most importantly, how to mitigate these security issues. But beyond the basics of secure coding are proven methods of writing code that are efficient for security. This is because they enable the necessary defensive or protective mechanisms available in the .NET framework, all of which we will examine in this chapter.
In this final chapter, we're going to cover the following recipes:
- Proper exception handling
- Using security-related cookie attributes
- Using a Content Security Policy
- Fixing leftover debug code
By the end of this chapter, you will have learned how to handle errors and exception safely, use attributes in cookies...