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
While the rest of the infrastructure deployed via the Terraform resources is ready to go as soon as `make terraform-demo` is finished, you will need to do some manual follow-up steps in ACM PCA for the demo to work.
4
+
5
+
Follow the steps below to activate the PCA. After following these steps, you can successfully perform the Resource Exposure activities.
6
+
7
+
## Create Terraform Resources
8
+
9
+
* Run the Terraform code to generate the example AWS resources.
10
+
11
+
```bash
12
+
make terraform-demo
13
+
```
14
+
15
+
## Follow-up steps to activate ACM PCA
16
+
17
+
18
+
The ACM Private Certificate Authority will have been created - but you won't be able to use it yet. Per [the Terraform docs on [aws_acmpca_certificate_authority](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acmpca_certificate_authority), "Creating this resource will leave the certificate authority in a `PENDING_CERTIFICATE status`, which means it cannot yet issue certificates."
19
+
20
+
* To solve this, navigate to the AWS Console in the selected region. Observe how the certificate authority is in the `PENDING_CERTIFICATE` status, as shown in the image below.
Copy file name to clipboardexpand all lines: docs/risks/acm-pca.md
+2-26
Original file line number
Diff line number
Diff line change
@@ -2,31 +2,7 @@
2
2
3
3
## Steps to Reproduce
4
4
5
-
First, set up the demo resources. Then you can follow the exposure steps.
6
-
7
-
### Setting up the demo resources
8
-
9
-
* Run the Terraform code to generate the example AWS resources.
10
-
11
-
```bash
12
-
make terraform-demo
13
-
```
14
-
15
-
The ACM Private Certificate Authority will have been created - but you won't be able to use it yet. Per [the Terraform docs on [aws_acmpca_certificate_authority](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acmpca_certificate_authority), "Creating this resource will leave the certificate authority in a `PENDING_CERTIFICATE status`, which means it cannot yet issue certificates."
16
-
17
-
* To solve this, navigate to the AWS Console in the selected region. Observe how the certificate authority is in the `PENDING_CERTIFICATE` status, as shown in the image below.
* Select "Install a CA Certificate to activate your CA", as shown in the image above, marked by the **red box**.
22
-
23
-
* A wizard will pop up. Use the default settings and hit **"Next"**, then **"Confirm and Install"**.
24
-
25
-
* Observe that your root CA certificate was installed successfully, and that the STATUS of the CA is ACTIVE and able to issue private certificates.
26
-
27
-
.. and now you are ready to pwn that root certificate with this tool 😈
28
-
29
-
### Exposure Steps
5
+
* ‼️ If you are using the Terraform demo infrastructure, you must take some follow-up steps after provisioning the resources in order to be able to expose the demo resource. This is due to how ACM PCA works. For instructions, see the [Appendix on ACM PCA Activation](../appendices/acm-pca-activation.md)
30
6
31
7
* To expose the resource using `endgame`, run the following from the victim account:
> ‼️ **Note**: At the time of this writing, AWS Access Analyzer does **NOT** support auditing of this resource type to prevent resource exposure. **We kindly suggest to the AWS Team that they support all resources that can be attacked using this tool**. 😊
@@ -25,4 +57,5 @@ Also, consider using [Cloudsplaining](https://github.com/salesforce/cloudsplaini
Copy file name to clipboardexpand all lines: docs/risks/ebs.md
+52
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,61 @@
2
2
3
3
## Steps to Reproduce
4
4
5
+
* To expose the resource using `endgame`, run the following from the victim account:
6
+
7
+
```bash
8
+
export EVIL_PRINCIPAL=*
9
+
export SNAPSHOT_ID=snap-1234567890abcdef0
10
+
11
+
endgame expose --service ebs --name $SNAPSHOT_ID
12
+
```
13
+
14
+
* To expose the resource using the AWS CLI, run the following from the victim account:
15
+
16
+
```bash
17
+
export SNAPSHOT_ID=snap-1234567890abcdef0
18
+
19
+
aws ec2 modify-snapshot-attribute \
20
+
--snapshot-id $SNAPSHOT_ID \
21
+
--attribute createVolumePermission \
22
+
--operation-type add \
23
+
--group-names all
24
+
```
25
+
26
+
* To verify that the snapshot has been shared with the public, run the following from the victim account:
27
+
28
+
```bash
29
+
export SNAPSHOT_ID=snap-1234567890abcdef0
30
+
31
+
aws ec2 describe-snapshot-attribute \
32
+
--snapshot-id $SNAPSHOT_ID \
33
+
--attribute createVolumePermission
34
+
```
35
+
36
+
* Observe that the contents match the example shown below.
37
+
5
38
## Example
6
39
40
+
The response of `aws ec2 describe-snapshot-attribute` will match the below, indicating that the EBS snapshot is public.
41
+
42
+
```json
43
+
{
44
+
"SnapshotId": "snap-066877671789bd71b",
45
+
"CreateVolumePermissions": [
46
+
{
47
+
"Group": "all"
48
+
}
49
+
]
50
+
}
51
+
```
52
+
7
53
## Exploitation
8
54
55
+
After an EBS Snapshot is made public, an attacker can then:
56
+
*[copy the public snapshot](https://docs.aws.amazon.com/cli/latest/reference/ec2/copy-snapshot.html) to their own account
57
+
* Use the snapshot to create an EBS volume
58
+
* Attach the EBS volume to their own EC2 instance and browse the contents of the disk, potentially revealing sensitive or otherwise non-public information.
59
+
9
60
## Remediation
10
61
11
62
> ‼️ **Note**: At the time of this writing, AWS Access Analyzer does **NOT** support auditing of this resource type to prevent resource exposure. **We kindly suggest to the AWS Team that they support all resources that can be attacked using this tool**. 😊
@@ -23,3 +74,4 @@ Also, consider using [Cloudsplaining](https://github.com/salesforce/cloudsplaini
23
74
24
75
*[Sharing an Unencrypted Snapshot using the Console](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html#share-unencrypted-snapshot)
25
76
*[Share a snapshot using the command line](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html)
Copy file name to clipboardexpand all lines: docs/risks/ec2-amis.md
+46-1
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,54 @@
2
2
3
3
## Steps to Reproduce
4
4
5
+
* To expose the resource using `endgame`, run the following from the victim account:
6
+
7
+
```bash
8
+
export EVIL_PRINCIPAL=*
9
+
export IMAGE_ID=ami-5731123e
10
+
11
+
endgame expose --service ebs --name $SNAPSHOT_ID
12
+
```
13
+
14
+
* To expose the resource using AWS CLI, run the following from the victim account:
15
+
16
+
```bash
17
+
aws ec2 modify-image-attribute \
18
+
--image-id ami-5731123e \
19
+
--launch-permission "Add=[{Group=all}]"
20
+
```
21
+
22
+
* To validate that the resource has been shared publicly, run the following:
23
+
24
+
```bash
25
+
aws ec2 describe-image-attribute \
26
+
--image-id ami-5731123e \
27
+
--attribute launchPermission
28
+
```
29
+
30
+
* Observe that the contents of the exposed AMI match the example shown below.
31
+
5
32
## Example
6
33
34
+
The output of `aws ec2 describe-image-attribute` reveals that the AMI is public if the value of "Group" under "LaunchPermissions" is equal to "all"
35
+
36
+
```
37
+
{
38
+
"LaunchPermissions": [
39
+
{
40
+
"Group": "all"
41
+
}
42
+
],
43
+
"ImageId": "ami-5731123e",
44
+
}
45
+
```
46
+
7
47
## Exploitation
8
48
49
+
After an EC2 AMI is made public, an attacker can then:
50
+
*[Copy the AMI](https://docs.aws.amazon.com/cli/latest/reference/ec2/copy-image.html) into their own account
51
+
* Launch an EC2 instance using that AMI and browse the contents of the disk, potentially revealing sensitive or otherwise non-public information.
52
+
9
53
## Remediation
10
54
11
55
> ‼️ **Note**: At the time of this writing, AWS Access Analyzer does **NOT** support auditing of this resource type to prevent resource exposure. **We kindly suggest to the AWS Team that they support all resources that can be attacked using this tool**. 😊
@@ -21,4 +65,5 @@ Also, consider using [Cloudsplaining](https://github.com/salesforce/cloudsplaini
* To view the contents of the exposed resource policy, run the following:
40
+
41
+
```bash
42
+
aws ecr get-repository-policy \
43
+
--repository-name test-resource-exposure
44
+
```
45
+
46
+
* Observe that the contents match the example shown below.
47
+
48
+
5
49
## Example
6
50
51
+
The policy shown below shows a policy that grants access to Principal `*`. If the output contains `*` in Principal, that means the ECR repository is public. If the Principal contains just an account ID, that means it is shared with another account.
> ‼️ **Note**: At the time of this writing, AWS Access Analyzer does **NOT** support auditing of this resource type to prevent resource exposure. **We kindly suggest to the AWS Team that they support all resources that can be attacked using this tool**. 😊
0 commit comments