committed by
GitHub
parent
6bfb07aac2
commit
931af3241d
2
Makefile
2
Makefile
@@ -66,7 +66,7 @@ kubeconform: crdschemas manifests $(KUBECONFORM_BIN)
|
|||||||
|
|
||||||
.PHONY: kubescape
|
.PHONY: kubescape
|
||||||
kubescape: $(KUBESCAPE_BIN) ## Runs a security analysis on generated manifests - failing if risk score is above threshold percentage 't'
|
kubescape: $(KUBESCAPE_BIN) ## Runs a security analysis on generated manifests - failing if risk score is above threshold percentage 't'
|
||||||
$(KUBESCAPE_BIN) scan -s framework -t 20 nsa manifests/*.yaml --exceptions 'kubescape-exceptions.json'
|
$(KUBESCAPE_BIN) scan -s framework -t 16 nsa manifests/*.yaml --exceptions 'kubescape-exceptions.json'
|
||||||
|
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
fmt: $(JSONNETFMT_BIN)
|
fmt: $(JSONNETFMT_BIN)
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ function(params) {
|
|||||||
runAsUser: 65534,
|
runAsUser: 65534,
|
||||||
allowPrivilegeEscalation: false,
|
allowPrivilegeEscalation: false,
|
||||||
readOnlyRootFilesystem: true,
|
readOnlyRootFilesystem: true,
|
||||||
|
capabilities: { drop: ['ALL'] },
|
||||||
},
|
},
|
||||||
volumeMounts: [{
|
volumeMounts: [{
|
||||||
mountPath: '/etc/blackbox_exporter/',
|
mountPath: '/etc/blackbox_exporter/',
|
||||||
@@ -196,6 +197,7 @@ function(params) {
|
|||||||
runAsUser: 65534,
|
runAsUser: 65534,
|
||||||
allowPrivilegeEscalation: false,
|
allowPrivilegeEscalation: false,
|
||||||
readOnlyRootFilesystem: true,
|
readOnlyRootFilesystem: true,
|
||||||
|
capabilities: { drop: ['ALL'] },
|
||||||
},
|
},
|
||||||
terminationMessagePath: '/dev/termination-log',
|
terminationMessagePath: '/dev/termination-log',
|
||||||
terminationMessagePolicy: 'FallbackToLogsOnError',
|
terminationMessagePolicy: 'FallbackToLogsOnError',
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ function(params)
|
|||||||
// FIXME(ArthurSens): The securityContext overrides can be removed after some PRs get merged
|
// FIXME(ArthurSens): The securityContext overrides can be removed after some PRs get merged
|
||||||
// 'allowPrivilegeEscalation: false' can be deleted when https://github.com/brancz/kubernetes-grafana/pull/128 gets merged.
|
// 'allowPrivilegeEscalation: false' can be deleted when https://github.com/brancz/kubernetes-grafana/pull/128 gets merged.
|
||||||
// 'readOnlyRootFilesystem: true' can be deleted when https://github.com/brancz/kubernetes-grafana/pull/129 gets merged.
|
// 'readOnlyRootFilesystem: true' can be deleted when https://github.com/brancz/kubernetes-grafana/pull/129 gets merged.
|
||||||
|
// 'capabilities: { drop: ['ALL'] }' can be deleted when https://github.com/brancz/kubernetes-grafana/pull/130 gets merged.
|
||||||
deployment+: {
|
deployment+: {
|
||||||
spec+: {
|
spec+: {
|
||||||
template+: {
|
template+: {
|
||||||
@@ -95,6 +96,7 @@ function(params)
|
|||||||
securityContext+: {
|
securityContext+: {
|
||||||
allowPrivilegeEscalation: false,
|
allowPrivilegeEscalation: false,
|
||||||
readOnlyRootFilesystem: true,
|
readOnlyRootFilesystem: true,
|
||||||
|
capabilities: { drop: ['ALL'] },
|
||||||
},
|
},
|
||||||
}, super.containers),
|
}, super.containers),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -63,5 +63,6 @@ function(params) {
|
|||||||
runAsNonRoot: true,
|
runAsNonRoot: true,
|
||||||
allowPrivilegeEscalation: false,
|
allowPrivilegeEscalation: false,
|
||||||
readOnlyRootFilesystem: true,
|
readOnlyRootFilesystem: true,
|
||||||
|
capabilities: { drop: ['ALL'] },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ function(params) (import 'github.com/kubernetes/kube-state-metrics/jsonnet/kube-
|
|||||||
image: ksm._config.kubeRbacProxyImage,
|
image: ksm._config.kubeRbacProxyImage,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
// FIXME(ArthurSens): The securityContext overrides can be removed after some PRs get merged
|
||||||
|
// 'capabilities: { drop: ['ALL'] },' can be deleted when https://github.com/kubernetes/kube-state-metrics/pull/1674 gets merged.
|
||||||
deployment+: {
|
deployment+: {
|
||||||
spec+: {
|
spec+: {
|
||||||
template+: {
|
template+: {
|
||||||
@@ -133,6 +135,9 @@ function(params) (import 'github.com/kubernetes/kube-state-metrics/jsonnet/kube-
|
|||||||
readinessProbe:: null,
|
readinessProbe:: null,
|
||||||
args: ['--host=127.0.0.1', '--port=8081', '--telemetry-host=127.0.0.1', '--telemetry-port=8082'],
|
args: ['--host=127.0.0.1', '--port=8081', '--telemetry-host=127.0.0.1', '--telemetry-port=8082'],
|
||||||
resources: ksm._config.resources,
|
resources: ksm._config.resources,
|
||||||
|
securityContext+: {
|
||||||
|
capabilities: { drop: ['ALL'] },
|
||||||
|
},
|
||||||
}, super.containers) + [kubeRbacProxyMain, kubeRbacProxySelf],
|
}, super.containers) + [kubeRbacProxyMain, kubeRbacProxySelf],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ function(params) {
|
|||||||
securityContext: {
|
securityContext: {
|
||||||
allowPrivilegeEscalation: false,
|
allowPrivilegeEscalation: false,
|
||||||
readOnlyRootFilesystem: true,
|
readOnlyRootFilesystem: true,
|
||||||
|
capabilities: { drop: ['ALL'], add: ['CAP_SYS_TIME'] },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ function(params) {
|
|||||||
securityContext: {
|
securityContext: {
|
||||||
allowPrivilegeEscalation: false,
|
allowPrivilegeEscalation: false,
|
||||||
readOnlyRootFilesystem: true,
|
readOnlyRootFilesystem: true,
|
||||||
|
capabilities: { drop: ['ALL'] },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -125,11 +125,17 @@ function(params)
|
|||||||
image: po._config.kubeRbacProxyImage,
|
image: po._config.kubeRbacProxyImage,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
// FIXME(ArthurSens): The securityContext overrides can be removed after some PRs get merged
|
||||||
|
// 'capabilities: { drop: ['ALL'] },' can be deleted when https://github.com/prometheus-operator/prometheus-operator/pull/4546 gets merged.
|
||||||
deployment+: {
|
deployment+: {
|
||||||
spec+: {
|
spec+: {
|
||||||
template+: {
|
template+: {
|
||||||
spec+: {
|
spec+: {
|
||||||
containers+: [kubeRbacProxy],
|
containers: std.map(function(c) c {
|
||||||
|
securityContext+: {
|
||||||
|
capabilities: { drop: ['ALL'] },
|
||||||
|
},
|
||||||
|
}, super.containers) + [kubeRbacProxy],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ spec:
|
|||||||
memory: 20Mi
|
memory: 20Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
runAsUser: 65534
|
runAsUser: 65534
|
||||||
@@ -64,6 +67,9 @@ spec:
|
|||||||
memory: 20Mi
|
memory: 20Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
runAsUser: 65534
|
runAsUser: 65534
|
||||||
@@ -92,6 +98,9 @@ spec:
|
|||||||
memory: 20Mi
|
memory: 20Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
runAsGroup: 65532
|
runAsGroup: 65532
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ spec:
|
|||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /var/lib/grafana
|
- mountPath: /var/lib/grafana
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ spec:
|
|||||||
memory: 190Mi
|
memory: 190Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
runAsUser: 65534
|
runAsUser: 65534
|
||||||
- args:
|
- args:
|
||||||
@@ -64,6 +67,9 @@ spec:
|
|||||||
memory: 20Mi
|
memory: 20Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
runAsGroup: 65532
|
runAsGroup: 65532
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
@@ -87,6 +93,9 @@ spec:
|
|||||||
memory: 20Mi
|
memory: 20Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
runAsGroup: 65532
|
runAsGroup: 65532
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ spec:
|
|||||||
memory: 180Mi
|
memory: 180Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- CAP_SYS_TIME
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /host/sys
|
- mountPath: /host/sys
|
||||||
@@ -80,6 +85,9 @@ spec:
|
|||||||
memory: 20Mi
|
memory: 20Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
runAsGroup: 65532
|
runAsGroup: 65532
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ spec:
|
|||||||
memory: 180Mi
|
memory: 180Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /tmp
|
- mountPath: /tmp
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ spec:
|
|||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
- args:
|
- args:
|
||||||
- --logtostderr
|
- --logtostderr
|
||||||
@@ -64,6 +67,9 @@ spec:
|
|||||||
memory: 20Mi
|
memory: 20Mi
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
runAsGroup: 65532
|
runAsGroup: 65532
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
|
|||||||
Reference in New Issue
Block a user