Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zarf can't init when nonroot user is strictly enforced #1921

Closed
flickerfly opened this issue Jul 25, 2023 · 0 comments · Fixed by #1922
Closed

Zarf can't init when nonroot user is strictly enforced #1921

flickerfly opened this issue Jul 25, 2023 · 0 comments · Fixed by #1922

Comments

@flickerfly
Copy link
Contributor

Environment

Device and OS: Ubuntu/WSL
App version: 0.28.2
Kubernetes distro being used: RKE2
Other: Admission controller will not permit containers with named USER because it may be set to 0 in image.

Steps to reproduce

  1. Setup a kubernetes cluster which enforces non-root by default including blocking named users.
  2. run zarf init

Expected result

Zarf inits

Actual Result

zarf agent deployment fails because the user ID can't be looked up before the container starts.

Visual Proof (screenshots, videos, text, etc)

image
image

Relevant code:
https://github.com/defenseunicorns/zarf/blob/main/Dockerfile#L4

I'll submit an PR for this shortly...

Racer159 added a commit that referenced this issue Jul 28, 2023
## Description

On clusters that strictly enforce no root containers via an Admission
Controller, they can't determine that a named user isn't 0 in the
container. This changes the container to identify the USER by UID and
GID so the admission controller can allow this through.

Chainguard documents the UID and GID of nonroot
https://edu.chainguard.dev/chainguard/chainguard-images/reference/static/overview/#users

## Related Issue

Fixes #1921

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Co-authored-by: Wayne Starr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant