In Greek mythology, Achilles was killed by an arrow to his only weak spot—his heel. Achilles clearly needed a better vulnerability management plan! 1 Unlike Achilles, who had only one vulnerable area, your cloud environments will have many different areas where vulnerabilities can appear. After locking down access control, setting up a continuous process for managing potential vulnerabilities is usually the best investment in focus, time, and money that you can make to improve security.

There is considerable overlap between vulnerability management and patch management. For many organizations, the most important reason to install patches is to fix vulnerabilities rather than to fix functional bugs or add features. There is also considerable overlap between vulnerability management and configuration management, since incorrect configurations can often lead to vulnerabilities, even if you’ve dutifully installed all security patches. There are sometimes different tools and processes for managing vulnerabilities, configuration, and patches, but in the interests of practicality, we’ll cover them all together in this chapter.

Unfortunately, vulnerability management is rarely as easy as turning on automatic patching and walking away. In cloud environments, vulnerabilities may be found in many different layers, including the physical facilities, the compute hardware, the operating system, code you’ve written, and libraries you’ve included. The cloud shared responsibility model described in Chapter 1 can help you understand where your cloud provider is responsible for vulnerabilities, and the contents of this chapter will help you manage your responsibilities. In most cases, you’ll need several different tools and processes to deal with different types of vulnerabilities.

Vulnerability Versus Patch Management

The terms “vulnerability management” and “patch management” are often used interchangeably, but they are different. Software patches often fix functional issues in addition to security vulnerabilities, and not all vulnerabilities are fixed by applying patches. For example, your vulnerability management process might identify insecure configurations that are fixed without patching, or it might mitigate a vulnerability by turning off a feature rather than applying a patch.

Differences from Traditional IT

The rate of change is often much higher in cloud environments compared to on-premises, and these constant changes can leave traditional vulnerability management processes in the dust. As discussed in Chapter 3 , you must use inventory from cloud APIs to feed each system into your vulnerability management tools as it is created, to avoid missing new systems as they come online.

In addition to the rate of change, popular contemporary hosting models such as containers and serverless hosts change the way that you do vulnerability management, because existing tools either aren’t applicable or aren’t efficient. If you have a lot of containers, you cannot put a heavyweight vulnerability management tool that uses a few percent of your CPU in every container, like you would in virtual machines. You’d likely end up running hundreds of copies of the agent on the system and have no CPU time left for the real work!

Plus, even though continuous integration (CI), continuous delivery (CD), and microservice architectures are separate from cloud computing, they often happen along with cloud adoption. Adoption of these techniques can also radically change vulnerability management.

For example, a traditional vulnerability management process might look something like this:

  1. Discover that security updates or configuration changes are available.

  2. Prioritize which updates need to be implemented based on the risk of security incidents.

  3. Test that the updates work, in a test environment.

  4. Schedule the updates for a production environment.

  5. Deploy the updates to production.

  6. Verify that production still works.

This type of process is reasonably designed to balance the risk of a security incident against the risk of an availability incident in production environments. As I often like to tell people, security is easy—just turn everything off and bury it in concrete. Securing environments while keeping them running and usable is much more difficult.

However, in our brave new world of cloud computing, infrastructure as code, CI/CD, and microservice architectures, we have options for reducing the risk of an availability incident and changing the balance:

  • Cloud offerings and infrastructure as code allow the definition of the environment to be part of the code. 2 This allows a new environment and new code to be tested together, rather than combining the environment and the code at the end when you install on an existing machine. In addition, because you can create a new production environment for each deployment and switch back to (or re-create) the old one easily if needed, you can reduce the risk of getting into a state where you cannot roll back quickly. This is similar to “blue/green” deployments in traditional environments, 3 but with the cloud you don’t need to pay for the “green” environment all the time, so infrastructure as code can be used even for smaller, lower-budget applications.

  • Continuous integration and continuous delivery allow smaller changes to be deployed to production on each iteration. Smaller changes reduce the risk of catastrophic failures and make troubleshooting easier for problems that do arise.

  • Microservice architectures can decouple services, so that changes in one microservice are less likely to have undesired side effects in other microservices. This is especially true in container-based microservice environments, because each container is isolated from the others.

  • Microservice architectures also tend to scale horizontally, where the application is deployed across more machines and containers as needed to handle the load. This also means that changes can be rolled out in phases across the environment, and bugs that got missed in testing or potentially disruptive scans 4 will take down only some of the capacity of the application.

Each of these items swings the balance toward higher availability, which means that security updates can be more proactive while still raising the overall availability of the system. This in turn reduces your overall risk. The new vulnerability management process looks like this:

  1. Automatically pull available security updates as part of normal development efforts. For example, this might include updated code libraries or updated operating system components. Note that if you’re doing this regularly, the changes will tend to be smaller and easier to digest.

  2. Test the updates along with other application changes as part of the normal application test flow for a deployment. Only if you find a problem at this stage do you need to step back to evaluate whether the updates need to be included.

  3. Deploy the new version, which automatically creates a new production environment that includes code changes, security updates, and potentially updates to the configuration. In many cases, this new deployment will only get a small subset of the production traffic initially, so that if there is an issue it will only affect a small subset of the users before being rolled back.

  4. Discover and address any additional vulnerabilities in test or production environments that aren’t covered as part of the normal delivery process, add them as bugs to the development backlog, and address them in the next iteration (or as a special release if really urgent).

You still have some manual vulnerability management work to do in step 4, but far less than in the standard process. As you’ll see in this chapter, there are many types of vulnerabilities, but this high-level process will work for most.

Vulnerable Areas

What types of vulnerabilities do you have to worry about? Imagine that your application is part of a stack of components, with the application on top and physical computers and facilities at the bottom. We’ll start at the top of the stack and work downward. There are many different ways to categorize the items in the stack, but we’ll use the shared responsibility model diagram from Chapter 1 (see Figure 5-1 ).

Let’s look at each layer of this diagram in more detail from the perspective of vulnerability management, starting at the top. Your responsibilities will differ depending on the delivery model (IaaS, PaaS, or SaaS).

prcs 0501

Figure 5-1. Cloud shared responsibility model

Data Access

Consumer responsibility for IaaS, PaaS, and SaaS

Deciding how to grant access to the data in the application or service is almost always the customer’s responsibility in a cloud environment. Vulnerabilities at the data access layer almost always boil down to access management problems, such as leaving resources open to the public, leaving access intact for individuals who no longer need it, or using poor credentials. These issues were discussed in detail in Chapter 4 .

Application

Consumer responsibility for IaaS and PaaS

If you’re using SaaS, the security of the application code will be your provider’s responsibility, but there may be security-relevant configuration items that you’re responsible for as a customer. For example, if you’re using a web email system, it will be up to you to determine and set reasonable configurations such as two-factor authentication or malware scanning. You also need to track and correct these configurations if they drift from your requirements.

If you’re not using SaaS, you are probably writing some sort of application code, whether it’s hosted on virtual machines, an aPaaS, or a serverless offering. No matter how good your team is, your code is almost certainly going to have some bugs, and at least some of those bugs are likely to impact security. In addition to your own code, you’re often going to be using frameworks, libraries, and other code provided by third parties that may contain vulnerabilities. Vulnerabilities or malware in this inherited code are often more likely to be exploited by attackers, because the same basic attack will work across many applications.

Warning

Vulnerabilities in popular open source components, such as Log4j, Apache Struts, and OpenSSL, have led to vulnerabilities in many applications that use those components. Exploiting these vulnerabilities is much easier for attackers than researching specific application code, so they tend to be an even higher risk than vulnerabilities in code you’ve written!

The classic example of an application vulnerability is a buffer overflow. However, many applications are now written in languages that make buffer overflows difficult, so while these attacks still happen, they don’t make the top of the list any more. Following are a few examples of application vulnerabilities from the OWASP Top 10 list for 2021. In each of these examples, access controls, firewalls, and other security measures are largely ineffective in protecting the system if these vulnerabilities are present in the application code:

Broken access control

Whereas the Data Access section deals with errors in granting access, this deals with errors in the application code that actually enforces that access. A very common error for web applications is trusting something the browser is telling you, such as “I have verified that the parameter in this field is safe,” when the browser is completely under the attacker’s control and can’t be trusted. Cross-site scripting is one example of this class of errors.

Injection attacks

This is when your application gets a piece of untrusted data from a malicious user and sends it to some sort of interpreter. A classic example is SQL injection, where the attacker sends information that causes the query to return everything in the table instead of what was intended.

Vulnerable and outdated components

If you’re using a component in your application and the component has a vulnerability, your application is also likely to be vulnerable. Log4j is the one of the best-known examples of this, where a vulnerability in a seemingly harmless logging package allowed anyone to take over an application if they could get the application to put a particular string into the application logs.

Secure Software Standards and Frameworks

It can be difficult to know if the components and applications that you’re using contain accidental vulnerabilities, or even malware that’s been purposefully injected. There are several industry efforts aimed at helping with this problem.

Standards such as the NIST Secure Software Development Framework (SSDF) are similar to food safety standards, but for software; they provide requirements for producing secure software. These standards typically tell you what you need to accomplish, but not how to accomplish it.

A Software Bill of Materials (SBOM) is like an ingredients label for software, and can tell you what went into an application or component. This can make automated scanning for vulnerabilities in your dependencies much more accurate. Several tools can now generate and consume SBOMs, and at the time of this writing, there are two popular SBOM formats, CycloneDX and SPDX . SBOMs are required by some standards, including the NIST SSDF, and are likely to be contractually required by organizations purchasing software in the future.

Security frameworks such as Supply-chain Levels for Software Artifacts (SLSA) provide a set of guidelines on how to secure your development and build environments and digitally sign applications and components. These can tell you how to meet some of the requirements in the standards, and if you’re consuming components, the SLSA level can give you an idea of how mature the process for producing each component is.

Note that application-level attacks are possible regardless of how your application is deployed—on a virtual machine, on an aPaaS, or on a serverless platform. Some tools discussed in Chapter 6 , such as web application firewalls, may be able to act as a safety net if there is a vulnerability in application code. However, make no mistake—quickly detecting and fixing vulnerable code and dependencies is your first and most important line of defense.

Although web application frameworks such as React can be a source of vulnerabilities you have to manage, they can also help you avoid vulnerabilities in your own code. Many frameworks have built-in protections against cross-site scripting (XSS), cross-site request forgery (CSRF), SQL injection (SQLi), clickjacking, and other types of attacks. Understanding the protections offered by your framework and using them can easily enable you to avoid some of these issues.

Middleware

Consumer responsibility for IaaS and some PaaS

In many cases, your application code uses middleware or platform components, such as databases, application servers, or message queues. Just as with dependent frameworks or libraries, vulnerabilities here can cause you big problems because they’re attractive to attackers—the attacker can exploit that same vulnerability across many different applications, often without having to understand the applications at all.

If you’re running these components yourself, you’ll need to watch for updates, test them, and apply them. These components might be running directly on your virtual machines, or they might be inside containers you’ve deployed. Note that tools that work for inventorying what’s installed on virtual machines will usually not find items installed in containers.

If the components are provided as a service by your cloud provider, your provider will usually have the responsibility for patching. However, there’s a catch! In some cases, the updates won’t be pushed to you automatically, because they could cause an outage. In those cases, you may still be responsible for testing and then pushing the button to deploy the updates at a convenient time.

In addition to applying patches, you also need to worry about how middleware is configured, even in a PaaS environment. Here are some real-world examples of middleware/platform configuration issues that can lead to a security incident or breach:

  • A web server is accidentally configured to allow viewing of the password file.

  • A database is not configured for the correct type of authentication, allowing anyone to act as a database manager.

  • A Java application server is configured to provide debug output, which reveals a password when a bug is encountered.

For each component you use, you need to examine the configuration settings available and make a list of security-relevant settings and what the correct values are. These should be enforced when the component is initially brought into service and then checked regularly afterward to make sure they’re all still set correctly and prevent “configuration drift.” This kind of manual monitoring is often called benchmarking , health checking , or simply configuration management .

Tip

While you can certainly write benchmarks or configuration specifications from scratch, I recommend starting with a common set of best practices, such as the Center for Internet Security’s CIS Benchmarks . You can tailor these for your organization and deployments, and even contribute a change if you find a problem or want to suggest an enhancement. Because the benchmarks are a community-based effort, you’re more likely to benefit from up-to-date configuration checks that take into account new threats and new versions of platform products and operating systems. Several popular products can perform the CIS Benchmarks checks out of the box.

Operating System

Consumer responsibility for IaaS

Operating system patches are what many people think of when they think of vulnerability management. It’s Patch Tuesday, 5 time to test the patches and roll them out! But while operating system patches are an important part of vulnerability management, they’re not the only consideration.

Just as with the middleware/platform layer of the stack, you must make sure the configuration is correct in addition to patching. You can do this by having benchmarks for the OS configurations that are set when deploying the operating system instance and then checked regularly afterward.

In addition, operating systems tend to ship with a lot of different components that are not needed in your environment. Leaving these components in a running instance can be a big source of vulnerabilities, either from bugs or misconfiguration, so it’s important to turn off anything that’s not required. This is often referred to as hardening . One advantage with containers is that you often start with a minimal container image and only install what you need for the application to run in the container, a process that hardens the container by default.

Many cloud providers have a catalog of virtual machine images that are automatically kept up to date, so that you should get a reasonably up-to-date system when deploying. However, if the cloud provider doesn’t automatically apply patches upon deployment, you should do so as part of your deployment process.

An operating system typically consists of a kernel , which runs all other programs, along with many different userspace programs. Many containers also contain the userspace portions of the operating system, and so operating system vulnerability management and configuration management also factor into container security.

In most cases, the cloud provider is responsible for the hypervisors. However, if you’re responsible for any hypervisors, they’re also included in this category because they’re essentially special-purpose operating systems designed to hold other operating systems. Hypervisors are typically already hardened, but they do still require regular patching and have configuration settings that need to be benchmarked and set correctly for your environment.

Network

Consumer responsibility for IaaS

Vulnerability management at the network layer involves two main tasks: managing the network components themselves and managing which network communications are allowed.

