Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AWS-node serviceaccount to priv psp #1172

Merged
merged 3 commits into from
May 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,40 @@ spec:
max: 65535
readOnlyRootFilesystem: false
---
# aws-node requires the NET_RAW capability. To ensure this is restricted to one deployment this PSP
# was created.
# Relevant until https://github.com/aws/amazon-vpc-cni-k8s/issues/796 is merged.
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: aws-node
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
labels:
kubernetes.io/cluster-service: "true"
spec:
privileged: true
allowPrivilegeEscalation: true
allowedCapabilities:
- NET_BIND_SERVICE
- NET_ADMIN
volumes:
- '*'
hostNetwork: true
hostPorts:
- min: 0
max: 65535
hostIPC: true
hostPID: true
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -104,6 +138,17 @@ rules:
- restricted
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: psp:aws-node
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- aws-node
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: default:restricted
Expand Down Expand Up @@ -134,9 +179,6 @@ subjects:
- kind: ServiceAccount
name: kube-proxy
namespace: kube-system
- kind: ServiceAccount
name: aws-node
namespace: kube-system
- kind: ServiceAccount
name: sonarqube-sonarqube
namespace: sonarqube
Expand Down Expand Up @@ -170,3 +212,16 @@ subjects:
- kind: Group
name: system:serviceaccounts:opa
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: default:aws-node
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psp:aws-node
subjects:
- kind: ServiceAccount
name: aws-node
namespace: kube-system