Skip to content

Commit

Permalink
Revert PSP migration to PSA
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeJu committed Oct 5, 2022
1 parent 6a4c46c commit 09878ef
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 9 deletions.
1 change: 0 additions & 1 deletion config/100-namespace/100-namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ metadata:
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
pod-security.kubernetes.io/enforce: restricted
57 changes: 57 additions & 0 deletions config/101-podsecuritypolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2019 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: tekton-pipelines
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-pipelines
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'runtime/default'
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
spec:
privileged: false
allowPrivilegeEscalation: false
requiredDropCapabilities:
- ALL
volumes:
- 'emptyDir'
- 'configMap'
- 'secret'
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
rule: 'MustRunAsNonRoot'
runAsGroup:
rule: 'MustRunAs'
ranges:
- min: 1
max: 65535
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'MustRunAs'
ranges:
- min: 1
max: 65535
fsGroup:
rule: 'MustRunAs'
ranges:
- min: 1
max: 65535
4 changes: 4 additions & 0 deletions config/200-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ rules:
# When there are changes to the configs or secrets, knative updates the validatingwebhook config
# with the updated certificates or the refreshed set of rules.
verbs: ["get", "update", "delete"]
- apiGroups: ["policy"]
resources: ["podsecuritypolicies"]
resourceNames: ["tekton-pipelines"]
verbs: ["use"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get"]
Expand Down
8 changes: 8 additions & 0 deletions config/200-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ rules:
resources: ["configmaps"]
verbs: ["get"]
resourceNames: ["config-logging", "config-observability", "config-artifact-bucket", "config-artifact-pvc", "feature-flags", "config-leader-election", "config-registry-cert"]
- apiGroups: ["policy"]
resources: ["podsecuritypolicies"]
resourceNames: ["tekton-pipelines"]
verbs: ["use"]
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -59,6 +63,10 @@ rules:
resources: ["secrets"]
verbs: ["get", "update"]
resourceNames: ["webhook-certs"]
- apiGroups: ["policy"]
resources: ["podsecuritypolicies"]
resourceNames: ["tekton-pipelines"]
verbs: ["use"]
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
4 changes: 0 additions & 4 deletions config/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ spec:
- name: config-registry-cert
configMap:
name: config-registry-cert
securityContext:
seLinuxOptions:
role: "RunAsUser"
runAsNonRoot: true
---
apiVersion: v1
kind: Service
Expand Down
4 changes: 0 additions & 4 deletions config/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ spec:
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
securityContext:
seLinuxOptions:
role: "RunAsUser"
runAsNonRoot: true
---
apiVersion: v1
kind: Service
Expand Down

0 comments on commit 09878ef

Please sign in to comment.