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
A micro-baseline to check for insecure or public S3 buckets and bucket objects in your AWS Environment. This [InSpec](https://github.com/chef/inspec) compliance profile verifies that you do not have any insure or open to public S3 Bucket or Bucket Objects in your AWS Environment in an automated way.
4
4
5
-
NOTE: Small Word of Warning
5
+
#### Warning: Large amounts of Bucket Objects
6
6
7
-
In this InSpec profile implementation, the `s3-objects-no-public-access` control iterates through and verifies every objects in each bucket in your AWS Environment, thus its runtime will depend on the number of objects in your S3 Buckets.
7
+
The `s3-objects-no-public-access` control iterates through and verifies every objects in each bucket in your AWS Environment, thus its runtime will depend on the number of objects in your S3 Buckets.
8
+
9
+
If you have buckets with large numbers of objects, we suggest you script a loop and use the `single_bucket` input to parallelize the workload.
10
+
11
+
Then you can load all your HDF JSON results into [Heimdall Lite](https://heimdall-lite.mitre.org) to easily review all your scan results.
8
12
9
13
## Getting Started
10
-
It is intended and recommended that InSpec and this profile be run from a __"runner"__ host (such as a DevOps orchestration server, an administrative management system, or a developer's workstation/laptop) against the target remotely over __AWS CLI__.
11
14
12
-
__For the best security of the runner, always install on the runner the _latest version_ of InSpec and supporting Ruby language components.__
15
+
It is intended and recommended that InSpec and this profile be run from a **"runner"** host (such as a DevOps orchestration server, an administrative management system, or a developer's workstation/laptop) against the target remotely over **AWS CLI**.
16
+
17
+
**For the best security of the runner, always install on the runner the _latest version_ of InSpec and supporting Ruby language components.**
13
18
14
19
The latest versions and installation options are available at the [InSpec](http://inspec.io/) site.
15
20
@@ -26,27 +31,38 @@ You will need to ensure your AWS CLI environment has the right system environmen
26
31
27
32
### Notes on MFA
28
33
29
-
In any AWS MFA enabled environment - you need to use `derived credentials` to use the CLI. Your default `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` will not satisfy the MFA Policies in AWS environments.
34
+
In any AWS MFA enabled environment - you need to use `derived credentials` to use the CLI. Your default `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` will not satisfy the MFA Policies in AWS environments.
30
35
31
-
- The AWS documentation is here: https://docs.aws.amazon.com/cli/latest/reference/sts/get-session-token.html
32
-
- The AWS profile documentation is here: https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
33
-
- A useful bash script for automating this is here: https://gist.github.com/dinvlad/d1bc0a45419abc277eb86f2d1ce70625
36
+
- The AWS documentation is here: <https://docs.aws.amazon.com/cli/latest/reference/sts/get-session-token.html>
37
+
- The AWS profile documentation is here: <https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html>
38
+
- A useful bash script for automating this is here: <https://gist.github.com/dinvlad/d1bc0a45419abc277eb86f2d1ce70625>
34
39
35
40
To generate credentials using an AWS Profile you will need to use the following AWS CLI commands.
36
41
37
-
a. `aws sts get-session-token --serial-number arn:aws:iam::<$YOUR-MFA-SERIAL> --token-code <$YOUR-CURRENT-MFA-TOKEN> --profile=<$YOUR-AWS-PROFILE>`
42
+
a. `aws sts get-session-token --serial-number arn:aws:iam::<$YOUR-MFA-SERIAL> --token-code <$YOUR-CURRENT-MFA-TOKEN> --profile=<$YOUR-AWS-PROFILE>`
38
43
39
-
b. Then export the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_SESSION_TOKEN` that was generated by the above command.
44
+
b. Then export the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_SESSION_TOKEN` that was generated by the above command.
40
45
41
46
## Tailoring to Your Environment
47
+
42
48
The following inputs must be configured in an inputs ".yml" file for the profile to run correctly for your specific environment. More information about InSpec inputs can be found in the [InSpec Profile Documentation](https://www.inspec.io/docs/reference/profiles/).
43
-
44
-
```
45
-
# Description: List of buckets exempted from inspection.
46
-
exception_bucket_list: []
49
+
50
+
```yaml
51
+
# List of buckets exempted from inspection.
52
+
exception_bucket_list:
53
+
- bucket1
54
+
- bucket2
55
+
...
56
+
57
+
# Test only one bucket
58
+
single_bucket: 'my-bucket'
47
59
```
48
60
49
-
## Usage
61
+
## Note
62
+
63
+
When you use the `single_bucket` input, the profile will _***ONLY scan***_ that bucket.
## Running This Baseline from a local Archive copy
88
+
## Running This Baseline from a local Archive copy
70
89
71
90
If your runner is not always expected to have direct access to GitHub, use the following steps to create an archive bundle of this baseline and all of its dependent tests:
72
91
73
92
(Git is required to clone the InSpec profile using the instructions below. Git can be downloaded from the [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) site.)
74
93
75
-
When the __"runner"__ host uses this profile baseline for the first time, follow these steps:
94
+
When the **"runner"** host uses this profile baseline for the first time, follow these steps:
The JSON results output file can be loaded into __[heimdall-lite](https://heimdall-lite.mitre.org/)__ for a user-interactive, graphical view of the InSpec results.
126
+
The JSON results output file can be loaded into **[heimdall-lite](https://heimdall-lite.mitre.org/)** for a user-interactive, graphical view of the InSpec results.
97
127
98
-
The JSON InSpec results file may also be loaded into a __[full heimdall server](https://github.com/mitre/heimdall)__, allowing for additional functionality such as to store and compare multiple profile runs.
128
+
The JSON InSpec results file may also be loaded into a **[full heimdall server](https://github.com/mitre/heimdall)**, allowing for additional functionality such as to store and compare multiple profile runs.
Approved for Public Release; Distribution Unlimited. Case Number 18-3678.
115
145
116
-
### NOTICE
146
+
### NOTICE
117
147
118
148
MITRE hereby grants express written permission to use, reproduce, distribute, modify, and otherwise leverage this software to the extent permitted by the licensed terms provided in the LICENSE.md file included with this project.
119
149
120
-
### NOTICE
150
+
### NOTICE
121
151
122
-
This software was produced for the U. S. Government under Contract Number HHSM-500-2012-00008I, and is subject to Federal Acquisition Regulation Clause 52.227-14, Rights in Data-General.
152
+
This software was produced for the U. S. Government under Contract Number HHSM-500-2012-00008I, and is subject to Federal Acquisition Regulation Clause 52.227-14, Rights in Data-General.
123
153
124
154
No other use other than that granted to the U. S. Government, or to those acting on behalf of the U. S. Government under that Clause is authorized without the express written permission of The MITRE Corporation.
125
155
126
-
For further information, please contact The MITRE Corporation, Contracts Management Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000.
156
+
For further information, please contact The MITRE Corporation, Contracts Management Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000.
0 commit comments