No root containers

Proprietary

Containers that run as root frequently have more permissions than their workload requires which, in case of compromise, could help an attacker further their exploits.

org.openrewrite.kubernetes.NoRootContainers
mod run . --recipe=org.openrewrite.kubernetes.NoRootContainers

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Add Kubernetes pod spec configuration securityContext: runAsNonRoot: true