Skip to content

Instantly share code, notes, and snippets.

@johnybradshaw
Created March 22, 2023 16:37
Show Gist options
  • Save johnybradshaw/422d2946798e9fcd0e714301bd292783 to your computer and use it in GitHub Desktop.
Save johnybradshaw/422d2946798e9fcd0e714301bd292783 to your computer and use it in GitHub Desktop.
Google Asset Query (https://console.cloud.google.com/iam-admin/asset-inventory/query) to extract all components for licensing in Wiz
# Google Asset Query (https://console.cloud.google.com/iam-admin/asset-inventory/query)
# This extracts all components for licensing in Wiz
SELECT
assetType,
COUNT(*) AS cnt
FROM
STANDARD_METADATA
WHERE
assetType IN
('compute.googleapis.com/Instance',
'sqladmin.googleapis.com/Instance',
'k8s.io/Node',
'storage.googleapis.com/Bucket',
'cloudfunctions.googleapis.com/Function',
'cloudfunctions.googleapis.com/CloudFunction',
'run.googleapis.com/Service')
GROUP BY
assetType
ORDER BY
cnt desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment