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
This Github action identifies insecure configurations in Infrastructure as Code (IaC) files for Google Cloud resources.
6
-
This action requires Terraform plan files in JSON format for scanning.
6
+
7
+
This GitHub action identifies insecure configurations in Infrastructure as Code (IaC) files for Google Cloud resources. This action requires Terraform plan files in JSON format for scanning.
8
+
7
9
8
10
Use this action to detect and remediate issues in IaC files for Google Cloud before you deploy the resources.
9
11
12
+
10
13
This action lets you:
11
14
- Scan IaC template files (such as Terraform plan files).
12
15
- Display issues with their severity as a SARIF Report in the GitHub Workspace after a scan completes.
13
16
- Define severity-based failure criteria for passing or failing the build.
14
17
15
-
> [!NOTE]
16
-
> This is a Security Command Center Premium tier offering for subscription customers only. You must activate the Security Command Center Premium tier in the Google Cloud organization to use this feature.
17
-
18
18
**This is not an officially supported Google product, and it is not covered by a
19
19
Google Cloud support contract. To report bugs or request features in a Google
20
20
Cloud product, please contact [Google Cloud
21
21
support](https://cloud.google.com/support).**
22
22
23
+
> [!IMPORTANT]
24
+
> This is a Security Command Center Premium tier offering for subscription customers only. You must activate the Security Command Center Premium tier in the Google Cloud organization to use this feature.
25
+
>
26
+
> This offering is covered by the Pre-GA Offerings Terms of the Google Cloud Terms of Service.
27
+
28
+
> [!CAUTION]
29
+
> Don’t enter any sensitive information such as passwords and other personal identifiable information in the Terraform plan files.
30
+
23
31
## Prerequisites
24
32
25
-
- This action requires a Google Cloud service account which has the
26
-
**Security Posture Shift-Left Validator** role or the **Security
27
-
Posture Admin** role on the Google Cloud organization that includes
28
-
the IaC resources. For more information, see [Authorization](#authorization).
29
33
30
-
- This action runs using Node 20. If you are using self-hosted GitHub Actions
31
-
runners, you must use a [runner
32
-
version](https://github.com/actions/virtual-environments) that supports this
33
-
version or later.
34
+
* This action requires a Google Cloud service account which has the **Security Posture Shift-Left Validator** role or the **Security Posture Admin** role on the Google Cloud organization that includes the IaC resources. For more information, see [Authorization](#authorization).
35
+
36
+
37
+
* This action runs using Node 20. If you are using self-hosted GitHub Actions
38
+
runners, you must use a [runner
39
+
version](https://github.com/actions/virtual-environments) that supports this
- `organization_id`: (Required) The Google Cloud organization ID for the
74
-
organization which includes the resources that you want to modify.
75
86
76
-
- `scan_file_ref`: (Required) The absolute file path, including the file name,
77
-
for the IaC file in the workspace. For example: './tf_plan.json', or
78
-
'./artifacts/tf_plan.json'.
87
+
* `organization_id`: (Required) The Google Cloud organization ID for the organization which includes the resources that you want to modify.
88
+
89
+
90
+
* `scan_file_ref`: (Required) The absolute file path, including the file name, for the IaC file in the workspace. For example: './tf_plan.json', or './artifacts/tf_plan.json'.
91
+
92
+
93
+
* `iac_type`: (Required) The IaC template type. Currently only Terraform is supported.
79
94
80
-
- `iac_type`: (Required) The IaC template type. Currently only Terraform is
81
-
supported.
82
95
83
-
- `iac_version`: (Required) The IaC template version. For example: '1.6.6',
84
-
or '1.6.5'.
96
+
* `iac_version`: (Required) The IaC template version. For example: '1.6.6', or '1.6.5'.
85
97
86
-
- `scan_timeout`: (Optional) The maximum time before the action stops.
87
-
The time must be between '1m' and '10m'. The default is `1m`.
88
98
89
-
- `ignore_violations`: (Optional) Whether violations found in IaC file
90
-
should be ignored when determining the build status. This input doesn’t
91
-
apply to violations that are related to generating SARIF reports and
92
-
determining the `iac_scan_result`. The default is `false`.
99
+
* `scan_time_out`: (Optional) The maximum time before the action stops. The time must be between '1m' and '10m'. The default is `1m`.
93
100
94
-
- `failure_criteria`: (Optional) The failure criteria that determines the
95
-
workflow build status. You can set a threshold for the number of critical,
96
-
high, medium, and low severity issues and use an aggregator (either `and`
97
-
or `or`) to evaluate the criteria. To determine whether a build has failed,
98
-
the threshold for each severity is evaluated against the count of issues
99
-
with that severity in the IaC scan results and then severity level evaluations
100
-
are aggregated using `AND` or `OR` to arrive at `failure_criteria` value.
101
101
102
-
If the `failure_criteria` evaluates to `true`, the workflow is marked as
103
-
`FAILED`. Otherwise, the workflow is marked as `SUCCESS`. The default is
* `ignore_violations`: (Optional) Whether violations found in IaC file should be ignored when determining the build status. This input doesn’t apply to violations that are related to generating SARIF reports and determining the `iac_scan_result`. The default is `false`.
103
+
104
+
105
+
* `failure_criteria`: (Optional) The failure criteria that determines the workflow build status. You can set a threshold for the number of critical, high, medium, and low severity issues and use an aggregator (either `and` or `or`) to evaluate the criteria. To determine whether a build has failed, the threshold for each severity is evaluated against the count of issues with that severity in the IaC scan results and then severity level evaluations are aggregated using `AND` or `OR` to arrive at `failure_criteria` value.
106
+
107
+
108
+
If the `failure_criteria` evaluates to `true`, the workflow is marked as `FAILED`. Otherwise, the workflow is marked as `SUCCESS`. The default is "Critical:1, High:1, Medium:1, Low:1, Operator:or".
109
+
110
+
111
+
* `fail_silently`: (Optional) Whether the workflow passes when an internal error (such as an invalid credential or plugin dependency failure) occurs. Note: The action always fails when the input is invalid. The default is `false`.
105
112
106
-
- `fail_silently`: (Optional) If set to true, workflow will not fail in case
107
-
of any internal error including invalid credentials and plugin dependency
108
-
failure. Note: Action will always fail in case of any input validation
109
-
failure. Default: false.
110
113
111
114
## Outputs
112
115
113
-
- `iac_scan_result`: The result of the security scan. One of:
114
116
115
-
1. `passed` - No violations were found or the `failure_criteria` was not
116
-
satisfied.
117
-
2. `failed` - The `failure_criteria` was satisfied.
118
-
3. `error` - The action ran into an execution error, generally
119
-
due to a misconfiguration or invalid credentials.
117
+
* `iac_scan_result`: The result of the security scan. One of:
118
+
1. `passed` - No violations were found or the `failure_criteria` was not satisfied.
119
+
2. `failed` - The `failure_criteria` was satisfied.
120
+
3. `error` - The action ran into an execution error, generally due to a misconfiguration or invalid credentials.
121
+
122
+
123
+
* `iac_scan_result_sarif_path`: The path for the SARIF report file. This file is only available when violations are found in the scan file.
120
124
121
-
- `iac_scan_result_sarif_path`: The path for the SARIF report file. This
122
-
file is only available when violations are found in the scan file.
123
125
124
126
## Authorization
125
127
128
+
126
129
Use [google-github-actions/auth](https://github.com/google-github-actions/auth)
127
130
to authenticate the action. You can use [Workload Identity Federation][wif] or
128
-
traditional [Service Account Key JSON][sa] for authentication.
131
+
[Service account key JSON][sa] for authentication.
For information about supported asset types and policies, see [IaC Validation - Supported assets and policies](https://www.gstatic.com/cloud_security_posture/iac_validation_supported_assets_and_policies.pdf).
0 commit comments