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

Starting app as unprivileged user #8

Closed
stuartpb opened this issue Oct 16, 2014 · 2 comments
Closed

Starting app as unprivileged user #8

stuartpb opened this issue Oct 16, 2014 · 2 comments

Comments

@stuartpb
Copy link
Member

progrium/buildstep#109 indicates there's some issue in PHP caused by running the apps as root (under "Known Quirks"), and that Heroku doesn't run apps as root.

This plugin could conceivably be altered to not run apps as root (although that would break enter-sandbox, so there'd have to be some thought around how to fix that).

@stuartpb
Copy link
Member Author

yabawock/buildstep@8b47bc0 makes this part of the created image - I'm not wild about that approach. On the other hand, using root within the container to create a non-privileged user does seem like the only viable way. So yeah maybe this is an aspect of building.

So, to recap:

  • The built-in user approach: make an unprivileged user within the container during app compilation, then set the app start script to run the app as that user (possibly allowing an override). This is being discussed as part of Implementing plushu-build-cedarish#1 right now, and it does currently seem like the best solution.
  • Make a single unprivileged user like www-data(?) in the host environment as part of this plugin's install, and make sure everything within the app's base will be executable by that. This requires more modifications to the host environment, and it has a lot of expectations about the app container (specifically requiring it to be compatible with this unprivileged host user).

Really, since it seems like the only user that can reliably jump cross-container boundaries, without specific foresight within the container regarding the uids and all, is root, it seems like the user-inside-the-container route is the only viable way to go. As such, it wouldn't be up to this plugin (this plugin can just keep executing with whatever user Docker decides).

@stuartpb
Copy link
Member Author

And hey, maybe a future Plushu builder will use Dockerfiles or whatever to build app containers, and then it can set the default user, or use some mechanism like that (is it a flag on docker commit or something)?

Anyway, non-privileged users are something within containers, and as such the mechanism by which they are configured should be left up to the build step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant