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
* added directions to README and Walkthough to create a json result and looad into Heimdall Lite
* added default dummy value for the project_id
* fixed indent issues in inspec.yml
* fixed markdown syntax in README
Signed-off-by: Aaron Lippold <lippold@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+85-66Lines changed: 85 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,27 +10,41 @@ This is not an officially supported Google product. This code is intended to hel
10
10
11
11
The following GCP CIS v1.1.0 Benchmark Controls are not covered:
12
12
13
-
* Identity and Access Management 1.2 - "Ensure that multi-factor authentication is enabled for all non-service accounts"
14
-
* Identity and Access Management 1.3 - "Ensure that Security Key Enforcement is enabled for all admin accounts"
15
-
* Identity and Access Management 1.12 - "Ensure API keys are not created for a project"
16
-
* Identity and Access Management 1.13 - "Ensure API keys are restricted to use by only specified Hosts and Apps"
17
-
* Identity and Access Management 1.14 - "Ensure API keys are restricted to only APIs that application needs access"
18
-
* Identity and Access Management 1.15 - "Ensure API keys are rotated every 90 days"
19
-
* Cloud SQL Database Services 6.3 - "Ensure that MySql database instance does not allow anyone to connect with administrative privileges"
20
-
* Cloud SQL Database Services 6.4 - "Ensure that MySQL Database Instance does not allows root login from any Host"
13
+
- Identity and Access Management 1.2 - "Ensure that multi-factor authentication is enabled for all non-service accounts"
14
+
- Identity and Access Management 1.3 - "Ensure that Security Key Enforcement is enabled for all admin accounts"
15
+
- Identity and Access Management 1.12 - "Ensure API keys are not created for a project"
16
+
- Identity and Access Management 1.13 - "Ensure API keys are restricted to use by only specified Hosts and Apps"
17
+
- Identity and Access Management 1.14 - "Ensure API keys are restricted to only APIs that application needs access"
18
+
- Identity and Access Management 1.15 - "Ensure API keys are rotated every 90 days"
19
+
- Cloud SQL Database Services 6.3 - "Ensure that MySql database instance does not allow anyone to connect with administrative privileges"
20
+
- Cloud SQL Database Services 6.4 - "Ensure that MySQL Database Instance does not allows root login from any Host"
21
21
22
22
## Usage
23
23
24
-
### Profile Attributes
24
+
### Profile Inputs (see `inspec.yml` file)
25
25
26
-
***gcp_project_id** - (Default: "", type: string) - The target GCP Project that must be specified.
27
-
***sa_key_older_than_seconds** - (Default: 7776000, type: int, CIS IAM 1.15) - The maximum allowed age of GCP User-managed Service Account Keys (90 days in seconds).
28
-
***kms_rotation_period_seconds** - (Default: 7776000, type: int, CIS IAM 1.10) - The maximum allowed age of KMS keys (90 days in seconds).
26
+
This profile uses InSpec Inputs to make the tests more flexible. You are able to provide inputs at runtime either via the `cli` or via `YAML files` to help the profile work best in your deployment.
29
27
28
+
**pro tip**: Do not change the inputs in the `inspec.yml` file directly, either:
29
+
30
+
- update them via the cli - via the `--input` flag
31
+
- pass them in via a YAML file as shown in the `Example` - via the `--input-file` flag
32
+
33
+
Further details can be found here: <https://docs.chef.io/inspec/inputs/>
34
+
35
+
### (Required) User Provided Inputs - via the CLI or Input Files
36
+
37
+
-**gcp_project_id** - (Default: null, type: String) - The target GCP Project you are scanning.
38
+
39
+
### (Optional) User Provided Inputs
40
+
41
+
-**bucket_logging_ignore_regex** - (type: String) - Ignore this bucket by regex from requiring logging to be enabled. Example: `-logging`
42
+
-**sa_key_older_than_seconds** - (Default: 7776000, type: int, CIS IAM 1.15) - The maximum allowed age of GCP User-managed Service Account Keys (90 days in seconds).
43
+
-**kms_rotation_period_seconds** - (Default: 7776000, type: int, CIS IAM 1.10) - The maximum allowed age of KMS keys (90 days in seconds).
30
44
31
45
### Cloud Shell Walkthrough
32
46
33
-
Use this Cloud Shell walkthrough for a hands-on example.
47
+
Use this Cloud Shell Walkthrough for a hands-on example.
34
48
35
49
[](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/inspec-gcp-cis-benchmark&page=editor&tutorial=walkthrough.md)
This guide will show you how to install InSpec on your Cloud Shell instance and how to use InSpec to check the infrastructure in your Google Cloud Project against the CIS GCP Benchmark.
7
6
8
7
**Time to complete**: About 5 minutes
9
8
10
9
Click the **Start** button to move to the next step.
11
10
12
-
13
11
## What is InSpec?
14
12
15
13
Before we jump in, let's briefly go over what InSpec can do.
16
14
17
15
[InSpec](https://github.com/inspec/inspec), a popular framework in the DevSecOps community, checks the configuration state of resources within virtual machines, containers, and cloud providers such as GCP, AWS, and Azure. InSpec's lightweight nature, approachable domain specific Language (DSL) and extensibility, make it a valuable tool for:
16
+
18
17
- Expressing compliance policies as code
19
18
- Enabling development teams to add application-specific tests and assess the compliance of their applications to security policies before pushing changes to the production environment.
20
19
- Automating compliance verification in CI/CD pipelines and as part of the release process
21
20
- Unifying compliance assessments across multiple cloud providers and on premises environments
22
21
23
22
Continue on to the next step to start setting up your tutorial.
24
23
25
-
26
-
## Install InSpec
24
+
## Installing InSpec
27
25
28
26
InSpec is distributed as a Ruby gem and your Cloud Shell instance has a Ruby environment already configured. All you need to do is install the InSpec gem:
Test Summary: 107 successful, 88 failures, 7 skipped
64
61
```
@@ -69,10 +66,33 @@ To scan another project, press the Previous button and select a different projec
69
66
70
67
Press Next if you're done scanning projects.
71
68
69
+
## Review your scan results with [Heimdall-Lite](https://heimdall-lite.mitre.org)
70
+
71
+
### What is Heimdall-Lite?
72
+
73
+
Heimdall-Lite is a great open-source Security Results Viewer by the [MITRE Corporation](https://www.mitre.org) for reviewing your GCP CIS Benchmark scan results.
74
+
75
+
Heimdall-Lite is one of many MITRE [Security Automation Framework](https://saf.mitre.org) (SAF) Supporting Tools working to enhance the Security Automation and DevSecOps communities.
76
+
77
+
The [MITRE SAF](https://saf.mitre.org) is an open-source community partnership including Government, Industry and the Open Community working together to make truly automated security a reality. It also hosts many InSpec profiles created by the SAF and references to many partner developed profiles - **_including this one_**.
78
+
79
+
**Tip**: MITRE hosts Heimdall-Lite on GitHub pages, but you can easily run it in your environment via Docker or NPM or whatever suites your need. See the projects GitHub more information.
80
+
81
+
### Download your JSON formatted results
82
+
83
+
1. Right click on your `myscan.json` file
84
+
2. Then select `Download` to save the `{{project-id}}_scan.json` file locally
85
+
86
+
### Go to Heimdall Lite and Load your JSON formatted Results
87
+
88
+
1. Navigate to [Heimdall Lite](https://heimdall-lite.mitre.org)
89
+
2. Click `Local Files` on the left side of the loader
90
+
3. Drag and Drop or select and load your `{{project-id}}_scan.json` file to review your results.
0 commit comments