actions / actions/actions-runner-controller

[Security] Improve secureness of dind root containers with "User Namespaces" feature.

Open
#4,189 8 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

community enhancement needs triage
Dominant language
Go
Stars
6.5k
Forks
1.5k
Avg merge
2d 2h
Merged PRs (30d)
27

Description

What would you like added?

Because the DinD (Docker-in-Docker) pod runs as root, it should leverage Kubernetes “User Namespaces” for better isolation and security (see https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/).

Enabling this feature only requires adding the field hostUsers: false to the pod template, for example here:
https://github.com/actions/actions-runner-controller/blob/master/charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml#L157

Why is this needed?

User Namespaces are a new Kubernetes security feature that significantly reduces the risk of privilege escalation. Security is a must-have. 😊

Additional context

• The spec.hostUsers field is available starting with Kubernetes 1.30 (to be confirm)
• Setting hostUsers: false activates User Namespaces only if clusters support them; otherwise clusters the field is simply ignored, so compatibility is maintained.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml around the pod template at line 157, and review the Kubernetes User Namespaces documentation linked in the issue. Add the requested hostUsers setting and verify that the resulting template preserves compatibility for clusters that do not support the feature.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
devops, security
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.