Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Applied Kubernetes Security Pitfalls

Applied Kubernetes Security Pitfalls

Avatar for Michael Schubert

Michael Schubert

October 25, 2018
Tweet

More Decks by Michael Schubert

Other Decks in Technology

Transcript

  1. Kubernetes today ❏ Many means available to make clusters more

    secure ❏ Continued efforts towards secure-by-default ❏ Fairly good security track record
  2. apiVersion: v1 kind: Pod … volumeMounts: - mountPath: /test name:

    test subPath: malicious-symlink volumes: - name: test hostPath: path: /tmp/test type: Directory
  3. kube-apiserver: auth delegation ❏ Needed for e.g. API extensions --requestheader-client-ca-file

    --requestheader-group-headers --requestheader-username-headers --requestheader-allowed-names (~optional) --requestheader-extra-headers-prefix (optional)
  4. kube-apiserver: auth delegation [Service] ExecStart=/usr/local/bin/kube-apiserver \ --authorization-mode=Node,RBAC \ --client-ca-file=/etc/k8s/ca.pem \

    --bind-address=0.0.0.0 \ […] --requestheader-client-ca-file=/etc/k8s/ca.pem \ --requestheader-group-headers=X-Remote-Group \ --requestheader-username-headers=X-Remote-User CTF: Demo #1 http://tiny.cc/k8sminictf
  5. PodSecurityPolicy (PSP) ❏ Added with v1.10 ❏ Administrators decide what

    contexts pods can run in ❏ Would have been a way to mitigate CVE-2017-1002101 ... with the right policy
  6. apiVersion: policy/v1beta1 kind: PodSecurityPolicy … privileged: false volumes: - 'hostPath'

    allowedHostPaths: - pathPrefix: /tmp runAsUser: rule: 'MustRunAs' ranges: - min: 1 max: 65535 CTF: Demo #2 http://tiny.cc/k8sminictf
  7. Server-side request forgery (SSRF) ❏ “... is a type of

    exploit where an attacker abuses the functionality of a server causing it to access or manipulate information in the realm of that server ...”