apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  name: besu-network-psp
  namespace: besu-network
spec:
  privileged: false
  allowPrivilegeEscalation: false
  requiredDropCapabilities:
    - ALL
  volumes:
    - 'configMap'
    - 'emptyDir'
    - 'projected'
    - 'secret'
    - 'downwardAPI'
    - 'persistentVolumeClaim'
  hostNetwork: false
  hostIPC: false
  hostPID: false
  runAsUser:
    rule: 'MustRunAsNonRoot'
  supplementalGroups:
    rule: 'MustRunAs'
    ranges:
      - min: 1
        max: 65535
  fsGroup:
    rule: 'MustRunAs'
    ranges:
      - min: 1
        max: 65535
  readOnlyRootFilesystem: false
  seLinux:
    rule: 'RunAsAny'
  allowedHostPaths: []
  defaultAllowPrivilegeEscalation: false
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: besu-psp
  namespace: besu-network
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: besu-network-psp
rules:
  - apiGroups: ['policy']
    resources: ['podsecuritypolicies']
    verbs: ['use']
    resourceNames:
      - besu-network-psp
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: besu-network-psp
roleRef:
  kind: ClusterRole
  name: besu-network-psp
  apiGroup: rbac.authorization.k8s.io
subjects:
  - kind: ServiceAccount
    name: besu-psp
    namespace: besu-network

