Skip to content

Commit

Permalink
⭐️ Add azure.subscription. Move all azure resources under azure.subsc…
Browse files Browse the repository at this point in the history
…ription (#810)

Introduce a new `azure.subscription` resource:
```
cnquery> azure.subscription{name state}
azure.subscription: {
  name: "Mondoo Testing"
  state: "Enabled"
}
```

All the resources are now moved from `azure.*` to
`azure.subscription.*`. This lets us build a resource hierarchy more
clearly. Before:
```

cnquery> azure.compute.vms{name}
azure.compute.vms: [
  0: {
    name: "Security-Team-vm-linux-1-b9qa"
  }
  1: {
    name: "Security-Team-vm-linux-1-mjau"
  }
]
```

After:
```
cnuery> azure.subscription.compute.vms{name}
azure.subscription.compute.vms: [
  0: {
    name: "Security-Team-vm-linux-1-b9qa"
  }
  1: {
    name: "Security-Team-vm-linux-1-mjau"
  }
]
```


There are aliases introduced to keep the old resources untouched to
avoid breaking changes so `azure.compute.vms` will still work
  • Loading branch information
preslavgerchev authored Feb 8, 2023
1 parent 4ce3cbc commit 3339aa2
Show file tree
Hide file tree
Showing 23 changed files with 7,619 additions and 4,071 deletions.
11 changes: 6 additions & 5 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ activitylog
Auths
backupconfiguration
bigquery
Brotli
cavium
cdn
certificatechains
cmek
CMKs
Expand All @@ -20,6 +22,7 @@ GOBIN
gpu
gvnic
hostkeys
iap
iex
ingresstls
loggingservice
Expand All @@ -32,6 +35,7 @@ netfirewallprofile
netfirewallrule
nodepool
Pids
postgre
preemptibility
preemptible
pushconfig
Expand All @@ -44,15 +48,12 @@ spo
sqlserver
sshkeys
sysctls
TTLs
UDF
unarchived
vdcs
vmknics
Vtpm
vulnerabilityassessmentsettings
wfascimprov
wil
Brotli
cdn
iap
TTLs
UDF
8 changes: 8 additions & 0 deletions resources/packs/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ func msGraphTransport(t providers.Instance) (*microsoft_transport.Provider, erro
}
return at, nil
}

func azureTagsToInterface(data map[string]*string) map[string]interface{} {
labels := make(map[string]interface{})
for key := range data {
labels[key] = core.ToString(data[key])
}
return labels
}
481 changes: 305 additions & 176 deletions resources/packs/azure/azure.lr

Large diffs are not rendered by default.

8,379 changes: 4,926 additions & 3,453 deletions resources/packs/azure/azure.lr.go

Large diffs are not rendered by default.

Loading

0 comments on commit 3339aa2

Please sign in to comment.