Skip to content

Conversation

@cx-ricardo-jesus
Copy link
Contributor

Reason for Proposed Changes

  • Currently, no query for Terraform/GCP ensures that the essential contacts are configured for an organization.

Proposed Changes

  • On this query there is only one policy, that uses the contacts_not_configured_for_org helper function.
  • The helper function uses other two helper functions called is_at_organization_level and all_in_list and returns true if the field parent is defined in a certain way that indicates that the resource is on a organization level and if the field notification_category_subscriptions does not have the value ALL defined or all the following values defined: LEGAL, SECURITY, SUSPENSION and TECHNICAL. These are the value that have to be defined to ensure that the essential contacts are configured, according to the respective CIS Workbeck documentation.
  • The helper function check's if the field parent points to an organization using two different notations. The first one is RESOURCE_TYPE/RESOURCE_ID with the RESOURCE_TYPE that can be defined with the values projects, folders, or organizations, defined with the value organization, in order to stay in the scope of the query. This information was found on the following Google Cloud documentation.
  • After further research, I found other way of defining this field that is by, pointing to a data source of type google_organization using the name defined for the data source, which, in all the examples that I found on my research, with the following syntax: data.<DATA_SOURCE_TYPE>.<DATA_SOURCE_NAME>.(id|org|name|...).
  • On the metadata of the query, I think that the most suitable CWE is the one with the number 862 - Missing Authorization.

I submit this contribution under the Apache-2.0 license.

@cx-ricardo-jesus cx-ricardo-jesus requested a review from a team as a code owner November 10, 2025 22:13
@github-actions github-actions bot added feature New feature query New query feature terraform Terraform query gcp PR related with GCP Cloud labels Nov 10, 2025
@github-actions
Copy link
Contributor

kics-logo

KICS version: v2.1.13

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 47
Queries failed to execute placeholder 0
Execution time placeholder 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature gcp PR related with GCP Cloud query New query feature terraform Terraform query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant