Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds initial version of Terraform asset inventory query pack #125

Merged
merged 3 commits into from
Jan 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions core/mondoo-terraform-inventory.mql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright (c) Mondoo, Inc.
# SPDX-License-Identifier: BUSL-1.1

packs:
- uid: mondoo-asset-inventory-terraform
name: Terraform Asset Inventory Pack
version: 1.0.0
license: BUSL-1.1
authors:
- name: Mondoo, Inc
email: [email protected]
tags:
mondoo.com/platform: terraform,
mondoo.com/category: inventory
docs:
desc: |
The Terraform Asset Inventory Pack retrieves information about Terraform HCL, Terraform Plan, and Terraform State for asset inventory.
groups:
- title: Terraform State Asset inventory for AWS
filters: asset.platform == "terraform-state" && terraform.state.resources.any( type == /^aws_/ )
queries:
- uid: mondoo-asset-inventory-terraform-state-version
- uid: mondoo-asset-inventory-terraform-state-aws-resources
- title: Terraform State Asset inventory for Google Cloud
filters: asset.platform == "terraform-state" && terraform.state.resources.any( type == /^google_/ )
queries:
- uid: mondoo-asset-inventory-terraform-state-version
- uid: mondoo-asset-inventory-terraform-state-gcp-resources
- title: Terraform State Asset inventory for Microsoft Azure
filters: asset.platform == "terraform-state" && terraform.state.resources.any( type == /^azurerm_/ )
queries:
- uid: mondoo-asset-inventory-terraform-state-version
- uid: mondoo-asset-inventory-terraform-state-azure-resources
queries:
- uid: mondoo-asset-inventory-terraform-state-version
title: Terraform State Terraform Version
docs:
desc: |
This query gathers the version of Terraform that was used to execute a Terraform run.
mql: terraform.state.terraformVersion
- uid: mondoo-asset-inventory-terraform-state-aws-resources
title: AWS Terraform State resources
docs:
desc: |
This query gathers the resources stored in Terraform state files that manage any AWS resources. The data is only gather if any of the resources match 'aws_' such as 'aws_s3_bucket'.
mql: terraform.state.resources { type providerName values['arn'] values['owner_id'] }
- uid: mondoo-asset-inventory-terraform-state-gcp-resources
title: Google Cloud Terraform State resources
docs:
desc: |
This query gathers the resources stored in Terraform state files that manage any Google Cloud resources. The data is only gather if any of the resources match 'google_' such as 'google_compute_instance'.
mql: terraform.state.resources { type providerName values['project'] values['id'] }
- uid: mondoo-asset-inventory-terraform-state-azure-resources
title: Microsoft Azure Terraform State resources
docs:
desc: |
This query gathers the resources stored in Terraform state files that manage any Microsoft Azure resources. The data is only gather if any of the resources match 'azurerm_' such as 'azurerm_resource_group'.
mql: terraform.state.resources { type providerName values['id'] }
Loading