Skip to content

Commit

Permalink
Addressing PodSecurity violation warnings: (#2685)
Browse files Browse the repository at this point in the history
* 🛂 Addressing PodSecurity violation warnings:

* adding/updating securityContext, as needed, to allow running as 'restricted' standard.
* adding seccompProfile

PR references from knative/eventing repo:
* knative/eventing#5863
* knative/eventing#6533

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* revert zipkin changes

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Update control-plane/config/post-install/500-storage-version-migrator.yaml

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
  • Loading branch information
matzew and pierDipi authored Oct 21, 2022
1 parent 85db1f9 commit 625d68e
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
restartPolicy: Always
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ spec:

securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault

ports:
- name: https-webhook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
restartPolicy: Always
9 changes: 9 additions & 0 deletions control-plane/config/post-install/500-post-install-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,12 @@ spec:
fieldPath: metadata.namespace
- name: CHANNEL_GENERAL_CONFIG_MAP_NAME
value: kafka-channel-config
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,12 @@ spec:
- "kafkasources.sources.knative.dev"
- "kafkachannels.messaging.knative.dev"
- "kafkasinks.eventing.knative.dev"
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
6 changes: 5 additions & 1 deletion data-plane/config/broker/500-dispatcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: config-kafka-broker-data-plane
configMap:
Expand Down
6 changes: 5 additions & 1 deletion data-plane/config/broker/500-receiver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: kafka-broker-brokers-triggers
configMap:
Expand Down
6 changes: 5 additions & 1 deletion data-plane/config/brokerv2/500-dispatcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: config-kafka-broker-data-plane
configMap:
Expand Down
6 changes: 5 additions & 1 deletion data-plane/config/channel/500-dispatcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: config-kafka-channel-data-plane
configMap:
Expand Down
6 changes: 5 additions & 1 deletion data-plane/config/channel/500-receiver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: kafka-channel-channels-subscriptions
configMap:
Expand Down
6 changes: 5 additions & 1 deletion data-plane/config/channelv2/500-dispatcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: config-kafka-channel-data-plane
configMap:
Expand Down
6 changes: 5 additions & 1 deletion data-plane/config/sink/500-receiver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: kafka-sink-sinks
configMap:
Expand Down
6 changes: 5 additions & 1 deletion data-plane/config/source/500-dispatcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: config-kafka-source-data-plane
configMap:
Expand Down
6 changes: 5 additions & 1 deletion test/config/cm-watcher-broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: config-logging
configMap:
Expand Down
6 changes: 5 additions & 1 deletion test/config/cm-watcher-channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: config-logging
configMap:
Expand Down
6 changes: 5 additions & 1 deletion test/config/cm-watcher-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ spec:
terminationMessagePath: /dev/temination-log
securityContext:
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumes:
- name: config-logging
configMap:
Expand Down

0 comments on commit 625d68e

Please sign in to comment.