6 min read

Is OpenShift more secure than Kubernetes? An honest look at SCC, SELinux and PSP

OpenShift is widely considered more secure than Kubernetes. I look at Security Context Constraints, SELinux and the reality of operations — with a clear assessment.

'Is OpenShift more secure than Kubernetes?' I have heard that question for years, mostly in client meetings where someone has to take an architecture decision with a lot of money and a lot of reputation on the table. The short answer is: yes, often yes, but for different reasons than most people assume. The long answer is worth giving, because security on container platforms is a field where half-truths persist stubbornly.

The starting point: default state

The most important difference between OpenShift and a freshly installed Kubernetes is not the technology, but the default. OpenShift ships with a preset security model that is close to production. Kubernetes ships with a model that is flexible because it has to fit many worlds.

In concrete terms, that means: anyone who creates a deployment on OpenShift gets, by default, a very restrictive security context. No root containers, no privileged pods, restricted capabilities, enforced user namespaces, defined SELinux labels. Anyone who creates a deployment on Kubernetes gets what they type in. Including root, including privileged, including all Linux capabilities, if nobody has put on the brakes.

For the question of security, that matters. In practice, security is almost always a question of defaults. Very few attacks happen because someone exploits an exotic vulnerability. Most happen because somewhere there was a generous default configuration that nobody actually wanted that way.

Security Context Constraints as a backbone

OpenShift's central concept is the Security Context Constraint, or SCC. SCCs define which security properties a pod is allowed to have. They go significantly further than the Pod Security Standards in Kubernetes. An SCC can precisely govern which user IDs are allowed, which SELinux contexts are applied, which FSGroups, which volumes, which capabilities, whether host networking is allowed, and much more.

From my experience, this is the feature that really sets OpenShift apart in enterprise use. Not because Kubernetes couldn't do something comparable — Pod Security Admission in newer K8s versions points in this direction — but because SCCs have been stable and widely used for years. Anyone working in a regulated environment has, here, a mechanism that is auditable and traceable.

Kubernetes used to have Pod Security Policies (PSP), often cited as a counterpart. PSPs have since been deprecated and removed in modern clusters. Their successor, Pod Security Admission (PSA), works with three levels (privileged, baseline, restricted) and is significantly simpler than SCC. Simpler doesn't mean better here, it means coarser-grained. Anyone who needs very fine-grained policies often supplements PSA in practice with Kyverno or Gatekeeper. At which point you suddenly find yourself with a tool stack that OpenShift brings natively.

SELinux is not a detail

One point that often gets lost in Kubernetes debates: SELinux. OpenShift runs on Red Hat CoreOS, and SELinux is active there in enforcing mode. That means even if a container escapes, or a process unintentionally runs privileged, there is still a second protective layer at the operating system level.

Kubernetes clusters run on a very heterogeneous base. From Ubuntu via Debian all the way to Windows nodes, anything is possible. SELinux enforcing is not the default here. That is not a bug of the ecosystem, that is the nature of an open ecosystem. But it is a security factor that has to be assessed cleanly.

For anyone working in a regulated environment, SELinux enforcing is effectively a plus that OpenShift brings out of the box. Anyone who wants this layer on Kubernetes has to deliberately build, validate and operate it. That is doable, but it is work.

What Kubernetes makes up for

To keep the picture fair: Kubernetes has areas where it is significantly ahead. The ecosystem is broader. Community innovations often flow into Kubernetes first and arrive in OpenShift later. Tools like OPA/Gatekeeper, Kyverno, Falco, Cilium and many others are extremely strong in the K8s world and can be combined into a security stack that, in places, goes beyond what OpenShift offers as standard.

The decisive difference is not 'secure vs. insecure' but 'out of the box vs. self-assembled'. A team that genuinely masters K8s security can build very secure clusters. A team looking for a platform with sensible defaults and clearly defined limits is better served with OpenShift.

My conclusion

Is OpenShift more secure than Kubernetes? In practice, especially on day one, yes. In theory you can get just as far with Kubernetes. The point is: security is never what is theoretically possible. Security is what is actually running while nobody is looking.

Anyone evaluating container platforms should therefore spend less time arguing 'which technology is better' and more time looking at their own organisation. How much security expertise is there in the team? Which defaults are good enough for you? How well do you keep your own configuration auditable?

For many mid-market companies, OpenShift is the more honest choice for exactly these reasons. For experienced platform teams with their own security approach, Kubernetes can be at least as secure. The answer lies in the organisation, not in the logo on the cluster.

Questions I often hear on this

A few things readers regularly ask me about this topic.

Can I reach the same security with K8s as with OpenShift?+

Yes, technically you can. The difference is the effort and the discipline across years. Day-one security and year-three security are two different things. A platform decision should always take that into account.

How important is SELinux really in practice?+

More important than many people think. The second protective layer at OS level kicks in exactly when the container layer has already failed. Those are the moments you need it most.

Which K8s tools do you add when OpenShift isn't an option?+

I currently use Kyverno or Gatekeeper for policies depending on the project, Falco for runtime detection, Cilium for network policies. That's more parts to hold together yourself, but manageable.

How do you actually approach a platform decision?+

I do it like this: first look at the team and its security maturity, then the regulatory requirements, only then the technology. The same technology can be the perfect tool with one team setup and the wrong tool with another.

Is the OpenShift licence worth the premium?+

From my point of view often yes, but not for everyone. Anyone with a small, experienced platform team that builds its own security pays at OpenShift for things they don't need. Anyone in the mid-market who wants clean defaults faster saves time at the end of the day that would otherwise flow into building a K8s security stack.

Ich schau mir dein Cluster an.

If you'd like to discuss this in more depth

I advise individual IT leaders under OnlyOle — one to one, without agency overhead. If this stays on your mind and you want to sort it out in your own context, just give me a call or drop me a short message.

Zu OnlyOle