-
Notifications
You must be signed in to change notification settings - Fork 3
/
mondoo-kubernetes-inventory.mql.yaml
153 lines (148 loc) · 4.76 KB
/
mondoo-kubernetes-inventory.mql.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Copyright (c) Mondoo, Inc.
# SPDX-License-Identifier: BUSL-1.1
packs:
- uid: mondoo-kubernetes-inventory
name: Kubernetes Inventory Pack
version: 1.1.0
license: BUSL-1.1
authors:
- name: Mondoo, Inc
email: [email protected]
tags:
mondoo.com/platform: kubernetes
mondoo.com/category: best-practices
docs:
desc: |
The Kubernetes Inventory Pack by Mondoo pack retrieves data about a Kubernetes Cluster for asset inventory.
To run this pack for a Kubernetes Cluster:
```bash
cnquery scan k8s -f mondoo-kubernetes-inventory.mql.yaml
```
## Join the community!
Our goal is to build query packs that are simple to deploy and provide accurate and useful data.
If you have any suggestions for improving this query pack, or if you need support, [join the Mondoo community](https://github.com/orgs/mondoohq/discussions) in GitHub Discussions.
groups:
- title: Cluster inventory
filters:
- asset.platform == "kubernetes" || asset.platform == "k8s-cluster"
queries:
- uid: k8s-cluster-version
title: Kubernetes cluster version
mql: |
k8s.serverVersion
- uid: k8s-cluster-namespaces
title: Kubernetes cluster namespaces
mql: |
k8s.namespaces
- uid: k8s-cluster-nodes
title: Cluster modes
mql: |
k8s.nodes
- uid: k8s-cluster-clusterroles
title: Cluster RBAC ClusterRoles
mql: |
k8s.clusterroles
- uid: k8s-cluster-roles
title: RBAC Roles
mql: |
k8s.roles
- uid: k8s-cluster-clusterrolebindings
title: RBAC cluster-rolebindings
mql: |
k8s.clusterrolebindings
- uid: k8s-cluster-rolebindings
title: RBAC rolebindings
mql: |
k8s.rolebindings
- title: Pods inventory
filters:
- asset.platform == "k8s-pod"
queries:
- uid: k8s-pod
title: Pod information
mql: |
k8s.pod
- uid: k8s-pod-container
title: Container information
mql: |
k8s.pod.containers
- title: Deployments inventory
filters:
- asset.platform == "k8s-deployment"
queries:
- uid: k8s-deployment
title: Deployment information
mql: |
k8s.deployments
- uid: k8s-deployment-container
title: Container information
mql: |
k8s.deployment.containers { * }
- title: CronJobs inventory
filters:
- asset.platform == "k8s-cronjob"
queries:
- uid: k8s-cronjob
title: CronJob information
mql: |
k8s.cronjob { * }
- uid: k8s-cronjob-container
title: Container information
mql: |
k8s.cronjob.containers { * }
- title: Jobs inventory
filters:
- asset.platform == "k8s-job"
queries:
- uid: k8s-job
title: Job information
mql: |
k8s.job { * }
- uid: k8s-job-container
title: Container information
mql: |
k8s.job.containers { * }
- title: DaemonSets inventory
filters:
- asset.platform == "k8s-daemonset"
queries:
- uid: k8s-daemonset
title: DaemonSet information
mql: |
k8s.daemonset { * }
- uid: k8s-daemonset-container
title: Container information
mql: |
k8s.daemonset.containers { * }
- title: StatefulSets inventory
filters:
- asset.platform == "k8s-statefulset"
queries:
- uid: k8s-statefulset
title: StatefulSet information
mql: |
k8s.statefulset { * }
- uid: k8s-statefulset-container
title: Container information
mql: |
k8s.statefulset.containers { * }
- title: ReplicaSets inventory
filters:
- asset.platform == "k8s-replicaset"
queries:
- uid: k8s-replicaset
title: ReplicaSet information
mql: |
k8s.replicaset { * }
- uid: k8s-replicaset-container
title: Container information
mql: |
k8s.replicaset.containers { * }
- title: Ingresses inventory
filters:
- asset.platform == "k8s-ingress"
queries:
- uid: k8s-ingress
title: Ingress information
mql: |
k8s.ingress { * }