Return-Path: X-Original-To: apmail-hadoop-common-dev-archive@www.apache.org Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7BA40185FF for ; Thu, 24 Dec 2015 23:13:56 +0000 (UTC) Received: (qmail 92232 invoked by uid 500); 24 Dec 2015 23:13:49 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 92048 invoked by uid 500); 24 Dec 2015 23:13:49 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 92026 invoked by uid 99); 24 Dec 2015 23:13:49 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Dec 2015 23:13:49 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 976422C1F4E for ; Thu, 24 Dec 2015 23:13:49 +0000 (UTC) Date: Thu, 24 Dec 2015 23:13:49 +0000 (UTC) From: "Tianyin Xu (JIRA)" To: common-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HADOOP-12676) Inconsistent assumptions of the default keytab file of Kerberos MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-12676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tianyin Xu resolved HADOOP-12676. --------------------------------- Resolution: Invalid > Inconsistent assumptions of the default keytab file of Kerberos > --------------------------------------------------------------- > > Key: HADOOP-12676 > URL: https://issues.apache.org/jira/browse/HADOOP-12676 > Project: Hadoop Common > Issue Type: Bug > Components: security > Affects Versions: 2.7.1, 2.6.2 > Reporter: Tianyin Xu > Assignee: Tianyin Xu > Priority: Minor > > In the current implementation of {{SecurityUtil}}, we do not consider the default keytab file of Kerberos (which is {{/etc/krb5.keytab}} in [MIT Kerberos defaults|http://web.mit.edu/kerberos/krb5-1.13/doc/mitK5defaults.html#paths]). > If the user does not set the keytab file, an {{IOException}} will be thrown. > {code:title=SecurityUtil.java|borderStyle=solid} > 230 public static void login(final Configuration conf, > 231 final String keytabFileKey, final String userNameKey, String hostname) > 232 throws IOException { > ... > 237 String keytabFilename = conf.get(keytabFileKey); > 238 if (keytabFilename == null || keytabFilename.length() == 0) { > 239 throw new IOException("Running in secure mode, but config doesn't have a keytab"); > 240 } > {code} > However, the default keytab location is assumed by some of the callers. For example, in [{{yarn-default.xml}}|https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-common/yarn-default.xml], > ||property || default|| > |yarn.resourcemanager.keytab | /etc/krb5.keytab > |yarn.nodemanager.keytab | /etc/krb5.keytab > |yarn.timeline-service.keytab | /etc/krb5.keytab > On the other hand, these callers directly call the {{SecurityUtil.login}} method; therefore, the docs are incorrect that the defaults are actually {{null}} (as we do not have a default)... > {code:title=NodeManager.java|borderStyle=solid} > protected void doSecureLogin() throws IOException { > SecurityUtil.login(getConfig(), YarnConfiguration.NM_KEYTAB, > YarnConfiguration.NM_PRINCIPAL); > } > {code} > I don't know if we should make {{/etc/krb5.keytab}} as the default in {{SecurityUtil}}, or ask the callers to correct their assumptions. I post here as a minor issue. > Thanks! -- This message was sent by Atlassian JIRA (v6.3.4#6332)