The network components themselves, such as routers, firewalls, and switches, typically require patch management and security configuration management similar to operating systems, but often through different tools.

Managing the security of the network flows going through those devices is discussed in detail in Chapter 6 .

Virtualized Infrastructure

Provider responsibility

In an Infrastructure-as-a-Service environment, the virtualized infrastructure (virtual network, virtual machines, storage) will be the responsibility of your cloud provider. However, in a container-based environment, you may have security responsibility for the virtualized infrastructure or platform on top of the one offered by the cloud provider. For example, vulnerabilities may be caused by misconfiguration or missing patches of the container runtime, such as Docker, or the orchestration layer, such as Kubernetes.

Physical Infrastructure

Provider responsibility

In most cases, physical infrastructure will be the responsibility of your cloud provider. There are a few cases where you may be responsible for configuration or vulnerability management at the physical level, however. If you are running a private cloud, or if you get bare-metal systems provisioned as a service, you may have some physical infrastructure responsibilities. For example, vulnerabilities can be caused by missing BIOS/microcode updates or poor security configuration of the baseboard management controller that allows remote management of the physical system.

Finding and Fixing Vulnerabilities

Now that you’re armed with an understanding of all of the places vulnerabilities might be hiding, you need to identify which types of vulnerabilities are most likely to be a problem in your environment. As I’ve repeated several times in this book, go for the biggest bang for the buck first—pick the most important area for your organization, and get value from it before moving on to other areas. A common pitfall is having four or five different sets of tools and processes in place just so you can check off some boxes on a list of best practices somewhere, none of which are actually providing a lot of value in finding and fixing vulnerabilities.

If you recall the asset management pipeline discussed in Chapter 3 , this is the part where we put our fancy tools into the pipeline ( Figure 5-2 ) to make sure we know about and deal appropriately with our risks.

prcs 0502

Figure 5-2. Sample asset management pipeline

In Chapter 3 , we were concerned with the left half of the diagram—watching procurement to find out about shadow IT and making sure we inventoried the assets from all the different cloud providers. Here, the goal is to plug the leaks shown on the right half of the diagram. For example, this is where we can minimize our “tooling” leaks (which result from not protecting known assets) as well as our “findings” leaks (which result from not properly dealing with known findings).

First, look at the tooling leaks area of the figure. Imagine the sizes of the pipes in your environment as being determined by a combination of how many problems you might find in these areas, as well as how critical to the business those problems might be. I’ve found that when I imagine this, I sometimes realize that there is a lot of water gushing out in a particular area, either because there’s no tool in that area or because the tool doesn’t have visibility to a lot of assets. This can lead to a lot of unknown risk!

For example, if your environment contains a lot of Windows systems with critical data, fixing leaks in your antivirus pipeline might be near the top of your list. On the other hand, if you have mostly web applications running on Linux, an aPaaS, or a serverless platform, you probably want to focus on making sure you find and remediate web application vulnerabilities first before worrying too much about a small number of Windows systems that have less-critical data.

Next, look at the findings leaks area of the figure. This time, imagine that the sizes of the pipes are determined by the number of findings coming out of each tool and how critical those findings might be. You may realize that you have tools from which you’re ignoring a lot of important output, and you’re therefore creating a lot of unknown risk.

There are many, many different types of tools, which overlap a lot in the vulnerabilities they search for. Some of the tools have been used in traditional environments for years, and others are newly introduced by cloud environments. The following are explanations of the different categories of vulnerability and configuration management tools, but note that many products will address more than one of these categories.

Network Vulnerability Scanners

Alongside operating system patches, network vulnerability scans are the other best-known piece of vulnerability management. This is for a good reason—they’re very good at finding some types of vulnerabilities—but it’s important to understand their limitations.

Network vulnerability scanners don’t look at software components. They simply make network requests, try to figure out what’s listening, and check for vulnerable versions of server applications or vulnerable configurations. As an example, a network vulnerability scanner could determine that one of the services on a system is allowing insecure connections, which would make the system vulnerable to a POODLE attack , based on the information in an SSL/TLS handshake. The scanner can’t know, however, about the different web applications or REST APIs served up on that network address, nor can it see components such as library versions inside the system.

Obviously, network vulnerability scanners cannot scan the entire internet, or your entire cloud provider, and magically know which systems are your responsibility. You have to provide these tools with lists of network addresses to scan, and if you’ve missed any addresses, you’re going to have vulnerabilities you don’t know about. This is where the automated inventory management discussed in Chapter 3 is vital. Because many cloud components are open to the internet, and because attackers can exploit vulnerabilities that they discover in common components very quickly, your cycle time for inventorying internet-facing components, scanning them, and fixing any findings needs to be as fast as possible.

In addition, don’t make the mistake of thinking network vulnerability scans are unnecessary just because you have isolated components, which will be described in Chapter 6 . There is often a debate between network teams and vulnerability scanning teams on whether to poke holes in the firewall to allow the vulnerability scanner into a restricted area. I maintain that the risk of having an unknown vulnerability is much higher than the risk that an attacker will leverage those specific firewall rules to get into the restricted area, so vulnerability scanners should be allowed to scan every component, even if it means weakening the perimeter network controls very slightly. I have seen many incidents where an attacker got behind the perimeter and exploited a vulnerable system there. In contrast, although it has probably happened somewhere, I have not personally seen or heard of any incidents where the attacker took over the scanner and used its network access to attack systems.

Network vulnerabilities found on a segment of a protected virtual private cloud network have a lower priority than vulnerabilities on a component directly exposed to the internet, but you should still discover them and fix them. Attackers have a very inconvenient habit of ending up in parts of the network where they’re not supposed to be.

Depending on how your deployment pipeline works, you should incorporate a network vulnerability scan of the test environment into the deployment process where possible. Any findings in the test environment should feed into a bug tracker, and if not marked as a false positives, they should ideally block the deployment.

There are several cloud-based network vulnerability scanners that you can purchase and run as a service, without purchasing any infrastructure. However, you may need to create relay systems or containers inside your network for scanning areas that are not open to the internet.

Warning

Network-based tools can find vulnerabilities without knowing what processes they’re talking to; they just see what process answers on different TCP/UDP ports on a given IP address. They’re very useful because they see the same things an external attacker will see. However, this can also generate false positives, because the tool will often use the reported version of a component, which may not be correct or may not indicate that security patches have been installed. You must have a well-documented, effective process for masking false positives, or you run the risk of teams ignoring all of the scan results because some of them are incorrect.

Agentless Scanners and Configuration Management Systems

If network vulnerability scanners bang on the doors and windows of the house, agentless scanners and configuration management systems come inside the house and poke around. Agentless scanners also connect over the network, but use credentials to get into the systems being tested. The term “agentless” distinguishes these scanners from the ones described in the next section, which require an “agent” to run on each target system. In some cases, one tool may perform both network scans and agentless/agent scans.

When using agentless scanners, remember the least privilege principle and give the scanner credentials with the minimum permissions needed to perform the scan. Unfortunately, many scanners need full administrative privileges to function, but this is beginning to change, and some scanners have a “least privilege” option.

