drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4280) Kerberos Authentication
Date Wed, 22 Feb 2017 07:31:44 GMT

    [ https://issues.apache.org/jira/browse/DRILL-4280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15877665#comment-15877665
] 

ASF GitHub Bot commented on DRILL-4280:
---------------------------------------

Github user sudheeshkatkam commented on a diff in the pull request:

    https://github.com/apache/drill/pull/578#discussion_r102396769
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataClient.java
---
    @@ -75,27 +87,118 @@ public MessageLite getResponseDefaultInstance(int rpcType) throws
RpcException {
       }
     
       @Override
    -  protected Response handle(DataClientConnection connection, int rpcType, ByteBuf pBody,
ByteBuf dBody) throws RpcException {
    +  protected void handle(DataClientConnection connection, int rpcType, ByteBuf pBody,
ByteBuf dBody,
    +                        ResponseSender sender) throws RpcException {
         throw new UnsupportedOperationException("DataClient is unidirectional by design.");
       }
     
       BufferAllocator getAllocator() {
    -    return allocator;
    +    return config.getAllocator();
       }
     
       @Override
       protected void validateHandshake(BitServerHandshake handshake) throws RpcException
{
         if (handshake.getRpcVersion() != DataRpcConfig.RPC_VERSION) {
    -      throw new RpcException(String.format("Invalid rpc version.  Expected %d, actual
%d.", handshake.getRpcVersion(), DataRpcConfig.RPC_VERSION));
    +      throw new RpcException(String.format("Invalid rpc version.  Expected %d, actual
%d.",
    +          handshake.getRpcVersion(), DataRpcConfig.RPC_VERSION));
    +    }
    +
    +    if (handshake.getAuthenticationMechanismsCount() != 0) { // remote requires authentication
    +      final SaslClient saslClient;
    +      try {
    +        saslClient = config.getAuthFactory(handshake.getAuthenticationMechanismsList())
    +            .createSaslClient(UserGroupInformation.getLoginUser(),
    +                config.getSaslClientProperties(remoteEndpoint));
    +      } catch (final IOException e) {
    +        throw new RpcException(String.format("Failed to initiate authenticate to %s",
remoteEndpoint.getAddress()), e);
    +      }
    +      if (saslClient == null) {
    +        throw new RpcException("Unexpected failure. Could not initiate SASL exchange.");
    +      }
    +      connection.setSaslClient(saslClient);
    +    } else {
    +      if (config.getAuthMechanismToUse() != null) {
    +        throw new RpcException(String.format("Drillbit (%s) does not require auth, but
auth is enabled.",
    +            remoteEndpoint.getAddress()));
    +      }
         }
       }
     
       @Override
    -  protected void finalizeConnection(BitServerHandshake handshake, DataClientConnection
connection) {
    +  protected <M extends MessageLite> RpcCommand<M, DataClientConnection>
    +  getInitialCommand(final RpcCommand<M, DataClientConnection> command) {
    +    if (config.getAuthMechanismToUse() == null) {
    +      return super.getInitialCommand(command);
    +    } else {
    +      return new AuthenticationCommand<>(command);
    --- End diff --
    
    Yes.


> Kerberos Authentication
> -----------------------
>
>                 Key: DRILL-4280
>                 URL: https://issues.apache.org/jira/browse/DRILL-4280
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Keys Botzum
>            Assignee: Sudheesh Katkam
>              Labels: security
>
> Drill should support Kerberos based authentication from clients. This means that both
the ODBC and JDBC drivers as well as the web/REST interfaces should support inbound Kerberos.
For Web this would most likely be SPNEGO while for ODBC and JDBC this will be more generic
Kerberos.
> Since Hive and much of Hadoop supports Kerberos there is a potential for a lot of reuse
of ideas if not implementation.
> Note that this is related to but not the same as https://issues.apache.org/jira/browse/DRILL-3584




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message