You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This repository walks you through a scenario covering threat detection and remed
4
4
5
5
### Prerequisites
6
6
7
-
***AWS Account**: Given that you will be simulating attacks and doing remediations, you should run this in a non-production account. After running through these scenarios, you can look at how you can implement GuardDuty and associated remediations in a multi-account structure so you are able to aggregate findings from other accounts and use the service in a more productionized manner.
7
+
***AWS Account**: Given that you will be simulating attacks and doing remediations, you should run this in a non-production account. After running through these scenarios, you can look at how you can implement GuardDuty and associated automated remediation workflows in a multi-account structure so you are able to aggregate findings from other accounts and use the service in a more productionized manner.
8
8
***Admin Privileges**: Ensure you are using an AWS IAM User with Admin privileges.
9
9
***AWS CLI**: You will be using the AWS CLI for simulating one of the attacks so be sure you have installed on your local machine.
10
10
@@ -57,32 +57,32 @@ There are certain findings that will require a baseline (7 - 14 days) to be esta
57
57
58
58
## Deploy the Environment <aname="deploy"/>
59
59
60
-
To initiate the scenarios and begin generating GuardDuty findings you need to run the provided CloudFormation template.
60
+
To initiate the scenarios and begin generating GuardDuty findings run the provided CloudFormation template.
61
61
62
62
Region| Deploy
63
63
------|-----
64
-
US West 2 (Oregon) | [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=GuardDuty-Example&templateURL=https://s3-us-west-2.amazonaws.com/sa-security-specialist-workshops-us-west-2/guardduty-hands-on/guardduty-cfn-template.yml)
64
+
US West 2 (Oregon) | [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=GuardDuty-Hands-On&templateURL=https://s3-us-west-2.amazonaws.com/sa-security-specialist-workshops-us-west-2/guardduty-hands-on/guardduty-cfn-template.yml)
65
65
66
-
1. Click the **Deploy to AWS** button above. This will automatically take you to the AWS Management Console to run the template (in us-west-2). If you prefer, you can also just use the template found in this repo (guardduty-cfn-template.yml).
66
+
1. Click the **Deploy to AWS** button above. This will automatically take you to the AWS Management Console to run the template. If you prefer, you can also just use the template found in this repo (guardduty-cfn-template.yml).
67
67
2. On the **Specify Details** section enter the necessary parameters as shown below.
68
68

69
69
3. Once you have entered your parameters click **Next**, then **Next** again \(leave everything on this page at the default\).
70
70
4. Finally, acknowledge the template will create IAM roles and click **Create**. This will bring you back to the CloudFormation console. You can refresh the page to see the stack starting to create.
71
71
5. You will get an email from SNS asking you to confirm the Subscription. Confirm this so you can receive email alerts from GuardDuty.
72
72
73
-
The initial findings will begin to show up in GuardDuty about 10 minutes after the CloudFormation stack creation completes.
73
+
The initial findings will begin to show up in GuardDuty 10 minutes after the CloudFormation stack creation completes.
74
74
75
75
### What is Created?
76
76
77
77
The CloudFormation template will create the following resources:
78
-
* Three [Amazon EC2](https://aws.amazon.com/ec2/) Instances (all using a t2.micro instance type)
78
+
* Three [Amazon EC2](https://aws.amazon.com/ec2/) Instances (and supporting network infrastructure)
79
79
* Two Instances that contain the name “*Compromised Instance*”
80
80
* One instance that contains the name “*Malicious Instance*”
81
81
*[AWS IAM Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) For EC2 which will have permissions to SSM Parameter Store and DynamoDB
82
82
* One [Amazon SNS Topic](https://docs.aws.amazon.com/sns/latest/dg/GettingStarted.html) so you will be able to receive notifications
83
83
* Three [AWS CloudWatch Event](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html) rules for triggering the appropriate notification or remediation
84
84
* Two [AWS Lambda](https://aws.amazon.com/lambda/) functions that will be used for remediating findings and will have permissions to modify Security Groups and revoke active IAM Role sessions (on only the IAM Role associated with this scenario)
85
-
*[AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html)values with the IAM temporary security credentials details (only used to easily retrieve credentials for the purposes of this scenario).
85
+
*[AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html)value for storing a fake database password.
86
86
87
87
> Make sure the CloudFormation stack is in a **CREATE_COMPLETE** status before moving on.
88
88
@@ -130,7 +130,7 @@ If you view your local aws credentials file, you should now see an [attacker] pr
130
130
131
131
Now that you have your named profile you can use it to make API calls. Use the commands below to query different services to see what you have access to (don't be surprised if you see some access denied responses):
When Alice setup the hook for notifications she only included certain information about the finding because she had also setup a Lambda function to automatically isolate the instance and send out the details of the remediation. Since the finding has been remediated you decide you still want to take a closer look at the setup Alice currently has in place.
192
+
191
193
### Browse to the GuardDuty Console to Investigate
192
194
193
-
When Alice setup the hook for notifications she only included certain information about the finding because she had also setup a Lambda function to automatically isolate the instance and send out the details of the remediation. Since the finding has been remediated you decide you still want to take a closer look at the setup Alice currently has in place.
194
-
1. Navigate to the [GuardDuty console](https://us-west-2.console.aws.amazon.com/guardduty/home?) and click on **Findings** in the navigation pane on the left.
195
+
> Although you can view the GuardDuty findings in the console, most customers aggregate all of their findings across their regions and accounts to a central security information and event management (SIEM) system for analysis and remediation. A common approach for aggregating these findings is to setup GuardDuty in a [Master/Member](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_accounts.html) relationship and then use a workflow including CloudWatch Event Rules and Lambda Functions to push findings to your SIEM or a centralized logging framework. There are also partner solutions that publish Lambda Function Blueprints to make it easier to consolidate findings.
196
+
197
+
1. Navigate to the [GuardDuty console](https://us-west-2.console.aws.amazon.com/guardduty/home?).
195
198
196
199
> If there is nothing displayed click the refresh button.
197
200
198
-
2. A finding should show up with the text **UnauthorizedAccess:EC2/MaliciousIPCaller.Custom**.
201
+
2. A finding should show up with the type **UnauthorizedAccess:EC2/MaliciousIPCaller.Custom**.
199
202
200
203
> Based on the format you reviewed earlier can you determine the security issue by the finding type?
The finding type indicates that an EC2 instance in your environment is communicating outbound to an IP address included on a [custom threat list](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_upload_lists.html). Click on **Lists** in the left navigation to view the custom threat list Alice added.
205
208
206
-
> GuardDuty uses managed threat intelligence provided by AWS Security and third-party providers, such as ProofPoint and CrowdStike. You can expand the monitoring scope of GuardDuty by configuring it to use your own custom trusted IP lists and threat lists.
209
+
> GuardDuty uses managed threat intelligence provided by AWS Security and third-party providers, such as ProofPoint and CrowdStike. You can expand the monitoring scope of GuardDuty by configuring it to use your own custom trusted IP lists and threat lists. If you setup a Master/Member GuardDuty relationship, users from the Master GuardDuty account can manage trusted IP lists and threats lists and they are inherited by the member accounts. Users from the member accounts are not able to modify the lists.
210
+
211
+
Users from master GuardDuty accounts can upload and manage trusted IP lists and threat lists. Users from member GuardDuty accounts CANNOT upload and manage lists. Trusted IP lists and threat lists that are uploaded by the master account are imposed on GuardDuty functionality in its member accounts.
207
212
208
213
**Scenario Notes:**
209
214
* The EC2 instance indicated by this finding is actually just connecting to an [Elastic IP](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) (EIP) on another instance in the same VPC to keep the scenario localized to your environment. The CloudFormation template automatically created the threat list and added the EIP for the malicious instance to the list.
210
215
211
216
### View the CloudWatch Event Rule
212
217
213
-
Alice used CloudWatch Event Rules to send the email you received about the findings and also to take remediations steps. Next, you decide to examine the CloudWatch Events console to understand what Alice configured and to see how the remediation was triggered.
218
+
Alice used CloudWatch Event Rules to send the email you received about the findings and also to take remediations steps. Examine the CloudWatch Events console to understand what Alice configured and to see how the remediation was triggered.
214
219
215
220
1. Navigate to the [CloudWatch console](https://us-west-2.console.aws.amazon.com/cloudwatch/home?) and on the left navigation, under the **Events** section, click **Rules**.
216
221
@@ -230,7 +235,7 @@ The Lambda function is what handles the remediation logic for this finding. Alic
Scroll down to view the code for this function (walking through the code logic is outside the scope of this scenario). You can also click the **Monitoring** tab and view the invocation of the function.
238
+
Scroll down to view the code for this function (walking through the code logic is outside the scope of this scenario). You can also click the **Monitoring** tab and view the invocation details for this function.
234
239
235
240
> What permissions does the Lambda Function need to perform the remediation?
236
241
@@ -247,51 +252,46 @@ Next, double check the effects of the remediation to ensure the instance is isol
3. After reviewing the remediation Lambda Function you know that the instance should now have the Security Group with a name that starts with **GuardDuty-Example-ForensicSecurityGroup**. Under the **Description** tab verify the instance has this security group.
255
+
3. After reviewing the remediation Lambda Function you know that the instance should now have the Security Group with a name that includes **ForensicSecurityGroup**. Under the **Description** tab verify the instance has this security group.
251
256
252
-
> Initially, all three of the instances launched by the CloudFormation template were in the Security Group that starts with the name **GuardDuty-Example-TargetSecurityGroup**. The Lambda function removed this one instance from the TargetSecurityGroup and added it to the ForensicsSecurityGroup to isolate the instance.
257
+
> Initially, all three of the instances launched by the CloudFormation template were in the Security Group with a name that includes **TargetSecurityGroup**. The Lambda function removed the TargetSecurityGroup from the instance and added the ForensicsSecurityGroup to isolate the instance.
253
258
254
-
4. Click on the **GuardDuty-Example-ForensicSecurityGroup** and view the ingress and egress rules.
259
+
4. Click on the **ForensicSecurityGroup** and view the ingress and egress rules.
255
260
256
261
### Questions
257
-
258
-
After running through Alice's remediation workflow for this particular you start thinking about the following questions:
259
262
* Which data source did GuardDuty use to identity this threat?
260
-
* What would you change about the automated remediation Alice put in place?
261
263
* Will isolating the instance have any effect on an application running on the instance?
262
-
* Were the alerts detailed enough?
264
+
* How could you add more detail to the email notifications?
263
265
264
266
## Scenario 2 – Compromised IAM Credentials (Simulated) <a name="attack2"/>
265
267
266
-
You have completed the examination of the first attack, confirmed it was properly remediated, and then sat back to take your first sip of coffee for the day when you notice an additional email about new findings. The first of the new findings indicates that an API call was made using IAM credentials from your AWS account from a malicious IP address.
268
+
You have completed the examination of the first attack, confirmed it was properly remediated, and then sat back to take your first sip of coffee for the day when you notice an additional email about new findings. The first of the new findings indicates that an API call was made using AWS IAM credentials from an IP address on a custom threat list.
267
269
268
270
**Scenario Note**:
269
-
* None of your IAM credentials have actually been compromised or exposed in any way. The finding is the result of an EC2 instance using an IAM Role for EC2 and with an EIP that is in the custom threat list making API calls on your behalf.
271
+
* None of your IAM credentials have actually been compromised or exposed in any way. The finding is the result of an EC2 instance using an IAM Users credentials to make API calls and the EIP for the instance is on your custom threat list.
270
272
271
273
### Diagram of the Simulated Attack and Detection
272
274
273
275

274
276
275
277
### Browse to the GuardDuty Console to Investigate
276
278
277
-
> Although you can view the GuardDuty findings in the console, most customers aggregate all of their findings across their accounts and regions to a central security information and event management (SIEM) system for analysis and remediation. A common approach for aggregating these findings is to setup GuardDuty in a [Master/Member](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_accounts.html) relationship and then use a workflow including CloudWatch Event Rules and Lambda Functions to push findings to your SIEM or a centralized logging framework. There are also partner solutions that publish Lambda Function Blueprints to make it easier to consolidate findings.
278
-
279
279
To view the findings:
280
280
281
-
1. Navigate to the [GuardDuty console](https://us-west-2.console.aws.amazon.com/guardduty/home?) and then, in the navigation pane on the left, choose **Current**.
282
-
2. Click the  icon to refresh the GuardDuty console. You should now see additional findings that related to **Recon:IAMUser** and **UnauthorizedAccess:IAMUser**.
281
+
1. Navigate to the [GuardDuty console](https://us-west-2.console.aws.amazon.com/guardduty/home?).
282
+
2. Click the  icon to refresh the GuardDuty console. You should now see additional findings that are related to **Recon:IAMUser** and **UnauthorizedAccess:IAMUser**.
283
283
284
-
> Based on the format you reviewed earlier can you determine the security issue by the finding type?
284
+
> Based on the format you reviewed earlier can you determine the security issues by the finding type?
285
285
286
-
3. Click on the **UnauthorizedAccess:IAMUser** finding to view the full details.
286
+
3. Click on the **UnauthorizedAccess:IAMUser/MaliciousIPCaller.Custom** finding to view the full details.
You can see the finding details include information about what happened, what AWS resources were involved in the suspicious activity, when this activity took place, and other additional information. Under **Resource Affected**, find the name of AWS IAM **User Name** associated with this finding.
290
+
You can see the finding details include information about what happened, what AWS resources were involved in the suspicious activity, when this activity took place, and other additional information. Under **Resource Affected**, find the **User Name** associated with this finding.
291
291
292
292
This finding indicates that the IAM credentials (of the user you found above) are possibly compromised because API calls using those credentials are being made from an IP address on a custom threat list.
293
293
294
-
> What actions did this AWS IAM User take? You can see under **Action** and then **API** that a **GetParameters** API call but how you view the rest of the actions this user made over the past hour or day? GuardDuty is able to analyze large volumes of data and identity true threats in your environment but from investigation and remediation stand point it is still important to correlate other data to understand the full scope of the threat. In this case an analyst would use the details in this finding to pinpoint historical user activity in CloudTrail.
294
+
> What actions did this AWS IAM User take? You can see under **Action** and then **API** that a **GetParameters** API call was made but how can you view the rest of the actions made by this user over the past hour or day? GuardDuty is able to analyze large volumes of data and identity true threats in your environment but from an investigation and remediation stand point it is still important to correlate other data to understand the full scope of the threat. In this case an analyst would use the details in this finding to pinpoint historical user activity in CloudTrail.
295
295
296
296
**Scenario Note**:
297
297
* These IAM findings are being generated by the “malicious EC2” instance making API calls. These API calls generate findings because the EIP of that instance is in a custom threat list.
0 commit comments