-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add non-root user account to Pulumi image #653
Comments
Added to epic #586 |
This comment has been minimized.
This comment has been minimized.
A nonroot variant of the kitchen sink image will be available soon: I believe the remaining work on the PKO side is to use the correct default based on the security profile:
Also remove the files in |
The |
### Proposed changes This update removes the default CRD validation marker from the `workspace.spec.image` field, allowing for dynamic image selection based on the value of `workspace.spec.securityProfile`. When `securityProfile` is set to `baseline`, the image defaults to `pulumi/pulumi:latest`. If `securityProfile` is marked as `restricted`, the system will instead select `pulumi/pulumi:latest-nonroot`. If a user specifies their own image, then that value is used instead. Handling these default settings within the controller is necessary, as CRD validation markers cannot accommodate conditional defaults. Before implementing this feature, additional ginkgo tests were introduced to confirm that the desired behavior is properly achieved. ### Related issues (optional) Closes: #653
Cannot close issue:
Please fix these problems and try again. |
Resolved by #693, #692 and pulumi/pulumi-docker-containers#277. |
For the pu/pu image to support non-root execution (a security best practice, and supported by PKOv2), we need to add a local user to the image.
Ideally we wouldn't have separate "nonroot" images (see the "distroless" images). Otherwise the defaulting logic would be more tricky.
One possibility is to add the local user as shown below but avoid using the
USER
instruction. I think that's sufficient for purposes of PKOv2, because the pod can apply a security context. TheUSER
instruction seems to set the default, which might be considered a breaking change for existing users of the pu/pu image.Here's an example of the Dockerfile commands:
And an example of the pod security context:
The text was updated successfully, but these errors were encountered: