From issues-return-158825-archive-asf-public=cust-asf.ponee.io@hive.apache.org Thu May 30 09:55:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id EE4B2180663 for ; Thu, 30 May 2019 11:55:01 +0200 (CEST) Received: (qmail 22559 invoked by uid 500); 30 May 2019 09:55:01 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 22549 invoked by uid 99); 30 May 2019 09:55:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 May 2019 09:55:01 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7C09BE0A4B for ; Thu, 30 May 2019 09:55:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3A0082459D for ; Thu, 30 May 2019 09:55:00 +0000 (UTC) Date: Thu, 30 May 2019 09:55:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (HIVE-21783) Avoid authentication for connection from the same domain 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/HIVE-21783?focusedWorklogId=250869&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-250869 ] ASF GitHub Bot logged work on HIVE-21783: ----------------------------------------- Author: ASF GitHub Bot Created on: 30/May/19 09:54 Start Date: 30/May/19 09:54 Worklog Time Spent: 10m Work Description: ashutosh-bapat commented on pull request #648: HIVE-21783: Accept Hive connections from the same domain without authentication. URL: https://github.com/apache/hive/pull/648#discussion_r288928805 ########## File path: service/src/java/org/apache/hive/service/auth/PlainSaslHelper.java ########## @@ -75,6 +89,70 @@ private PlainSaslHelper() { throw new UnsupportedOperationException("Can't initialize class"); } + public static final class DualSaslTransportFactory extends TTransportFactory { + TTransportFactory otherFactory; + TTransportFactory noAuthFactory; + String hiveHost; + + public DualSaslTransportFactory(TTransportFactory otherFactory, String hiveHost) + throws LoginException { + this.noAuthFactory = getPlainTransportFactory(AuthMethods.NONE.toString()); + this.otherFactory = otherFactory; + this.hiveHost = hiveHost; + } + + // Return true if the IP address is from the same domain as the server. + private boolean isSameDomainConnection(InetAddress remoteInetAddress) { + String[] hiveHostSplit = null; + if (hiveHost != null) { + hiveHostSplit = hiveHost.split("\\."); + } + + String clientHostName = remoteInetAddress.getCanonicalHostName(); + String[] clientHostSplit = null; + if (clientHostName != null) { + clientHostSplit = clientHostName.split("\\."); + } + + // TODO: the callers should also pass the server address or obtain in by using some other + // method. Then check whether the connection's remote address is from the same domain as + // the server. For now, for the sake of testing, return true. We need to understand what + // exactly it means to have connection from the same domain. + // For now, two hosts are in the same domain if the last two parts in their hostname are same. + if (hiveHostSplit.length >= 2 && clientHostSplit.length >= 2) { Review comment: As per the latest approach, the trusted domain will be configured and thus we do not rely on hivehost to know the trusted domain. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 250869) Time Spent: 1.5h (was: 1h 20m) > Avoid authentication for connection from the same domain > -------------------------------------------------------- > > Key: HIVE-21783 > URL: https://issues.apache.org/jira/browse/HIVE-21783 > Project: Hive > Issue Type: New Feature > Components: HiveServer2 > Reporter: Ashutosh Bapat > Assignee: Ashutosh Bapat > Priority: Major > Labels: pull-request-available > Time Spent: 1.5h > Remaining Estimate: 0h > > When a connection comes from the same domain do not authenticate the user. This is similar to NONE authentication but only for the connection from the same domain. -- This message was sent by Atlassian JIRA (v7.6.3#76005)