Skip to content

Commit

Permalink
⭐️ add query pack to count assets in env (#73)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Münch <[email protected]>
Co-authored-by: Christoph Hartmann <[email protected]>
  • Loading branch information
atomic111 and chris-rock authored Jul 11, 2023
1 parent 88028dc commit 7de4cb3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ipaddress
macaddress
mpim
nicconfig
Operatingsystem
saas
usergroups
wmic
Expand Down
34 changes: 34 additions & 0 deletions extra/mondoo-asset-count.mql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
packs:
- uid: mondoo-asset-count
name: Asset Count Query Pack
queries:
- uid: mondoo-asset-count-on-vsphere-cluster-esxi
title: Retrieve all ESXi hosts
filters: asset.platform == 'vmware-vsphere'
query: |
vsphere.datacenters { hosts.length }
- uid: mondoo-asset-count-on-vsphere-cluster-vms
title: Retrieve all VMs from vsphere cluster
filters: asset.platform == 'vmware-vsphere'
query: |
vsphere.datacenters { vms.length }
- uid: mondoo-asset-count-on-azure
title: Retrieve all VMs from Azure
filters: asset.platform == 'azure'
query: |
azure.compute.vms.length
- uid: mondoo-count-users-in-azure
title: Retrieve all VMs from Azure
filters: asset.platform == 'azure' || asset.platform == 'microsoft365'
query: |
azuread.users.length
- uid: mondoo-asset-count-on-aws
title: Retrieve all VMs from AWS
filters: asset.platform == 'aws'
query: |
aws.ec2.instances.length
- uid: mondoo-asset-count-in-windows-domain
title: Retrieve all computer object from the windows domain
filters: asset.platform == "windows" && windows.computerInfo['OsProductType'] == 2
query: |
parse.json(content: powershell('Get-ADComputer -Filter * -properties * | select Name, Enabled,Operatingsystem,OperatingSystemVersion | ConvertTo-Json').stdout).params

0 comments on commit 7de4cb3

Please sign in to comment.