Skip to content

Commit

Permalink
Adds initial version of Terraform asset inventory query pack
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Ford <[email protected]>
  • Loading branch information
scottford-io committed Jan 7, 2024
1 parent 44eb67a commit 212ccb0
Showing 1 changed file with 58 additions and 0 deletions.
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'] }

0 comments on commit 212ccb0

Please sign in to comment.