-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Mac API forwarding using a privileged docker socket claim helper #13075
Mac API forwarding using a privileged docker socket claim helper #13075
Conversation
@baude sorry I didn't get this in last night had a hectic Friday Hopefully I didn't disrupt your weekend plans too much in this area. Ill keep an eye on chat and here if you need me. |
afdd830
to
f00c108
Compare
@baude @ashley-cui PTAL |
i had a few cycles in the evening and addressed a number of loose ends. I'll submit an update tomorrow |
f00c108
to
f604e0e
Compare
Ok this is finally pushed with an update to address TODOs and squashed |
f604e0e
to
baadaff
Compare
/approve |
/hold more commits coming |
baadaff
to
bac3890
Compare
4f483be
to
963bb4a
Compare
…ck claim helper Signed-off-by: Jason T. Greene <[email protected]>
…t=t|f Switch default to rootless for mac and windows Signed-off-by: Jason T. Greene <[email protected]>
Signed-off-by: Jason T. Greene <[email protected]>
963bb4a
to
50fbe52
Compare
LGTM |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: baude, n1hility, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
only pending item I have (other than changes from review) is to double check machine on linux, will do that ASAP and lift the hold I had on this |
/remove-hold My local testing of machine on linux shows no regressions |
Changes LGTM but I'd like @baude to do the final merge |
/lgtm |
This PR provides a comparable low-touch experience to the current windows API forwarding approach by introducing a privileged helper that runs under launchd.
Fixes #11462
Fixes #11397
Fixes #11389
Fixes #11422
Additional changes in this PR
--rootful=true
|false
toinit
podman machine set
command to change this after init (and in the future other settings that can be changed)podman machine start
now advises how to switch to rootfulThe reasons for this approach are:
Using a privileged helper allows podman machine to request relinking to a fixed predetermined location as needed. It executes as a nowait inetd service, so is only briefly active when a switch is required. The control channel is a unix socket maintained by launchd that is only accessible to the podman machine user. Both the link location and target are fixed by installed configuration, and not influenced by socket input, which is restricted to a simple trigger action. Multiple machine instances are handled by having an intermediate link which is managed by podman machine without involving the helper, since the link is located in the user data directory.
Before taking control of the socket link, podman machine first checks if it's in use. If so, as is the case in the Windows impl, the system falls back to a machine local socket and prints instructions on how to set DOCKER_HOST. The same occurs if the helper is not available.
There is a one-time action that
podman machine start
will prompt the user to run. We could have podman machine init run it automatically via osacript using osx auth processes (biometric auth works for example). However, I assume that everyone would prefer a brew formula action, plus the one sudo launch is straightforward.The referenced installation action
sudo podman-mac-helper install
copies the helper into a dedicated fs location and verifies the fs path is sufficiently hardened since the typical brew managed locations are too loose for system processes (user-owned with lots of links so easily swappable).Here is what it looks like pre helper installation:
After installing:
If something like dockerd is using the socket:
In action with API clients:
[NO NEW TESTS NEEDED]