← Cloud Practitioner study path

Security and compliance · 12 min

AWS services that protect against and detect attacks

In this lesson you will learn what AWS Shield, AWS WAF, Amazon GuardDuty, Amazon Inspector and AWS Security Hub do, and how to tell them apart when they appear together in a question.

AWS has several services that protect your account against attacks or that alert you when they find one. An attack is any attempt by someone without permission to take down your application, steal your data or use your servers. Those services include AWS Shield, AWS WAF, Amazon GuardDuty, Amazon Inspector and AWS Security Hub, and to choose the right one in an exam question you need to know how they differ.

The fastest way to tell these services apart is to look at where each one works. Every time someone visits your site, their browser sends your application a request, which is a message asking for a page or a piece of data. Some services sit in the path of those requests and block what shouldn't get through, while others don't block anything: they review what already happened or the state of your servers, and they alert you when they find a problem. For example, in an online store, a service of the first kind stops a harmful request before it reaches the store, and one of the second kind alerts you the next day that someone got in with a stolen password.

A request leaves the internet, goes through AWS Shield and AWS WAF and reaches the application; below, GuardDuty, Inspector and Macie review and send their findings to Security Hub

Shield and WAF are in the path of the request, before it reaches your application. GuardDuty, Inspector and Amazon Macie sit outside that path and review what already happened or the state of your resources, and all of them send what they find to Security Hub.

Services that block attacks

AWS Shield

A distributed denial of service (DDoS) attack happens when many machines send to your application at the same time to take it down, that is, to overload it so it stops answering real customers. For example, if thousands of computers ask your store for its home page at the same time, real customers can no longer get in to shop. AWS Shield protects against this type of attack by looking at the volume of traffic, and it comes in two versions:

  • AWS Shield Standard, which protects all AWS customers automatically and at no additional cost against the most common network and transport layer DDoS attacks, which are the ones that try to flood the connection with traffic.
  • AWS Shield Advanced, which is a paid subscription and which adds expanded protection for the resources you choose, application layer protection with AWS WAF rules and access to the Shield Response Team (SRT), an AWS team that helps during an attack.

Shield Standard's protection is more complete if your application is reached through Amazon CloudFront, Amazon Route 53 or AWS Global Accelerator, which are AWS services that visitors go through to reach your application. In the case of Shield Advanced, the documentation also requires a Business or Enterprise to use the SRT. For example, a small store already has Shield Standard without doing anything, and a very large store that can't go down during a big sale can pay for Shield Advanced to have the SRT on its side.

True or false?

0 of 3
  1. To get AWS Shield Standard you have to subscribe and pay.

  2. With Shield Advanced you have access to the Shield Response Team during an attack.

  3. Shield Standard's protection is more complete if your application is reached through Amazon CloudFront or Amazon Route 53.

AWS WAF

AWS WAF is a web application firewall, that is, a filter that inspects every HTTP or HTTPS request that reaches a protected resource, such as a CloudFront distribution, an Amazon API Gateway API or an . Based on the rules you define, for example which IP address the request comes from or what it carries in the query, WAF lets the request through, blocks it with a 403 error or returns a custom response. The rules WAF offers also include one against .

Shield and WAF differ in what they look at, because Shield looks at how much traffic arrives and WAF looks at what each request carries. So a question that talks about blocking requests from a certain IP range is solved with WAF. For example, if someone types hidden commands into the store's product search box, WAF inspects that request and blocks it, while Shield, which only looks at how much traffic arrives, doesn't inspect what each request carries.

Which service do you use?

You want your Application Load Balancer to reject all requests that come from a certain IP range. Which service do you use?

Services that detect problems

Amazon GuardDuty

Amazon GuardDuty monitors your account all the time to find suspicious activity. To do this, it analyzes logs that already exist, such as AWS CloudTrail events, which record who did what in your account, flow logs from the VPC, which is your private network in AWS, and . Then it compares them with lists of malicious IP addresses and domains and with models. That way it detects stolen credentials, unauthorized cryptocurrency mining on your instances, which is when someone uses your servers to earn digital money, or .

When GuardDuty finds something, it generates a finding, which is the alert with the details of what it found. For example, if someone uses a developer's access keys at three in the morning, from a country where nobody at the company works, GuardDuty generates a finding.

Amazon Inspector

A vulnerability is a flaw in a program that an attacker could use to get in. Amazon Inspector scans the software running on your Amazon EC2 instances, in your Amazon ECR and in your Lambda functions, and tells you whether it has known vulnerabilities or was unintentionally exposed to the network. This scanning is continuous: when a new vulnerability is published that affects a package you use, Inspector scans again without you asking. For example, if the store uses a library to create invoices and one day it is announced that the library has a security gap, Inspector alerts you that your server has it installed.

GuardDuty and Inspector get mixed up because both alert you to security problems, but they answer different questions. GuardDuty answers "is someone attacking me?", while Inspector answers "do I have gaps someone could attack me through?". For example, at the store, Inspector alerts you that a server has a library with a security gap installed, and GuardDuty alerts you that someone already got into the account with an employee's stolen password.

GuardDuty or Inspector?

0 of 6

Tap the column of the service that detects it.

  1. Someone uses a developer's keys from another country at three in the morning

  2. An EC2 instance has a package with a known vulnerability

  3. An instance mines cryptocurrency without authorization

  4. A container image in Amazon ECR includes vulnerable software

  5. A new vulnerability is published that affects a library in your Lambda function

  6. Your instances make DNS queries to a known malicious domain

AWS Security Hub

GuardDuty, Inspector, Macie and third-party products send findings to AWS Security Hub, which correlates and prioritizes them

If you turn on GuardDuty, Inspector and Amazon Macie, which looks for sensitive data in S3, you have findings in three different consoles, and AWS Security Hub brings them together, correlates them and sorts them by priority. The part of Security Hub that checks your account against standards such as CIS, PCI DSS, NIST and AWS best practices is now called AWS Security Hub CSPM. A standard, in this case, is a published list of security rules that an account should meet. For example, the store's team opens a single screen in Security Hub every morning and sees the most serious finding first, without having to go into GuardDuty, Inspector and Macie separately.

Match each service with what it does

0 of 6 pairs

Tap a service and then what it does.

0 of 6 pairs.

Accounts with the new experience

AWS WAF is available from the free plan of the new experience. AWS Shield, Amazon GuardDuty, AWS Security Hub and Amazon Macie, on the other hand, are on the list of services that aren't available until you turn on the advanced features, and Amazon Inspector doesn't appear on any of that experience's lists. To practice with these services you need a full account. For example, in an account with the new experience you can create WAF rules to practice, but to see GuardDuty findings you have to turn on the advanced features or use a full account.

On the exam

Questions on this topic describe an attack or a problem and ask you to choose the service that blocks or detects it. For example, if the question talks about an unpatched software package on an instance, the answer is Inspector, because it is a gap and not an attack in progress. These words in the question point to the answer:

Words in the question Answer
DDoS, no cost and automatic AWS Shield Standard
Response team, advanced DDoS protection AWS Shield Advanced
Rules on web requests, SQL injection, blocking IP addresses AWS WAF
Malicious activity, threats, compromised credentials Amazon GuardDuty
Vulnerabilities, unpatched software Amazon Inspector
Seeing the findings of several services in a single place AWS Security Hub

Review question

A company wants to know whether someone is using credentials from its AWS account from IP addresses known for malicious activity. Which service does it use?

Next