Agentless scanners can find vulnerabilities that network vulnerability scanners can’t. For example, if you have a local privilege escalation vulnerability that allows a normal user to take over the entire system, a network vulnerability scanner won’t have the “normal user” privileges needed to see it, but an agentless scanner does.

Agentless scanners often perform both missing patch detection and security configuration management, as the following examples show:

  • The agentless scanner may run package manager commands to check that installed software is up to date and has important security fixes. For instance, some versions of the Linux kernel or C libraries have problems that allow someone without root privileges to become root ; these problems can be detected by up-to-date scanners.

  • The agentless scanner may check that security configurations are correct and meet policy requirements. For example, the system may be configured to allow Telnet connections (which could allow someone snooping on the network to see passwords, and therefore should be prohibited by policy); the scanner should detect that Telnet is enabled and flag an alert.

In some cases, these tools can actually fix misconfigurations or vulnerable packages in addition to just detecting the problems. But as mentioned earlier, such automated fixes can disrupt availability if they introduce new problems or don’t match your environment’s requirements. Where possible, it’s preferable to roll out an entirely new system that doesn’t have the vulnerability rather than trying to fix it in place.

With all of this capability, why would you need both an agentless scanner and a network vulnerability scanner? Although there’s a lot of overlap, agentless scanners fundamentally have to understand the system they’re looking at, which means that they don’t function well on operating system versions, software, or other items they don’t recognize. The fact that network vulnerability scanners are “dumber” and only bang on network addresses is actually a strength in some cases, because they can find issues with anything on the network—even devices that allow no logins, such as network appliances, IoT devices, or containers.

Agent-Based Scanners and Configuration Management Systems

Agent-based scanners and configuration management systems generally perform the same types of checks as agentless scanners. However, rather than having a central “pull” model, where a controller system reaches out to each system to be scanned and pulls the results in, agent-based scanners install a small component on each system—the agent—that “pushes” results to the controller.

There are both benefits and drawbacks to this approach, described in the following subsections.

Credentials

Agent-based scanners eliminate one source of risk inherent to agentless scanners by making it the problem of whoever or whatever is deploying the agents in the first place.

As mentioned in the previous section, agentless scanners must have credentials for all the systems they scan—and usually privileged credentials—in order to perform their scans. Although the risk of granting those credentials is generally much less than the risk of unknown vulnerabilities in your environment, it does make the agentless scanner a really attractive target for attackers. In contrast, agent-based scanners require privileges to deploy initially, but the scanner console just receives reports from the agents and has only whatever privileges the agent permits the console to use (which may still be full privileged access).

Deployment

Agents have to be deployed and kept up to date, and a vulnerability in the agent can put your entire infrastructure at risk. However, a well-designed agent in a “read-only” mode may be able to mitigate much of the impact of an attacker taking over the scanner console; the attacker will still get a wealth of vulnerability information but may not get privileged access on all systems.

Agentless scanners don’t require you to deploy any code, but you often have to configure the target systems in order to provide access to the scanner. For example, you may need to create a user ID and provide that user ID with a certain level of sudo privileged access.

Network

Agentless scanners must have inbound network access in order to work. As previously mentioned, allowing this network access can increase the risk to your environment. Most tools also have the option of deploying a relay system inside your network that makes an outbound connection and allows control via that connection, but the relay system is another system that requires management.

Agent-based systems can make only outbound connections, without allowing any inbound connections. Outbound connections still have some risk, but it’s often lower than the risk associated with inbound connections.

Least privilege

With both agentless and agent-based scanners, you can follow the principle of least privilege by allowing only the necessary privileges to the user ID that is used by the scanner or agent. However, some operating systems offer additional ways to limit what running processes are able to do, such as SELinux or AppArmor on Linux systems. These can be difficult to apply effectively, but tend to work better to limit what agents can do rather than individual scanner users.

Choosing an agent-based or agentless scanner

Some tools can perform checks using either an agent model or an agentless model. Which is best? Ultimately, there’s no right answer for all deployments, but it’s important to understand the benefits and drawbacks of each when making a decision. I typically favor an agent-based model, but there are good arguments for both sides, and the most important thing is that you address configuration and vulnerability management.

Tip

Several cloud providers offer agent-based scanners in their support for your cloud environment. These can be simpler to automatically deploy, and you won’t have to manually pull a list of assets from your cloud provider and feed them into the scanner.

Cloud Workload Protection Platforms

Tools in the cloud workload protection platform category are offered by both cloud providers and third parties. They usually gather configuration and vulnerability management information via agents or agentless methods, via the deployment pipeline, or from a third-party tool. They’re typically marketed by the providers as a “one-stop dashboard” for multiple security functions, including access management, configuration management, and vulnerability management throughout the development and deployment phases.

These tools may also offer the ability to manage infrastructure or applications not hosted by the cloud provider—either on-premises or hosted by a different cloud provider—as an incentive to use them for your entire infrastructure. They’re sometimes also called cloud native application protection platforms (CNAPPs).

Container Scanners

Traditional agentless and agent-based scanners work well for virtual machines, but often don’t work well in container environments. Containers are intended to be very lightweight processes, and deploying an agent designed for a virtual machine environment in each container can lead to crippling performance and scalability issues. Also, if used correctly containers usually don’t allow a traditional network login, meaning that agentless scanners designed for virtual machines will fail.

Two approaches are popular as of this writing. The first approach is to use scanners that pull apart the container images and look through them for vulnerabilities. If an image is rated as vulnerable, you know to avoid deploying new containers based on it and to replace any existing containers deployed from it. This has the benefit of not requiring any access to the production systems, but the drawback is that once you identify a vulnerable image, you must have good enough inventory information about all of your running containers to ensure you replace all of the vulnerable ones.

In addition, if your containers are mutable (change over time), additional vulnerabilities may have been introduced that scanning the source image won’t reveal. For this reason and others, I recommend the use of immutable containers that are replaced by a new container whenever any change is needed. Regularly replacing containers can also help keep threat actors from persisting in your network, because even if they compromise a container, it will be wiped out in a week or so—and the new container will hopefully have a fix for the issue that led to the compromise.

The second approach is to concentrate on the running containers, using an agent on each container host that scans the containers on that system and reports which containers are vulnerable so that they may be fixed (or preferably, replaced). The benefit is that, if the agent is deployed everywhere, you cannot end up with “forgotten” containers that are still running a vulnerable image after you have created a new image with the fix. The primary downside, of course, is that you must have an agent on each host. This can potentially be a performance concern, and may not be supported by your provider if you’re using a Container-as-a-Service offering.

These approaches are not mutually exclusive, and some tools use both. If you’re using containers, or planning to use containers soon, make sure you have a way to scan for vulnerabilities in the images and/or running containers and feed the results into an issue tracking system.

Dynamic Application Scanners (DAST)

Network vulnerability scanners run against network addresses, but dynamic web application vulnerability scanners run against specific URLs of running web applications or REST APIs. Dynamic application security testing (DAST) tools can find issues such as cross-site scripting or SQL injection vulnerabilities by using the application or API like a user would. These scanners often require application credentials.

Some of the vulnerabilities found by dynamic scanners can also be blocked by web application firewalls (WAFs), as discussed in Chapter 6 . That may allow you to put a lower priority on fixing the issues, but you should fix them fairly quickly anyway to offer security in depth. If the application systems aren’t configured properly, an attacker might bypass the WAF and attack the application directly.

Dynamic scanners can generally be invoked automatically on a schedule, so that they can flag new known vulnerabilities that have been discovered. They can also be incorporated into a continuous deployment pipeline to run when changes are made to the application. DAST tools should feed their results into an issue tracking system rather than depending on someone to remember to check the report.

Static Application Scanners (SAST)

Whereas dynamic application scanners look at the running application, static application security testing (SAST) tools look directly at the code you’ve written. For this reason, they’re a very good candidate for running as part of the deployment pipeline as soon as new code is committed, to provide immediate feedback. These tools can spot security-relevant errors such as memory leaks or off-by-one errors that can be very difficult for humans to see. Because they’re analyzing the source code, you must use a scanner designed for the language that you’re using. Luckily, scanners have been developed for a wide range of popular languages, and can be run as a service. The OWASP Source Code Analysis Tools page is a good resource for finding a tool that will work for your application.

The biggest problem with static scanners is that they tend to have a high false positive rate, which can lead to “security fatigue” in developers. If you deploy static code scanning as part of your deployment pipeline, make sure that it will work with the languages you’re using and that developers can quickly and easily mask false positives so that they aren’t overwhelmed with a lot of useless findings on every scan.

Software Composition Analysis Tools (SCA)

Arguably an extension of static code scanners, software composition analysis (SCA) tools look primarily at the open source dependencies that you use rather than the code you’ve written. Most applications today make heavy use of open source components such as frameworks and libraries, and vulnerabilities in those can cause big problems. SCA tools automatically identify the open source components and versions you are using, then cross-reference against known vulnerabilities for those versions. They can help you discover high-risk vulnerabilities in your dependencies, such as vulnerabilities in Log4j, Apache Struts, or the Spring Framework. Some tools can automatically propose code changes that use newer versions.

In addition to vulnerability management, some products can look at the licenses the open source components are using to ensure that you don’t use components with unfavorable licensing. Some of these tools can also generate a Software Bill of Materials for your application, similar to an ingredients label for food. Some organizations, including the US federal government, now require an SBOM for any products that they purchase. The US government’s guidance is laid out in the Software Supply Chain Security Guidance document, and it’s likely that other governments and large organizations will adopt similar guidance in the future.

Interactive Application Scanners (IAST)

Interactive application security testing (IAST) tools do a little bit of both static scanning and dynamic scanning. They see what the code looks like and watch it from the inside while it runs. This is done by loading the IAST code alongside the application code to watch while the application is exercised by functional tests, a dynamic scanner, or real users. IAST solutions can often be more effective at finding problems and eliminating false positives than either SAST or DAST solutions.

Just like with static code scanners, the specific language and runtime you’re using must be supported by the tool. Because this is running along with the application, it can decrease performance in production environments. With modern application infrastructure and deployments, that concern can usually be mitigated either by horizontal scaling or by having the deployment pipeline run the IAST tool in a test environment that mimics a production workload closely.

Runtime Application Self-Protection Scanners (RASP)

Runtime application self-protection (RASP) tools may sound similar to the scanners described previously, but this is not a scanning technology. RASP solutions, like IAST solutions, involve an agent deployed alongside your application code, but RASP tools are designed to block attacks rather than just detect vulnerabilities. (Several products do both—detect vulnerabilities and block attacks—making them both RASP and IAST solutions.) Like IAST tools, RASP tools can degrade performance in some cases because more code is running in the production environment.

RASP solutions offer some of the same protection as a distributed WAF, because both block attacks in production environments. For this reason, RASP and WAF solutions are discussed in Chapter 6 .

Manual Code Reviews

Manual code reviews can be expensive and time-consuming, but they can be better than application testing tools for finding many types of vulnerabilities. In addition, having another person explain why a particular piece of code has a vulnerability can be a more effective way to learn than trying to understand the results from automated tools.

Code reviews are standard practice in many high-security environments. In many other environments, they may be used only for sections of code with special significance to security, such as sections implementing encryption or access control.

Penetration Tests

A penetration test (pentest) is performed by someone you’ve engaged to try to get unauthorized access to your systems and tell you where the vulnerabilities are. It’s important to note that automated scans of the types discussed earlier are not penetration tests, although a pentester may use those scans as a starting point. Larger organizations may have pentesters on staff, but many organizations contract with an external supplier.

Note

Penetration tests by an independent third party are required by PCI DSS and FedRAMP moderate/high standards, and they may be required for other attestations or certifications.

In pentesting, I recommend that you provide the pentester with information about the design of the system, but not any secret information such as passwords or API keys. In some cases, you may also choose to provide more initial access than an outside attacker would start with, either for testing the system’s strength against a malicious insider or for seeing what would happen if an attacker found vulnerabilities in the outer defenses.

You can also choose to point the pentester at the application without any additional information or to provide only limited information. But providing as much information as possible about the application (other than credentials) is usually more effective and a better use of time because the pentesters spend less time on reconnaissance and more time on finding actual vulnerabilities. Remember that real attackers will usually have more time to try to break into your system than your pentesters do!

It’s important to note that a pentester will typically find one or two ways into the system, but not all the ways. A pentest with negative or minimal findings gives you some confidence in the security of your environment. However, if you have a major finding and you fix that particular vulnerability, you need to keep retesting until you get acceptable results. Pentesting is typically an expensive way to find vulnerabilities, so if the pentesters are coming back with results that an automated scan could have found, you’re probably wasting money and time. Pentesting is often done near the end of the release cycle, which also means that problems found during pentesting are more likely to make a release late.

Automated testing often finds potential vulnerabilities, but pentesting (when done correctly) shows actual, successful exploitation of vulnerabilities in the system. Because of this, you should prioritize fixing high-severity pentest results above all other findings other than user reports.

Warning

Most cloud service providers require you to get approval prior to conducting penetration tests of applications hosted on their infrastructure or platform. Failure to get approval can be a violation of the provider’s terms of service and may cause an outage, depending on the provider’s response to the intrusion.

Penetration Testing and Red/Blue Teaming

A penetration test is typically scoped to a specific target, such as a new application or service, and is scheduled to occur at a specific time, such as prior to production deployment. A pentester will often start by using various scanning tools to find potential vulnerabilities and then will attempt to exploit those vulnerabilities.

A red team will often use many of the same tools as a pentester but is more loosely engaged to roam around the entire network or organization looking for vulnerabilities. A blue team is a defensive team and will attempt to detect the red team (as well as real attackers!). Some organizations also form purple teams , where the red and blue teams collaborate on fixing issues after they’re found and on creating more effective defenses.

User Reports

In a perfect world, all bugs and vulnerabilities would be discovered and fixed before users see them. After you’ve stopped laughing, you need to deal with reports of security vulnerabilities that you receive from your users or bug bounty programs.

This means you need to have a well-defined, fast process to verify whether each reported vulnerability is real or not, and if so roll out a fix and communicate to the users. In the case of a bug bounty program, you may have a limited amount of time before the vulnerability is made public, after which the risk of a malicious attack increases sharply.

User reports overlap somewhat with incident management processes. In some cases, external user reports straddle the line between being a helpful report and an extortion attempt! If your security leaders are not comfortable dealing with end users, public relations, or legal issues, you may also need to have someone in the process who specializes in communications and/or a lawyer to assist the security team in avoiding a public relations or legal nightmare. There are often multiple concerns at odds with one another: there’s a desire to say as little as possible to avoid legal liability, and a desire to communicate transparently to avoid a public relations nightmare, and a desire to keep things quiet to avoid a breach while the vulnerability is being fixed. There have been several notable cases where a poor response to a reported vulnerability or breach was much more damaging to an organization than the initial issue! 6

Example Tools for Vulnerability and Configuration Management

Most of the tools listed in the previous sections can be integrated into cloud environments, and most cloud providers have partnerships with vendors or their own proprietary vulnerability management tools.

Because so many tools address more than one area, it doesn’t make sense to categorize them into the areas listed earlier. I’ve put together a list of some representative solutions in the cloud vulnerability and configuration management space, with a very brief explanation of each. Some of these tools also provide features for incident detection and response ( Chapter 7 ), access management ( Chapter 4 ), inventory and asset management ( Chapter 3 ), or data asset management ( Chapter 2 ).

I’m not endorsing any of these tools by including them, or snubbing other tools by excluding them; these are just some examples so that when you get past the initial marketing blitz by the vendor of whatever solution you’re considering you’ll be able to recognize, “Oh, this tool claims to cover areas x, y, and z.” I’ve included some tools that fit neatly into a single category, some tools that cover many different categories, and some tools that are specific to popular cloud providers. This is a quickly changing space, and different projects and vendors are constantly popping up or adding new capabilities.

Here’s the list of tools, in alphabetical order:

  • Amazon Inspector is an agent-based scanner that can scan for missing patches and poor configurations on Linux and Windows systems, as well as being a container and serverless scanner.

  • Ansible is an agentless automation engine that can be used for almost any task, including configuration management.

  • AWS Config checks the configurations of your AWS resources in detail and keeps historical records of those configurations. For example, you can check that all of your security groups restrict SSH access, that all of your Electric Block Store (EBS) volumes are encrypted, and that all of your Relational Database Service (RDS) instances are encrypted.

  • AWS Systems Manager (SSM) is a security management tool that covers several areas, including inventory, configuration management, and patch management. The State Manager component can be used to enforce configurations, and the Patch Manager component can be used to install patches; both of these functions are executed by an SSM agent installed on your instances.

  • AWS Trusted Advisor performs checks in several areas, including cost, performance, fault tolerance, and security. It can perform some high-level checks in the area of configuration management for AWS resources, such as whether a proper IAM password policy is in place or CloudTrail logging is enabled.

  • Azure Update Management is agent-based and primarily aimed at managing operating system security patches, but it can also perform software inventory and configuration management functions.

  • Burp Suite is a dynamic web application scanning suite.

  • Chef is an agent-based automation tool that can be used for configuration management, and the InSpec project specifically targets configuration related to security and compliance.

  • Contrast provides IAST and RASP solutions.

  • Google Cloud Security Command Center is a security management tool that can pull in information from the Google Cloud Security Scanner and other third-party tools, and also provide inventory management and network anomaly detection functions.

  • Google Cloud Web Security Scanner is a DAST tool for applications hosted on Google Cloud Platform.

  • IBM Cloud Security and Compliance Center is a security management tool that can pull in vulnerabilities from IBM Vulnerability Advisor as well as network anomaly information.

  • IBM Vulnerability Advisor scans container images.

  • Mend.io , formerly WhiteSource, has several products, including an SCA solution.

  • Microsoft Defender for Cloud , formerly Azure Security Center, is a security management tool that can manage your cloud configuration and integrate with your code pipeline and system agents to pull in vulnerability information.

  • Palo Alto’s Prisma Cloud , formerly Twistlock, can perform configuration and vulnerability management on container images, running containers, and the hosts where the containers run.

  • Puppet is an agent-based automation tool that can be used for configuration management.

  • Qualys has products that cover many of the categories we’ve discussed, including network vulnerability scanning, dynamic web application scanning, and others.

  • Tenable has a range of products including the Nessus network scanner, agent-based and agentless Nessus patch and configuration management scanners, and a container scanner.

Tip

Statistically speaking, people are terrible at statistics. When you evaluate marketing claims, it’s important to use tools that have reasonable false positive and false negative rates. As an extreme example, if a tool flags everything as a problem, it will catch every one of the real problems (100% true positive rate), but the false positive rate will be so high that it’s useless. Similarly, if the tool flags nothing as a problem, its false positive rate is perfect (0%), but it has missed everything. Beware of marketing claims that focus on only one side of the equation!

Risk Management Processes

At this point in the process you should understand where the most vulnerable areas are in your environment and which tools and processes you can use to find and fix vulnerabilities. Now you need a system to prioritize any vulnerabilities that can’t be fixed quickly, where “quickly” is usually defined in relation to time periods in your security policy.

This is where a risk management program comes in, near the end of the pipeline shown in Figure 5-2 . Each vulnerability you find that can’t be addressed within your accepted guidelines needs to be evaluated as a risk, so that you consciously understand the likelihood of something bad happening and the impact if it does. In many cases, you might accept the risk as a cost of doing business. However, the risk evaluation might lead to additional controls (to reduce the likelihood) or mitigations (to reduce the impact), such as putting in place some extra detection or prevention tools or processes. Risk evaluation might also lead to avoidance, such as turning off the system entirely in some cases.

A leak in the pipeline here means you found vulnerabilities but couldn’t fix them right away, and you also failed to actually understand how bad they could be for your business. Using an existing framework for evaluating risk, such as NIST 800-30 or ISO 31000, can be much easier than starting from scratch.

You don’t need a really complicated risk management program to get a lot of value; a simple risk register with an agreed-upon process for assigning severity to the risks goes a long way. However, you’re not finished with vulnerability management until you’ve made a conscious decision about what to do with each unresolved vulnerability. These decisions need to be reevaluated periodically—say, quarterly—in case circumstances have changed.

Vulnerability Management Metrics

If you can’t measure how you’re doing with your vulnerability management program, you generally can’t justify its usefulness or tell if you need to make changes. Metrics are useful but dangerous things; they help drive continuous improvement and reveal problems, but they can also lead to silly decisions. Make sure that part of your process of reviewing metrics and results includes a sanity check on whether there are reasonable extenuating factors to a metric going the wrong direction, or whether the metrics are being manipulated in some way.

There are many different metrics available for vulnerability management, and many tools can automatically calculate metrics for you. Metrics can generally be reported by separate teams or business units. Sometimes a little friendly competition helps motivate teams, but remember that some teams will naturally have a harder job to keep up with vulnerability management than others!

Every organization will be different, but here are some metrics that I’ve found useful in the past.

Tool Coverage

For each tool, what percentage of the in-scope systems is it able to cover? For example, for a dynamic application scanner, what percentage of your web applications does it test? For a network scanner, what percentage of your cloud IP addresses does it scan? These metrics can help you spot leaks in your asset and vulnerability management pipeline. These metrics should approach 100% over time if the system scope is defined properly for each tool.

