Security isn't just about getting through the outer boundary of your infrastructure. It's also about ensuring that your environments and their components are secured from each other. You should apply security at each layer of the application, such as the web, application, and data layer. You should add security controls to all of the system's resources such as load balancers, network topology, database, and all servers.
For example, in a server instance, you can set up a firewall that allows you to determine which ports on your instances can send and receive traffic. You can use this to reduce the probability that a security threat on one instance will spread to every other instance in your environment. Similar precautions should be taken with other services. Specific ways to implement this best practice are discussed throughout this section.