<< All versions

Skill v1.0.1

currentAutomated scan100/100
redhatproductsecurity/prodsec-skills/scc-security

+2 new

──Details
PublishedAugust 1, 2026 at 06:06 PM
Content Hashsha256:13bde48c870343c6...
Git SHAb55c6b9c3392
Bump Typepatch
Compare with v1.0.0
──Files
Files (1 file, 3.7 KB)
SKILL.md3.7 KBactive
SKILL.md · 70 lines · 3.7 KB

version: "1.0.1" name: scc-security description: > Review OpenShift Security Context Constraints for correct privilege levels. Use when auditing pod security, reviewing SCC assignments, or configuring container runtime permissions on OpenShift clusters. metadata: category: secure_development subcategory: kubernetes


OpenShift Security Context Constraints (SCC)

SCCs control what actions pods can perform and what host resources they can access. If no security context is specified, OpenShift applies the restricted SCC by default.

What SCCs Control

  • Privileged container execution
  • Linux capabilities requested by containers
  • Host directory volume mounts
  • SELinux context
  • Container user and group IDs
  • Host namespace and networking access
  • FSGroup ownership of volumes
  • Supplemental groups
  • Read-only root filesystem requirement
  • Volume types
  • Seccomp profiles

SCC Reference

SCCDescriptionWhen to Use
restrictedDenies all host features; requires namespace-allocated UID and SELinux label. Most restrictive.Default for all workloads; prefer this unless a specific relaxation is justified
nonrootLike restricted, but allows any non-root UIDWhen the container must run as a specific non-root UID
anyuidLike restricted, but allows any UID/GIDWhen the container requires a specific UID (including root UID without root privileges)
hostnetworkAllows host networking and ports; requires namespace UID/SELinuxOnly for pods that must bind to host network interfaces
hostaccessAllows all host namespaces; requires namespace UID/SELinuxOnly for trusted pods requiring host namespace access
hostmount-anyuidLike restricted, but allows host mounts and any UIDOnly for pods requiring host filesystem access (e.g., persistent volume recycler)
privilegedFull access to all host features; any user, group, SELinux contextOnly for cluster administration requiring maximum access
node-exporterPurpose-built for the Prometheus node exporterOnly for the node exporter DaemonSet
customAdministrator-defined constraintsRequires careful security review; document every relaxation

Security Review Guidelines

  • Start from restricted and relax only when a specific capability is justified
  • Document why a workload cannot run under restricted
  • Custom SCCs require particular scrutiny: every relaxation from restricted must have a documented rationale
  • Review that SCCs are bound to the correct ServiceAccounts, not overly broad groups
  • Verify that no workload uses privileged SCC unless it is a cluster administration component
  • Check that runAsNonRoot: true is set unless the container requires root to function
  • Check that readOnlyRootFilesystem: true is set unless the container must write to its root filesystem

Implementation Checklist

  • [ ] All workloads use restricted SCC unless a specific exception is documented
  • [ ] No workload uses privileged SCC without cluster-admin justification
  • [ ] Custom SCCs document every relaxation from restricted
  • [ ] SCC bindings target specific ServiceAccounts, not broad groups
  • [ ] runAsNonRoot: true is set in the pod security context
  • [ ] readOnlyRootFilesystem: true is set in container security contexts
  • [ ] Host path mounts are justified and documented
  • [ ] Host networking is only enabled for pods that require it

References

← v1.0.0All versions