<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 4, 2016 at 10:56 AM, Jan Pazdziora <span dir="ltr"><<a href="mailto:jpazdziora@redhat.com" target="_blank">jpazdziora@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Thu, Feb 04, 2016 at 10:19:16AM -0500, Prasun Gera wrote:<br>
> I am trying to set up a docker image with a specific development<br>
> environment. We use idm 4.2 for authentication, and non-kerberized nfs<br>
> (including home) for data storage on the hosts.<br>
<br>
</span>Are the hosts IPA-enrolled?<br>
<span class=""><br></span></blockquote><div>Yes.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
> The goal is to run the<br>
> docker container such that when the user calls docker run,<br>
<br>
</span>Is any user allowed to run docker run? That seems like a security<br>
issue.<br>
<span class=""><br></span></blockquote><div>Well any user that can do sudo should be able to run docker. Is there a security issue with that ?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
> it just drops<br>
> into a shell with the container's environment, but everything else looks<br>
> largely the same. i.e. The user gets the same uid:gid and sees the same<br>
> directories and permissions as the host.<br>
<br>
</span>So you want bash started in the container, with the uid:gid of the<br>
person invoking the command? If the users are trusted to do docker<br>
run, they can do<br>
<br>
        docker run -u $UID container bash<br>
<br>
themselves.<br>
<br></blockquote><div>Yes, this is similar to the 3rd point I mentioned. The problem though is that directory listings will not show names inside the container. They'll only show uids and gids. NIS solves this as a quick hack, but is there something better ? Permissions would still work since NFS is not kerberized. Another issue I haven't figured out is how the user can get sudo inside the container. If you start docker with the user's uid, I don't know if there is a safe way for that user to get sudo inside. If you start docker in the root shell, you can create the user with the uid:gid, add it to sudoers, and then change to the user's shell ? </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
But you likely do not want to give every user a way to run any command,<br>
why not just use sudo, and<br>
<br>
        docker run -u $SUDO_UID container bash<br>
<br>
in the script invoked with the sudo (untested)?<br>
<span class=""><font color="#888888"><br></font></span></blockquote><div>I didn't follow this. Can you explain a bit more ? In the default setup, you anyway need sudo to run docker. What is the -u string here ?<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><font color="#888888">
--<br>
Jan Pazdziora<br>
Senior Principal Software Engineer, Identity Management Engineering, Red Hat<br>
</font></span></blockquote></div><br></div></div>