Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-1523 Ozone Docker container phase 1
  3. HDDS-1609

Remove hard coded uid from Ozone docker image

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Hadoop-runner image is hard coded to USER hadoop and user hadoop is hard coded to uid 1000. This arrangement complicates development environment where host user is different uid from 1000. External bind mount locations are written data as uid 1000. This can prevent development environment from clean up test data.

      Docker documentation stated that "The best way to prevent privilege-escalation attacks from within a container is to configure your container’s applications to run as unprivileged users." From Ozone architecture point of view, there is no reason to run Ozone daemon to require privileged user or hard coded user.

      Solution 1

      It would be best to support running docker container as host user to reduce friction. User should be able to run:

      docker run -u $(id -u):$(id -g) ...
      

      or in docker-compose file:

      user: "${UID}:${GID}"
      

      By doing this, the user will be name less in docker container. Some commands may warn that user does not have a name. This can be resolved by mounting /etc/passwd or a file that looks like /etc/passwd that contain host user entry.

      Solution 2

      Move the hard coded user to range < 200. The default linux profile reserves service users < 200 to have umask that keep data private to service user or group writable, if service shares group with other service users. Register the service user with Linux vendors to ensure that there is a reserved uid for Hadoop user or pick one that works for Hadoop. This is a longer route to pursuit, and may not be fruitful.

      Solution 3

      Default the docker image to have sssd client installed. This will allow docker image to see host level names by binding sssd socket. The instruction for doing this is located at in Hadoop website.
      The pre-requisites for this approach will require the host level system to have sssd installed. For production system, there is a 99% chance that sssd is installed.

      We may want to support combined solution of 1 and 3 to be proper.

      Attachments

        1. report.html
          225 kB
          Eric Yang
        2. log.html
          233 kB
          Eric Yang
        3. osx.txt
          4 kB
          Marton Elek
        4. linux.txt
          3 kB
          Marton Elek

        Activity

          People

            Unassigned Unassigned
            eyang Eric Yang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: