Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-732 YARN support for container isolation on Windows
  3. YARN-1063

Winutils needs ability to create task as domain user



    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.6.0
    • nodemanager
    • Windows

    • Reviewed



      Securing a Hadoop cluster requires constructing some form of security boundary around the processes executed in YARN containers. Isolation based on Windows user isolation seems most feasible. This approach is similar to the approach taken by the existing LinuxContainerExecutor. The current patch to winutils.exe adds the ability to create a process as a domain user.

      Alternative Methods considered:

      Process rights limited by security token restriction:

      On Windows access decisions are made by examining the security token of a process. It is possible to spawn a process with a restricted security token. Any of the rights granted by SIDs of the default token may be restricted. It is possible to see this in action by examining the security tone of a sandboxed process launch be a web browser. Typically the launched process will have a fully restricted token and need to access machine resources through a dedicated broker process that enforces a custom security policy. This broker process mechanism would break compatibility with the typical Hadoop container process. The Container process must be able to utilize standard function calls for disk and network IO. I performed some work looking at ways to ACL the local files to the specific launched without granting rights to other processes launched on the same machine but found this to be an overly complex solution.

      Relying on APP containers:

      Recent versions of windows have the ability to launch processes within an isolated container. Application containers are supported for execution of WinRT based executables. This method was ruled out due to the lack of official support for standard windows APIs. At some point in the future windows may support functionality similar to BSD jails or Linux containers, at that point support for containers should be added.

      Create As User Feature Description:


      A new sub command was added to the set of task commands. Here is the syntax:
      winutils task createAsUser [TASKNAME] [USERNAME] [COMMAND_LINE]
      Some notes:

      • The username specified is in the format of "user@domain"
      • The machine executing this command must be joined to the domain of the user specified
      • The domain controller must allow the account executing the command access to the user information. For this join the account to the predefined group labeled "Pre-Windows 2000 Compatible Access"
      • The account running the command must have several rights on the local machine. These can be managed manually using secpol.msc:
        • "Act as part of the operating system" - SE_TCB_NAME
        • "Replace a process-level token" - SE_ASSIGNPRIMARYTOKEN_NAME
        • "Adjust memory quotas for a process" - SE_INCREASE_QUOTA_NAME
      • The launched process will not have rights to the desktop so will not be able to display any information or create UI.
      • The launched process will have no network credentials. Any access of network resources that requires domain authentication will fail.


      Winutils performs the following steps:

      1. Enable the required privileges for the current process.
      2. Register as a trusted process with the Local Security Authority (LSA).
      3. Create a new logon for the user passed on the command line.
      4. Load/Create a profile on the local machine for the new logon.
      5. Create a new environment for the new logon.
      6. Launch the new process in a job with the task name specified and using the created logon.
      7. Wait for the JOB to exit.

      Future work:

      The following work was scoped out of this check in:

      • Support for non-domain users or machine that are not domain joined.
      • Support for privilege isolation by running the task launcher in a high privilege service with access over an ACLed named pipe.


        1. YARN-1063.6.patch
          34 kB
          Remus Rusanu
        2. YARN-1063.5.patch
          34 kB
          Remus Rusanu
        3. YARN-1063.4.patch
          37 kB
          Remus Rusanu
        4. YARN-1063.3.patch
          58 kB
          Remus Rusanu
        5. YARN-1063.2.patch
          35 kB
          Remus Rusanu
        6. YARN-1063.patch
          22 kB
          Kyle Leckie

        Issue Links



              rusanu Remus Rusanu
              kyleckie Kyle Leckie
              0 Vote for this issue
              14 Start watching this issue