Chapter 18. Improving your application’s security

 

This chapter covers

  • Encrypting traffic using HTTPS and configuring local SSL certificates
  • Defending against cross-site scripting attacks
  • Protecting from cross-site request forgery attacks
  • Allowing calls to your API from other apps using CORS

Web application security is a hot topic at the moment. Practically every week another breach is reported, or confidential details are leaked. It may seem like the situation is hopeless, but the reality is that the vast majority of breaches could’ve been avoided with the smallest amount of effort.

In this chapter, we look at a few different ways to protect your application and your application’s users from attackers. Because security is an extremely broad topic that covers lots of different avenues, this chapter is by no means an exhaustive guide. It’s intended to make you aware of some of the most common threats to your app and how to counteract them, and to highlight areas where you can inadvertently introduce vulnerabilities if you’re not careful.

Tip

I strongly advise exploring additional resources around security after you’ve read this chapter. The Open Web Application Security Project (OWASP) (www.owasp.org) is an excellent resource, though it can be a little dry. Alternatively, Troy Hunt (www.troyhunt.com/) has some excellent courses and workshops on security, geared towards .NET developers.

18.1. Adding HTTPS to an application

18.2. Defending against cross-site scripting (XSS) attacks

18.3. Protecting from cross-site request forgery (CSRF) attacks

18.4. Calling your web APIs from other domains using CORS

18.5. Exploring other attack vectors

Summary

sitemap