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

imgpkg removes group permissions when storing files in OCI image, which causes permission problems with the Jammy stack #498

Closed
navdeep-pama opened this issue Mar 16, 2023 · 1 comment · Fixed by #513
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request

Comments

@navdeep-pama
Copy link

What happened:
Jammy-base builders require read permissions is set for group. It uses different users for build and run, so group read permissions are required to access files.

  • Using imgpkg to copy a jammy-base image
  • Imgpkg removes group permissions when storing files in OCI image, permissions are set based on unmask
  • node/python/gradle workload deployments with "--local-path" will fail. These projects require read access to file system resources.

What did you expect:
The permissions should be retained so that Jammy-base images and their workloads can run.

Anything else you would like to add:
imgpkg should implement a new flag called --preserve-permissions that will disable the current behavior for imgpkg that would remove all the permissions. This will ensure we don't cause a breaking change for existing user workflows.

@navdeep-pama navdeep-pama added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Mar 16, 2023
@joaopapereira
Copy link
Member

Going to change from bug to feature, since this is the way imgpkg is supposed to behave. We decided to go with this behavior to add an extra layer of security to ensure that the user that creates files is the only one that can update them.

In the examples above there is some situation where we might want to forfeit this feature and allow for the full permissions to be kept. In order to enable these scenarios we might, as suggested, create a new flag for imgpkg push to keep the permissions.

The main side effect here that we must have into account is the fact that when imgpkg pulls the image it will have to know that the permission bits should be kept. In order for this to be done we can try to see if there is a way to make the code understand if the permissions are present or not and if imgpkg should copy the user bits or not.
Some investigation needs to go into this.

In case this makes the code much more complicated we can decide to go with the creation of something in the image, like a file on .imgpkg/ folder or some annotation on the image itself to inform imgpkg about the expected behavior on pull.

@joaopapereira joaopapereira added enhancement This issue is a feature request carvel accepted This issue should be considered for future work and that the triage process has been completed and removed bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants