YARN high-security features
This topic covers the high-security features of YARN and their configurations.
Background information
When you create a cluster, enabling the Kerberos Authentication switch designates it as a high-security cluster. This lets you use the high-security features of E-MapReduce (EMR). In a high-security cluster, YARN enables the following features by default to restrict user actions and ensure data security:
Kerberos authentication
When you create a high-security cluster, EMR automatically configures the required Kerberos settings for YARN. No manual configuration is needed. For more information about Kerberos, see Kerberos overview.
For a high-security cluster, a client must pass Kerberos authentication before it can access the YARN RPC service or HTTP service. For example:
kinit
yarn node -list
kdestroy
kinit
curl --negotiate -u: http://master-1-1:8088/ws/v1/cluster/nodes
kdestroy
ACL-based authorization
In a high-security cluster, the YARN Access Control List (ACL) feature is enabled by default. By default, only the hadoop user group, which contains the service account, has permissions to manage the YARN service and all queues, including job submission. The master switch for the YARN ACL feature is yarn.acl.enable=true.
YARN service administration permissions
The default high-security configuration is yarn.admin.acl= hadoop. The leading space before hadoop indicates that the hadoop user group, which acts as the service administrator, has administrative permissions. In EMR, the Linux users that start services typically belong to the hadoop user group. By default, YARN derives user group mappings from the operating system's group information on each node.
The value of yarn.admin.acl typically follows the format users user_groups, with users listed first, followed by a space, and then user groups. You can specify multiple users or groups by separating them with commas (,), for example, user1,user2 group1,group2. If you specify only user groups, you must include a leading space. A single space as the value grants no permissions to any user or user group.
YARN queue management permissions
YARN queue permissions include two types: submitting applications (SUBMIT_APPLICATIONS) and administering queues (ADMINISTER_QUEUE).
When you create an EMR high-security cluster, the default Capacity Scheduler configuration in the capacity-scheduler.xml file includes yarn.scheduler.capacity.root.acl_submit_applications= (a single space) and yarn.scheduler.capacity.root.acl_administer_queue= hadoop (with a leading space before hadoop). This means that, by default, the hadoop user group has queue administration permissions for all queues. As a result, users who are not in the hadoop user group cannot submit jobs to any queue. You can run the id command to view the group information for the current user.
If your cluster has a small number of users and does not require ACL management, you can remove the two preceding configuration properties. Then, on the Status page of the YARN service, click refresh queues in the Actions column of the ResourceManager component to hot-refresh the queue configuration and disable the ACL feature.
The following options are available for queue management:
-
To manage queue permissions with ACLs, consider using Ranger. It provides a visual interface to configure and dynamically manage user queue permissions.
NoteRanger currently supports only the Capacity Scheduler. For more information, see Configure Ranger-based access control for YARN.
-
Manually edit the capacity-scheduler.xml file. Add the yarn.scheduler.capacity.root.<queue-path>.acl_submit_applications and yarn.scheduler.capacity.root.<queue-path>.acl_administer_queue properties to configure ACL-based authorization for queues. For more information, see Queue Properties and Configure Queue ACLs.
You can combine queue ACLs with the queue mapping feature of the Capacity Scheduler. In the capacity-scheduler.xml file, use the yarn.scheduler.capacity.queue-mappings property to define rules that map job submissions from specific users or user groups to default queues. To enforce these rules, set
yarn.scheduler.capacity.queue-mappings-override.enable=true.
YARN job management permissions
YARN job management permissions include two types: viewing job information (VIEW_APP) and modifying jobs (MODIFY_APP).
-
Permissions to view job information: This permission mainly grants the ability to retrieve job information and view logs from various YARN components. It does not include restrictions that the engine itself imposes on the
VIEW_APPaction.In the MapReduce engine, the mapred-site.xml file contains the default configuration
mapreduce.job.acl-view-job=*, which grants this permission to all users. -
Permission to modify jobs: In YARN, terminating a job is controlled by the queue administration permission
ADMINISTER_QUEUE.
LCE secure containers
By default, YARN in non-high-security clusters uses the DefaultContainerExecutor to run containers. With this executor, if containers run under the hadoop account, they lack effective user-level isolation. This poses a security risk, as users could maliciously modify service files and configurations, and tenants might access each other's resources. To address this, EMR high-security clusters use the Linux Container Executor (LCE) to run secure containers by default. LCE leverages the Linux setuid bit, which forces containers to run under the identity of the job submission user. This approach revokes unnecessary high-risk permissions from the container.
To use LCE secure containers, you must ensure that a Linux account corresponding to the job submission user exists on each NodeManager. The recommended method is to use the user management feature in the EMR console to add accounts. This method adds the user to the cluster's OpenLDAP and maps them to a Linux account on each node by using the Nslcd service. This requires the OpenLDAP service to be installed on the cluster. An alternative is to manage Linux accounts manually. This involves adding the required Linux accounts for YARN on every node and adding a corresponding bootstrap action to automatically create the accounts on new scale-out nodes.