[
https://issues.apache.org/jira/browse/MAPREDUCE-7537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18082058#comment-18082058
]
ASF GitHub Bot commented on MAPREDUCE-7537:
-------------------------------------------
K0K0V0K commented on code in PR #8492:
URL: https://github.com/apache/hadoop/pull/8492#discussion_r3266694933
##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/TaskLevelSecurityEnforcer.java:
##########
@@ -92,6 +95,19 @@ public static void validate(JobConf conf,
UserGroupInformation currentUser)
return;
}
+ String[] allowedGroupNames = conf.getTrimmedStrings(
+ MRConfig.SECURITY_ALLOWED_GROUPS,
+ MRConfig.DEFAULT_SECURITY_ALLOWED_GROUPS);
+ if (allowedGroupNames.length > 0) {
+ UserGroupInformation submitterUgi =
+ UserGroupInformation.createRemoteUser(currentUserName);
+ if (isUserInAllowedGroups(submitterUgi, allowedGroupNames)) {
+ LOG.debug("The {} is allowed to execute every task via allowed-groups",
+ currentUserName);
+ return;
Review Comment:
https://github.com/apache/hadoop/blob/7f80f0733ea39b4c4c299acc96582fd4a9c785c3/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java#L1686
AFAIK the mapreduce.job.user.name is always set
##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/security/authorize/TestTaskLevelSecurityEnforcer.java:
##########
@@ -128,6 +147,54 @@ public void testJobConfigCanNotOverwriteMapreduceConfig() {
assertDenied(mapreduceConf);
}
+ @Test
+ public void testAllowedGroup() {
+ UserGroupInformation.createUserForTesting("alice",
+ new String[] {"hadoop"});
+ JobConf conf = jobConfForSubmitUser("alice");
+ conf.setBoolean(MRConfig.MAPREDUCE_TASK_SECURITY_ENABLED, true);
+ conf.setStrings(MRConfig.SECURITY_DENIED_TASKS,
"org.apache.hadoop.streaming");
+ conf.setStrings(MRConfig.SECURITY_ALLOWED_GROUPS, "hadoop");
+ conf.set(MRJobConfig.MAP_CLASS_ATTR,
"org.apache.hadoop.streaming.PipeMapper");
+ assertPass(conf);
+ }
+
+ @Test
+ public void testDeniedGroup() {
+ UserGroupInformation.createUserForTesting("bob",
+ new String[] {"other"});
+ JobConf conf = jobConfForSubmitUser("bob");
+ conf.setBoolean(MRConfig.MAPREDUCE_TASK_SECURITY_ENABLED, true);
+ conf.setStrings(MRConfig.SECURITY_DENIED_TASKS,
"org.apache.hadoop.streaming");
+ conf.setStrings(MRConfig.SECURITY_ALLOWED_GROUPS, "hadoop");
+ conf.set(MRJobConfig.MAP_CLASS_ATTR,
"org.apache.hadoop.streaming.PipeMapper");
+ assertDenied(conf);
Review Comment:
https://github.com/apache/hadoop/blob/7f80f0733ea39b4c4c299acc96582fd4a9c785c3/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java#L1686
AFAIK the mapreduce.job.user.name is always set
> Hadoop MapReduce Task-Level Security - allowed Groups Bypass
> ------------------------------------------------------------
>
> Key: MAPREDUCE-7537
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-7537
> Project: Hadoop Map/Reduce
> Issue Type: New Feature
> Components: mrv2
> Reporter: Riya Khandelwal
> Priority: Major
> Labels: pull-request-available
>
> [MAPREDUCE-7523|https://issues.apache.org/jira/browse/MAPREDUCE-7523]
> introduced mapreduce.security.denied-tasks: a single, global list of
> disallowed class name prefixes applied to values of keys listed in
> mapreduce.security.property-domain. By default the policy is not per-user or
> per-group—the same rules apply to every submitter until an exception is
> configured. mapreduce.security.allowed-users already provides a per-user
> bypass of that deny list.
> This work adds mapreduce.security.allowed-groups: a per-group bypass using
> the submitter’s resolved group names from the cluster’s Hadoop group mapping
> (UserGroupInformation.getGroupsSet() for that user).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]