Container & Kubernetes Security

Secure and attack cloud-native infrastructure

20 lessons ยท CHF 9.90 one-time

20 lessons ยท knowledge checks ยท final exam ยท verifiable certificate ยท in-browser Live-Lab

Buy now ยท CHF 9.90 Open in the course reader

Frequently asked questions

What is the difference between a container and a virtual machine?

A virtual machine boots its own guest kernel behind a hypervisor. A container is an ordinary Linux process on the host's shared kernel, isolated by namespaces, cgroups, capabilities and seccomp. Removing those features, for example with privileged mode, weakens the boundary between container and host.

How do I check what a Kubernetes service account is allowed to do?

As an administrator, run kubectl auth can-i --list -n <namespace> --as=system:serviceaccount:<namespace>:<name> to list its permissions, or ask a single question such as kubectl auth can-i get secrets with the same --as flag. The API server answers yes or no without needing the account's token.

What are Kubernetes Pod Security Standards?

They are three built-in profiles: privileged, baseline and restricted. Pod Security Admission enforces them per namespace through labels such as pod-security.kubernetes.io/enforce=restricted. Pods that break the profile, for example privileged containers or containers running as root, are rejected at admission before they are stored.

Are Kubernetes Secrets encrypted?

Not by default in every setup. Secret values in the API are only base64-encoded, which anyone can decode. Protect them with strict RBAC on the secrets resource, encryption at rest for etcd, protected backups, or an external secret store.

Why does my Kubernetes NetworkPolicy not block traffic?

The API server accepts NetworkPolicy objects regardless of whether anything enforces them. Enforcement is done by the cluster's network plugin, and some plugins do not support it. Always prove a policy with a negative connection test, such as a request that should time out.

How can I practise Kubernetes security safely?

Create a disposable cluster on your own laptop with kind or minikube, confirm with kubectl config current-context that you are in the lab, run your tests there, and delete the cluster afterwards. Only test systems you own or are explicitly authorised in writing to test.

Get the full course

One-time purchase, no subscription. Pay as a guest โ€” no account needed.

Buy now ยท CHF 9.90 Open in the course reader

Course syllabus

Lessons unlock after a single one-time purchase โ€” no subscription. Pricing & FAQ โ†’ ยท All course overviews โ†’