OpenShift Security
Apply Security Context Constraints, project isolation and integrated build security on OpenShift.
AdvancedOpenShift SecurityContainerInfrastructure
Where it fits in the lifecycle
- Plan
- Code
- Build
- Test
- Release
- Deploy
- Operate
- Monitor
- Deploy Policy enforcement, admission control and infrastructure security.
- Operate Runtime security, secrets rotation and configuration reconciliation.
Overview
OpenShift adds Security Context Constraints on top of Kubernetes, defaulting workloads to non-root with restricted capabilities, plus integrated registry and build controls.
Why it matters
The restricted-by-default posture prevents many issues, but workarounds that grant permissive SCCs silently undo it.
How it works
- 01SCCs define what a pod may request; the restricted-v2 SCC is the default.
- 02Projects provide namespace isolation with per-project quotas and roles.
- 03The internal registry and image streams gate what can run.
Common tools
OpenShiftKyvernoTrivyFalcoOpenShiftKubernetesRed Hat
Implementation examples
bashAudit permissive SCC bindings
oc get clusterrolebinding -o json \ | jq -r '.items[] | select(.roleRef.name | test("privileged")) | .metadata.name'Best practices
- Keep restricted-v2 as the default.
- Justify and review every privileged SCC binding.
Common mistakes
- Granting anyuid cluster-wide to fix one image that runs as root.