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

April upcoming gitpod: cap_net_bind_service lost from docker image on restore #3721

Closed
rfay opened this issue Apr 1, 2021 · 2 comments · Fixed by #3722
Closed

April upcoming gitpod: cap_net_bind_service lost from docker image on restore #3721

rfay opened this issue Apr 1, 2021 · 2 comments · Fixed by #3722
Assignees
Labels
component: ws-daemon type: bug Something isn't working

Comments

@rfay
Copy link

rfay commented Apr 1, 2021

Bug description

When an image is pulled that has setcap cap_net_bind_service, it works correctly on first use. Unfortunately, if the instance is stopped and then restarted, the cap_net_bind_service is lost. The same thing would result from a prebuild followed by launching an instance.

Steps to reproduce

I prepared a repo to demonstrate this, https://github.com/rfay/cap-add-demo - it has a README with full instructions.

Basically:

  1. In a gitpod workspace, docker-up and pull a docker image that has cap_net_bind_service set (I'm sure this is any setcap)
  2. Verify that the setcap is functional using getcap
  3. Stop the gitpod workspace
  4. Start the gitpod workspace. You'll find that the cap_net_bind_service is lost

Expected behavior

An image should behave the same after restore or after prebuild as they do originally. Capabilities should not be lost.

Example repository

https://github.com/rfay/cap-add-demo

@aledbf aledbf self-assigned this Apr 1, 2021
@aledbf
Copy link
Member

aledbf commented Apr 1, 2021

@rfay thank you for the report

@aledbf
Copy link
Member

aledbf commented Apr 1, 2021

@csweichel the capabilities are not present in the generated tar file

extended attributes are present now but missing permissions

{"@type":"type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent","error":"operation not permitted","file":"/dst/.docker-root/overlay2/9e3bf27672b86fbfb9aa4f52e32d286b2db358b22e31b4363ee02f987617daae/diff/bin/nc.traditional","level":"error","message":"restoring extended attributes","name":"security.capability","severity":"ERROR","time":"2021-04-02T00:05:07Z","value":"\u0001\u0000\u0000\u0003\u0000\u0004\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00005\ufffd\u0000\u0000"}

WIP: #3722

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ws-daemon type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants