-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Policy AC_GCP_0296 - Service Attachment with ACCEPT_AUTOMATIC (#1147
) GCP service attachments provide a way to share a single service cross project and VPC boundaries. Since all examples show for ease of use the connection preference `ACCEPT_AUTOMATIC` it's easy to go to production with working but insecure setups. Use `ACCEPT_MANUAL` and define the projects you would like to allow to connect with a private service connect is the safe way.
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
pkg/policies/opa/rego/gcp/google_compute_service_attachment/accurics.gcp.NS.134.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "serviceAttachmentAcceptAutomatic", | ||
"file": "serviceAttachmentAcceptAutomatic.rego", | ||
"policy_type": "gcp", | ||
"resource_type": "google_compute_service_attachment", | ||
"template_args": null, | ||
"severity": "MEDIUM", | ||
"description": "Service Attachment with connection_preference ACCEPT_AUTOMATIC allow any project to connect.", | ||
"reference_id": "accurics.gcp.NS.134", | ||
"category": "Infrastructure Security", | ||
"version": 2, | ||
"id": "AC_GCP_0296" | ||
} |
6 changes: 6 additions & 0 deletions
6
...cies/opa/rego/gcp/google_compute_service_attachment/serviceAttachmentAcceptAutomatic.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package accurics | ||
|
||
serviceAttachmentAcceptAutomatic[saconf.id] { | ||
saconf := input.google_compute_service_attachment[_] | ||
saconf.config.connection_preference == "ACCEPT_AUTOMATIC" | ||
} |