Runtime security

Intro

Definition

Use-case

1. gVisor (from Google) 

2. Kata containers.

Implementation


nano runtime.yaml


apiVersion: node.k8s.io/v1

kind: RuntimeClass

metadata:

  name: sandbox

handler: gvisor



$ k get runtimeclass


NAME      HANDLER   AGE

sandbox   runsc     14m



cat <<EOF | kubectl apply -f -

apiVersion: v1

kind: Pod

metadata:

  name: nginx-gvisor

spec:

  runtimeClassName: sandbox

  containers:

  - name: nginx

    image: nginx

EOF

Verify the setup


$ k exec nginx-gvisor -- dmesg


[    0.000000] Starting gVisor...

[    0.354495] Daemonizing children...

[    0.564053] Constructing home...

[    0.976710] Preparing for the zombie uprising...

[    1.299083] Creating process schedule...

[    1.479987] Committing treasure map to memory...

[    1.704109] Searching for socket adapter...

[    1.748935] Generating random numbers by fair dice roll...

[    2.059747] Digging up root...

[    2.259327] Checking naughty and nice process list...

[    2.610538] Rewriting operating system in Javascript...

[    2.613217] Ready!

Tip