If you have tools with a really low coverage rate on systems or applications that should be in scope for them, you’re not getting much out of them. In many cases, you should either kick off a project to get the coverage percentage up, or retire the tool.

Mean Time to Remediate

It’s often useful to break the mean time to remediate metric down by different severities and different environments. For instance, you may track by severity (where you want to see faster fixes for “critical” items than for “low-severity” items) and break those out by types of systems (internal or internet-facing). You can then decide whether these time frames represent an acceptable risk, given your threat model.

Remember that remediation doesn’t always mean installing a patch; it could also be turning off a feature so that a vulnerability isn’t exploitable. Mitigation through other means than patch installation should be counted correctly.

Note that this metric can be heavily influenced by external factors. For example, when the Spectre/Meltdown vulnerabilities hit, patch availability was delayed for many systems, which caused mean time to remediate (MTTR) metrics to go up. In that particular case, the delays didn’t indicate a problem with the organization’s vulnerability management program; it meant that the general computing environment had been hit by a severe vulnerability.

Systems/Applications with Open Vulnerabilities

The systems/applications with open vulnerabilities metric is usually expressed as a percentage, since the absolute number will tend to go up as additional items are tracked. This metric is often broken down by different system/application classifications, such as internal or internet-facing, as well as the severity of the vulnerability and whether it’s due to a missing patch or an incorrect configuration.

Note that the patch management component of this metric will naturally be cyclical, because it will balloon as vulnerabilities are announced and shrink as they’re addressed via normal patch management processes. Similarly, changes to the benchmark may cause the configuration management component of this metric to temporarily balloon until the systems have been configured to match the new benchmark.

Some organizations measure the absolute number of vulnerabilities, rather than systems or applications that have at least one vulnerability. In most cases, measuring the number of vulnerable systems or applications is more useful than measuring the absolute number of vulnerabilities. A system that has one critical vulnerability poses about the same risk as a system with five critical vulnerabilities—either can be compromised quickly. In addition, the absolute number of vulnerabilities often isn’t much of an indication of the effort required to resolve all issues, which would be useful for prioritization. You might resolve hundreds of vulnerabilities in a few minutes on a Linux system with a command like yum -y update; shutdown -r now .

Variations of this metric can also be used to derive additional metrics around overall risk and effectiveness. For example, this metric may be subdivided into “systems/applications with open vulnerabilities that have been risk accepted” and “systems/applications with open vulnerabilities that exceed policy timeline and have not been risk accepted” to give you an indication of whether you’re accepting too much risk or whether you’re able to patch quickly enough.

Percentage of False Positives

The percentage of false positives metric can help you understand how well your tools are doing, and how much administrative burden is being placed on your teams due to issues with tooling. As mentioned earlier, with some types of tooling, false positives are a fact of life. However, a tool with too many false positives may not be useful.

Percentage of False Negatives

It may be useful to track how many vulnerabilities should have been detected by a given tool or process but were instead found by some other means. A tool or process with too many false negatives can lead to a false sense of security.

Vulnerability Recurrence Rate

If you’re seeing vulnerabilities come back after they’ve been remediated, that can indicate a serious problem with tools or processes.

A Note on Vulnerability Scoring

The first question almost everyone asks about a given vulnerability is, “How bad is it?” The most commonly accepted standard for “badness” is the Common Vulnerability Scoring System (CVSS). CVSS has been around since 2005, and two major versions are in heavy use (v2 and v3). Both versions have their proponents and critics, but most security professionals agree that the base number you get from either CVSSv2 or CVSSv3 doesn’t tell the whole story for your environment and your organization. It’s important to have some method to adjust CVSS scores for the threat landscape and your specific environment, either by using CVSS temporal and environmental scores or some other method.

However, this can quickly turn into a game of changing the classification of items to avoid going overdue. While metrics are useful, it’s important that you don’t lose track of the real goal, which is to prevent security incidents.

In many cases, we don’t need to think too hard about how bad the vulnerability is. The default action in cloud environments should be to automatically apply security patches and run automated tests to see whether they have caused issues. Only if a security patch or configuration change isn’t available, causes problems, or can’t be executed for other reasons should you go through the trouble of manually evaluating how big of a risk it is to your environment.

Change Management

Many organizations have some sort of change management function. In its simplest form, change management should ensure that changes are made only after they’re approved, and that there has been some evaluation of the risk of making a change.

Change management can assist with vulnerability management by making sure that proposed changes don’t introduce new security vulnerabilities into the system. If done poorly, change management can also hinder vulnerability management and increase overall risk by slowing down the changes needed to resolve vulnerabilities.

As discussed earlier in the chapter, some of the new technologies in cloud environments may reduce the risk of an overall outage, so that less manual change management is needed to achieve the same level of operational risk. Part of an overall cloud vulnerability management program may be modifying change management processes.

For example, pushing new code along with security fixes to production may be a business-as-usual activity that’s automatically approved by a change control board, provided that there’s a demonstrated process for quickly getting back to a good state. That might be accomplished by pushing another update, rolling back to a previous version, or turning off application traffic to the new version while the issue is being worked out. However, larger changes, such as changes to the design of the application, may still need to go through a manual change management process.

Ideally, there should be at least one security practitioner involved with the change control process, either as a change control board member or as an advisor.

Note

A documented change management process is required for several industry and regulatory certifications, including SOC 2, ISO 27001, and PCI DSS.

Putting It All Together in the Sample Application

Remember the really simple three-tier sample application from Chapter 1 ? It looked like Figure 5-3 .

prcs 0503

Figure 5-3. Diagram of a sample application

If you’re in an orchestrated, container-based microservice environment, with test and production Kubernetes clusters, your sample application may look a bit different. However, you can still spot the same three main tiers in the middle of the diagram ( Figure 5-4 ).

prcs 0504

Figure 5-4. Diagram of a sample microservice application

For simplicity, the worker nodes that actually run the containers aren’t shown in this diagram, and only one cluster is pictured rather than separate test and production clusters. Let’s look at how we might design a vulnerability management process in this environment. First, consider the roles shown at the top:

  1. Before deployment, a pentester tries to break into the system, just like a real attacker would. This test might be run by an external team that’s contracted to test this specific system at a given time, an internal red team that roams around doing unannounced testing of systems, or both.

  2. The user will use the application, just as in the previous examples. End users may report security vulnerabilities in addition to functional bugs.

  3. The admin/developer is a role with both development and operations/administration responsibilities. In your organization, these responsibilities might lie with a single person or multiple teams, but whoever is filling this role must do the following:

    1. Ensure that the infrastructure and platform components, such as the Kubernetes master and the worker nodes, are up to date.

    2. Make code updates. Note that in an infrastructure-as-code environment, these code updates might also represent changes to the infrastructure, such as new microservices or modifications to the “firewall” for each microservice to allow different connections.

    3. Push to production and/or switch traffic to the new version of the application. The process for and decision of when to do this will be organization-specific but for major deployments should usually include business stakeholders in addition to IT staff.

  4. The code reviewer may be part of a separate team, but is often simply another developer in the organization. Not every organization uses manual code reviews, but they can be a good way to spot vulnerabilities in security-critical areas of code such as authentication or authorization routines.

Second, let’s look at the pipeline to deploy, on the left side of the figure:

  1. An admin/developer will commit a change to the codebase, which will trigger the deployment pipeline automation.

  2. A static code scanner will flag problems in your proprietary code, such as accepting input without validation. A software composition analysis tool will also look at any open source dependencies to see if there are known vulnerabilities in them. Ideally, the developer will get almost immediate feedback if an issue is found, and issues that are severe enough will block deployment of the new code unless overridden.

  3. The automation will start up a copy of the new code in a test environment and run test cases to verify that the code functions.

  4. The automation will invoke a dynamic application tester to find any problems. Again, ideally the developer will be notified of any issues here, and severe issues will stop the process.

  5. If all tests pass, the code will be deployed as a new instance to production, where the administrator can choose to direct some or all of the production traffic to the new instance. If everything works fine, all traffic can be sent to the new instance and the old instances can be deleted.

Third, let’s look at the periodic scanning tools on the right side of the figure. These are needed because the world changes when new vulnerabilities are discovered, even if the code doesn’t change! For each of these, if a problem is found, a ticket will automatically be entered as an issue in a tracking repository (shown here as part of the source code repository), and issues will go through the risk management process if they stay around for too long:

  1. The network vulnerability scanner will test all of the TCP and UDP 7 ports on the IP addresses of the worker nodes that make up the cluster. In a well-configured cluster, the scanner may only see the HTTPS (tcp/443) ports open, but it may find problems with those (such as a vulnerable version of a web server or a configuration allowing weak TLS ciphers). It may also spot NodePorts opened accidentally that allow traffic in to some other service besides the frontend web server. For example, perhaps someone accidentally left the database open to the internet instead of only to the application microservices!

  2. The container scanner will look for problems in each running container. Perhaps the operating system components used by the containers have known vulnerabilities, such as binary libraries that can’t be detected by the SCA tools.

  3. The agent installed on each worker node (virtual machine) in the cluster will watch to make sure that the operating system components are kept up to date and that the CIS Benchmarks for that operating system pass.

  4. Finally, the IAST agent that’s part of each microservice will open a ticket for issues found while the code was executing, and the RASP agent will attempt to block attacks.

There’s a lot going on! Don’t panic, though. This is for educational purposes, and many smaller environments won’t need all the tools pictured here. Also, many products perform multiple functions: for example, a single tool might perform static scanning, dynamic scanning, and IAST/RASP. In a perfect world, all of the vulnerabilities would funnel into one place to be dealt with, like issues in a code repository, but here in the real world you may be stuck with multiple tool consoles to check. The important thing is to understand what the different types of tools do and select tools that address the biggest threats to your application.

Stated more bluntly, just buying a tool and installing it may look good on reports to management, but you need to actually do something with what the tool is telling you. Concentrate on finding real issues and creating a good feedback loop back to your developers and administrators, that you can measure with some useful metrics, before adding another tool into the mix.

Conclusion

Vulnerability management, patch management, configuration management, and change management are separate disciplines in their own right, with separate tooling and processes. In this chapter, I’ve combined them to quickly cover the most important aspects of each, but there are entire books written on all of these subjects.

Vulnerability management in cloud environments is similar in many ways to on-premises vulnerability management. However, with cloud computing often comes a heightened business focus on rapid deployment of new features. This leads to a need for vulnerability management processes that can keep up with quickly changing infrastructure.

In addition, the philosophies of immutable infrastructure and continuous delivery are often adopted along with the cloud, and these can considerably reduce the risk of an outage due to a change. This alters the balance between operational and security risk. Because applying security fixes is a change, and you can make changes more safely, you can afford to roll out security fixes more quickly without risking bringing the system down. This means that you should usually adopt different vulnerability management, patch management, and change management processes in cloud environments. In addition, there are both cloud-aware and provider-specific tools that can make vulnerability management easier than it is on-premises.

After access management, vulnerability management is the most critical process to get right for cloud environments. Attackers can get unauthorized access to your systems through vulnerabilities at many different layers of your application stack. You need to spend some time understanding the different layers, what your vulnerability management responsibility is for each of those layers, and where the biggest risks to your environment are likely to be. You then need to understand the different types of vulnerability management tools available and which ones address the areas that are highest risk for you.

Every vendor will try to convince you that their tool will do everything for you. That’s rarely the case; you’ll usually need at least a few different tools to cover vulnerability management and configuration management across your cloud environment. Focus on getting value from each tool you use before throwing more into the mix. For each tool, you should be able to explain clearly what types of vulnerabilities it will find. You should also be able to sketch out a pipeline of how the tool gets valid inputs, how it finds and/or fixes vulnerabilities, how it communicates vulnerabilities back to the teams who are responsible for fixing them, and how you track the vulnerabilities that can’t be fixed right away as risks.

In the next chapter, I’ll finally talk about what most people think of first when they think about cybersecurity: firewalls and network controls.

Exercises

  1. What are some common areas where the consumer is responsible for vulnerabilities in IaaS cloud environments? Select all that apply.

    1. Physical attack surface vulnerabilities, such as door locks

    2. Missing operating security patches

    3. Incorrect middleware configurations, such as database configurations

    4. Incorrect application configurations, such as granting access to the wrong person

  2. Which of the following types of tools can discover missing operating system patches? Select all that apply.

    1. Network vulnerability scanners

    2. Agentless scanners and configuration management

    3. Dynamic application scanners

    4. Static application scanners

  3. Which of the following types of tools can discover coding errors that you’ve made in code you maintain? Select all that apply.

    1. Agentless scanners and configuration management

    2. Container scanners

    3. Dynamic application scanners

    4. Static application scanners

  4. True or false: You can be confident that your cloud environment is reasonably secure once you have fixed all vulnerabilities found in a network vulnerability scan.

  5. True or false: You can be confident that your cloud environment is reasonably secure once you have fixed all vulnerabilities found in a penetration test.

  6. True or false: You must fix every vulnerability found in order to have an acceptable level of risk for your cloud environment.

1 Perhaps one that included wearing boots.

2 For example, all major cloud providers can be used with HashiCorp Terraform, and AWS also has its proprietary CloudFormation.

3 A blue/green deployment is where you have old (blue) and new (green) versions of an application running at the same time. You move traffic a little at a time from the blue version to the green version, so that any issues with the new version don’t impact all of your customers at once and you can quickly move everyone back to blue if something is wrong with the new version.

4 One of the barriers to vulnerability scanning is that if you actually find a vulnerability, sometimes the scan will crash the affected component. Sure, you found a problem, but at the cost of incurring downtime! The risk of an outage is much lower if the scan can only crash one of the instances of the application at a time.

5 In 2003, Microsoft decided to collect all of the patches from the previous month and release them on the second Tuesday of the month, and many other companies followed suit. The rumor is that Tuesdays were chosen because they give plenty of time to avoid ruining the weekend, and Mondays are already bad enough.

6 Some examples of poor breach handling: Uber has paid over $148 million in a settlement agreement for attempting to cover up a breach, and LastPass harmed its reputation by attempting to downplay the severity of an August 2022 security incident.

7 UDP scanning, like any other UDP communications, is somewhat unreliable by design.