1
-
2
1
---
3
2
apiVersion : v1
4
3
kind : ConfigMap
@@ -36,11 +35,15 @@ data:
36
35
# redact the actual value of a secret
37
36
38
37
if .request.requestKind.kind == "Secret" {
38
+ # Redact the secret data
39
39
del(.request.object.data)
40
40
.request.object.data.redacted = "REDACTED"
41
41
del(.request.oldObject.data)
42
42
.request.oldObject.data.redacted = "REDACTED"
43
43
44
+ # Remove the previously set secret data - Not bothering to parse it as this annotation shouldn't ever be needed
45
+ del(.request.object.metadata.annotations.["kubectl.kubernetes.io/last-applied-configuration"])
46
+ del(.request.oldObject.metadata.annotations.["kubectl.kubernetes.io/last-applied-configuration"])
44
47
}
45
48
filter-spam:
46
49
inputs:
@@ -96,69 +99,69 @@ spec:
96
99
spec :
97
100
automountServiceAccountToken : false
98
101
containers :
99
- - image : ghcr.io/richardoc/kube-audit-rest:ad68f71978e8cd610b5b06769fab301cf9ee74d0-distroless@sha256:2444c1207156681c4ed04e7bb02662820c9bfb31b50e8fe5b0112b3f8f577d42
100
- imagePullPolicy : IfNotPresent
101
- name : kube-audit-rest
102
- resources :
103
- requests :
104
- cpu : " 2m"
105
- memory : " 10Mi"
106
- limits :
107
- cpu : " 1"
108
- memory : " 32Mi"
109
- ports :
110
- - containerPort : 9090
111
- protocol : TCP
112
- name : https
113
- - containerPort : 55555
114
- protocol : TCP
115
- name : metrics
116
- volumeMounts :
117
- - name : certs
118
- mountPath : " /etc/tls"
119
- readOnly : true
120
- - name : tmp
121
- mountPath : " /tmp"
122
- securityContext :
123
- allowPrivilegeEscalation : false
124
- readOnlyRootFilesystem : true
125
- capabilities :
126
- drop :
127
- - ALL
128
- - name : vector
129
- image : docker.io/timberio/vector:0.33.0-distroless-static@sha256:90e14483720ea7dfa5c39812a30f37d3bf3a94b6611787a0d14055b8ac31eb1f
130
- resources :
131
- requests :
132
- cpu : " 2m"
133
- memory : " 10Mi"
134
- limits :
135
- cpu : " 2"
136
- memory : " 512Mi"
137
- env :
138
- - name : ESP
139
- valueFrom :
140
- secretKeyRef :
141
- name : elasticsearch-kube-audit-rest-es-elastic-user
142
- key : elastic
143
- volumeMounts :
144
- - name : tmp
145
- mountPath : " /tmp"
146
- readOnly : true
147
- - name : vector-config
148
- mountPath : " /etc/vector/"
149
- readOnly : true
102
+ - image : ghcr.io/richardoc/kube-audit-rest:ad68f71978e8cd610b5b06769fab301cf9ee74d0-distroless@sha256:2444c1207156681c4ed04e7bb02662820c9bfb31b50e8fe5b0112b3f8f577d42
103
+ imagePullPolicy : IfNotPresent
104
+ name : kube-audit-rest
105
+ resources :
106
+ requests :
107
+ cpu : " 2m"
108
+ memory : " 10Mi"
109
+ limits :
110
+ cpu : " 1"
111
+ memory : " 32Mi"
112
+ ports :
113
+ - containerPort : 9090
114
+ protocol : TCP
115
+ name : https
116
+ - containerPort : 55555
117
+ protocol : TCP
118
+ name : metrics
119
+ volumeMounts :
120
+ - name : certs
121
+ mountPath : " /etc/tls"
122
+ readOnly : true
123
+ - name : tmp
124
+ mountPath : " /tmp"
125
+ securityContext :
126
+ allowPrivilegeEscalation : false
127
+ readOnlyRootFilesystem : true
128
+ capabilities :
129
+ drop :
130
+ - ALL
131
+ - name : vector
132
+ image : docker.io/timberio/vector:0.33.0-distroless-static@sha256:90e14483720ea7dfa5c39812a30f37d3bf3a94b6611787a0d14055b8ac31eb1f
133
+ resources :
134
+ requests :
135
+ cpu : " 2m"
136
+ memory : " 10Mi"
137
+ limits :
138
+ cpu : " 2"
139
+ memory : " 512Mi"
140
+ env :
141
+ - name : ESP
142
+ valueFrom :
143
+ secretKeyRef :
144
+ name : elasticsearch-kube-audit-rest-es-elastic-user
145
+ key : elastic
146
+ volumeMounts :
147
+ - name : tmp
148
+ mountPath : " /tmp"
149
+ readOnly : true
150
+ - name : vector-config
151
+ mountPath : " /etc/vector/"
152
+ readOnly : true
150
153
restartPolicy : Always
151
154
terminationGracePeriodSeconds : 30
152
155
volumes :
153
- - name : certs
154
- secret :
155
- secretName : kube-audit-rest
156
- - name : tmp
157
- emptyDir :
158
- sizeLimit : 2Gi # Based on default of 3 files at 500Mi
159
- - name : vector-config
160
- configMap :
161
- name : vector-config
156
+ - name : certs
157
+ secret :
158
+ secretName : kube-audit-rest
159
+ - name : tmp
160
+ emptyDir :
161
+ sizeLimit : 2Gi # Based on default of 3 files at 500Mi
162
+ - name : vector-config
163
+ configMap :
164
+ name : vector-config
162
165
---
163
166
apiVersion : v1
164
167
kind : Service
@@ -168,14 +171,14 @@ metadata:
168
171
name : kube-audit-rest
169
172
spec :
170
173
ports :
171
- - name : https
172
- port : 443
173
- protocol : TCP
174
- targetPort : https
175
- - name : metrics
176
- port : 55555
177
- protocol : TCP
178
- targetPort : metrics
174
+ - name : https
175
+ port : 443
176
+ protocol : TCP
177
+ targetPort : https
178
+ - name : metrics
179
+ port : 55555
180
+ protocol : TCP
181
+ targetPort : metrics
179
182
selector :
180
183
app : kube-audit-rest
181
184
sessionAffinity : None
0 commit comments