By failing to prepare, you are preparing to fail.

Benjamin Franklin

Chapter 2Set Up the Environment

You should now have a better understanding of how your tools work and, more importantly, how they can cause problems if not used correctly. In this chapter, we’ll start working on the foundation—the server. There are many things to secure before we can write Node.js code.

You’re looking at the title and wondering why I’m talking about the server instead of Node.js. Application security is a layered concept—we start from the outside and first secure our environment, network, and other auxiliary systems before we can even start work on the core application, as the following illustration shows.

Why? Because if we don’t secure the surrounding ...

Get Secure Your Node.js Web Application now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.