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

Fix non-numeric UID #2332

Merged
merged 1 commit into from
Feb 5, 2024
Merged

Fix non-numeric UID #2332

merged 1 commit into from
Feb 5, 2024

Conversation

SISheogorath
Copy link
Contributor

@SISheogorath SISheogorath commented Feb 5, 2024

This patch adjusts the distroless image to use the predefined non-root UID, which uses explicit UID definitions. This allows orchestrators like Kubernetes to validate non-zero UIDs directly by checking the Image metadata.

The previous setup without an explicit runAsUser in the securityContext would produce the following error when enabling runAsNonRoot:

Error: container has runAsNonRoot and image has non-numeric user (nonroot), cannot verify user is non-root (pod: "miniflux-97cc5955f-pt7vf_miniflux(d1c56d29-ea0a-407c-b3f3-9821fbd7ee61)", container: miniflux)

This should not introduce any functional change. It just moves the UID evaluation from "inspecting the image's /etc/passwd" to image metadata.

Do you follow the guidelines?

This patch adjusts the distroless image to use the predefined non-root UID, which uses explicit UID definitions. This allows orchestrators like Kubernetes to validate non-zero UIDs directly by checking the Image metadata.

The previous setup without an explicit `runAsUser` in the securityContext would produce the following error when enabling `runAsNonRoot`:

```
Error: container has runAsNonRoot and image has non-numeric user (nonroot), cannot verify user is non-root (pod: "miniflux-97cc5955f-pt7vf_miniflux(d1c56d29-ea0a-407c-b3f3-9821fbd7ee61)", container: miniflux)
```
@fguillot fguillot merged commit 552fb3e into miniflux:main Feb 5, 2024
15 checks passed
fguillot added a commit that referenced this pull request Feb 6, 2024
fguillot added a commit that referenced this pull request Feb 6, 2024
@SISheogorath SISheogorath deleted the patch-1 branch February 17, 2024 21:59
jeankhawand pushed a commit to jeankhawand/v2 that referenced this pull request Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants