Book Image

Node.js Application Security [Video]

By : Sachin Bhatnagar
Book Image

Node.js Application Security [Video]

By: Sachin Bhatnagar

Overview of this book

<p>As a Node.js developer, you’re entrusted to secure and safeguard your production apps against vulnerabilities and attacks that have the potential to bring down a business and cause irreparable damage. Businesses built in the cloud-native era should always strive to stay one step ahead of attackers who’re always on the lookout to inflict damage. It is time to get hands-on and make your application more secure!</p> <p>This course will empower you to strengthen &amp; safeguard your application against a host of attacks and vulnerabilities. You will learn about passwords and the best practices to store them safely in a Node.js application. You will then see how untrusted data can wreak havoc in production, and how to prevent injection attacks on your database. We will then examine cross site scripting attacks (XSS) and cross site request forgery attacks and the ways you can protect your app against them. You will then get hands-on with transport security by implementing SSL/TLS on an Amazon EC2 server instance. Lastly, we will tackle Distributed Denial of Service (DDOS) attacks and learn to identify vulnerable NPM packages in your application. Every video in this course approaches a real-world problem, explains the reasons behind it, and guides you through solutions that you can implement easily.</p> <p>By the end of this course, you'll be on your way to building a more secure Node.JS application that can easily safeguard your business and customers.</p> <p>The code bundle for this video course is available at -&nbsp;<a href="https://github.com/PacktPublishing/-Node.js-Application-Security" target="_blank">https://github.com/PacktPublishing/-Node.js-Application-Security</a></p> <h1>Style and Approach</h1> <p>This course adopts a hands-on learning approach with step-by-step instructions for implementing best practices and monitoring/preventing critical issues with Node.js apps in production.</p>
Table of Contents (6 chapters)
Chapter 4
Sanitizing Data and Preventing XSS and CSRF Attacks
Content Locked
Section 2
Preventing XSS Attacks
Having developed a strong understanding of XSS, we implement protection and security to prevent it in a demo Node.js application that is built on the Express framework. - Explore the importance of inbound encoding and sanitization of data - Implement outbound sanitization as a means to prevent persistent XSS attacks - Implement a Content Security Policy (CSP) header to whitelist sources of content