-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubescape_sneeffer_Daemonset_network_policy.yaml
184 lines (183 loc) · 5.06 KB
/
kubescape_sneeffer_Daemonset_network_policy.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubescape-sneeffer-service-account
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kubescape-sneeffer-cluster-role
rules:
- apiGroups: ["*"]
resources: ["pods", "nodes", "deployments", "daemonsets", "statefulsets", "jobs", "cronjobs", "replicasets"]
verbs: ["get"]
- apiGroups: ["*"]
resources: ["pods"]
verbs: ["watch"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["create"]
- apiGroups: ["kubescape.io"]
resources: ["runtimevulndetaileds", "runtimevulnsummaries"]
verbs: ["create", "get", "update"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kubescape-sneeffer-role-binding
subjects:
- kind: ServiceAccount
name: kubescape-sneeffer-service-account
namespace: default
apiGroup: ""
roleRef:
kind: ClusterRole
name: kubescape-sneeffer-cluster-role
apiGroup: ""
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kubescape-sneeffer-config
namespace: default
data:
SneefferConfigurationFile.txt: |
innerDataDirPath=./data
kernelObjPath=./resources/ebpf/kernel_obj.o
snifferEngineLoaderPath=./resources/ebpf/sniffer
sbomCreatorPath=./resources/sbom/syft
vulnCreatorPath=./resources/vuln/grype
snifferTime=1
loggerVerbose=INFO
crdFullDetailedPath=./resources/k8s/crd-vuln-full-detailes.yaml
crdVulnSummaryPath=./resources/k8s/crd-vuln-summary.yaml
crdNetworkPolicyPath=./resources/k8s/crd-k8s-network-policy.yml
enableContainerProfilingService=false
enableRelaventCVEsService=false
enableNetworkMonitoringService=true
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kubescape-sneeffer
labels:
app: kubescape-sneeffer
spec:
selector:
matchLabels:
app: kubescape-sneeffer
template:
metadata:
labels:
app: kubescape-sneeffer
alt-name: kubescape-sneeffer
spec:
serviceAccountName: kubescape-sneeffer-service-account
automountServiceAccountToken: true
volumes:
- name: configmap-volume
configMap:
name: kubescape-sneeffer-config
- emptyDir: {}
name: root-falco-fs
- hostPath:
path: /boot
type: ""
name: boot-fs
- hostPath:
path: /lib/modules
type: ""
name: lib-modules
- hostPath:
path: /usr
type: ""
name: usr-fs
- hostPath:
path: /etc
type: ""
name: etc-fs
- hostPath:
path: /dev
type: ""
name: dev-fs
- hostPath:
path: /var/run/docker.sock
type: ""
name: docker-socket
- hostPath:
path: /run/containerd/containerd.sock
type: ""
name: containerd-socket
- hostPath:
path: /run/crio/crio.sock
type: ""
name: crio-socket
- hostPath:
path: /proc
type: ""
name: proc-fs
- hostPath:
path: /sys/kernel/debug
type: ""
name: debugfs
initContainers:
- env:
- name: FALCO_BPF_PROBE
image: docker.io/falcosecurity/falco-driver-loader:0.32.2
imagePullPolicy: IfNotPresent
name: falco-driver-loader
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /root/.falco
name: root-falco-fs
- mountPath: /host/proc
name: proc-fs
readOnly: true
- mountPath: /host/boot
name: boot-fs
readOnly: true
- mountPath: /host/lib/modules
name: lib-modules
- mountPath: /host/usr
name: usr-fs
readOnly: true
- mountPath: /host/etc
name: etc-fs
readOnly: true
containers:
- name: kubescape-sneeffer
image: quay.io/kubescape/sneeffer:v0.0.35
# command: ["/bin/bash"]
# args: ["-c", "while true; do sleep 1000;done"]
imagePullPolicy: Always
env:
- name: SNEEFFER_CONF_FILE_PATH
value: "/etc/sneeffer/configuration/SneefferConfigurationFile.txt"
- name: myNode
valueFrom:
fieldRef:
fieldPath: spec.nodeName
securityContext:
runAsUser: 0
capabilities:
add:
- SYS_RESOURCE
- SYS_ADMIN
volumeMounts:
- mountPath: /etc/sneeffer/configuration
name: configmap-volume
- mountPath: /root/.falco
name: root-falco-fs
- mountPath: /host/proc
name: proc-fs
- mountPath: /sys/kernel/debug
name: debugfs
- mountPath: /host/var/run/docker.sock
name: docker-socket
- mountPath: /host/run/containerd/containerd.sock
name: containerd-socket
- mountPath: /host/run/crio/crio.sock
name: crio-socket