Skip to content

Instantly share code, notes, and snippets.

@genadipost
Last active October 14, 2021 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save genadipost/1e1fc813aa16803586cd6691f73c5ee4 to your computer and use it in GitHub Desktop.
Save genadipost/1e1fc813aa16803586cd6691f73c5ee4 to your computer and use it in GitHub Desktop.
aws_psp
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: ebs-csi-controller
spec:
privileged: true
allowPrivilegeEscalation: true
allowedCapabilities:
- '*'
volumes:
- '*'
hostNetwork: true
hostPorts:
- min: 0
max: 65535
hostIPC: true
hostPID: true
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
readOnlyRootFilesystem: false
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: ebs-csi-controller-psp
namespace: kube-system
rules:
- apiGroups:
- policy
resourceNames:
- ebs-csi-controller
resources:
- podsecuritypolicies
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ebs-csi-controller-psp
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ebs-csi-controller-psp
subjects:
- kind: ServiceAccount
name: ebs-csi-controller-sa
namespace: kube-system
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: ebs-csi-node
spec:
privileged: true
allowPrivilegeEscalation: true
allowedCapabilities:
- '*'
volumes:
- '*'
hostNetwork: true
hostPorts:
- min: 0
max: 65535
hostIPC: true
hostPID: true
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
readOnlyRootFilesystem: false
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: ebs-csi-node-psp
namespace: kube-system
rules:
- apiGroups:
- policy
resourceNames:
- ebs-csi-node
resources:
- podsecuritypolicies
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ebs-csi-node-psp
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ebs-csi-node-psp
subjects:
- kind: ServiceAccount
name: ebs-csi-node-sa
namespace: kube-system
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment