You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/10/27 22:19:03 UTC

[GitHub] [ozone] bharatviswa504 opened a new pull request #2778: HDDS-5884. OM Validate S3 Auth for write requests.

bharatviswa504 opened a new pull request #2778:
URL: https://github.com/apache/ozone/pull/2778


   Co-authored-by: Neil Joshi <ne...@gmail.com>
   
   ## What changes were proposed in this pull request?
   When OMRequest has S3Authentication for write requests validate S3Authentication and then proceed with processing the request.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5884
   
   ## How was this patch tested?
   
   Added tests.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on pull request #2778: HDDS-5884. OM Validate S3 Auth for write requests.

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2778:
URL: https://github.com/apache/ozone/pull/2778#issuecomment-953354029


   cc @kerneltime 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] kerneltime commented on pull request #2778: HDDS-5884. OM Validate S3 Auth for write requests.

Posted by GitBox <gi...@apache.org>.
kerneltime commented on pull request #2778:
URL: https://github.com/apache/ozone/pull/2778#issuecomment-953988214


   cc @neils-dev 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] avijayanhwx commented on a change in pull request #2778: HDDS-5884. OM Validate S3 Auth for write requests.

Posted by GitBox <gi...@apache.org>.
avijayanhwx commented on a change in pull request #2778:
URL: https://github.com/apache/ozone/pull/2778#discussion_r738570389



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/S3SecurityUtil.java
##########
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership.  The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.hadoop.ozone.security;
+
+import org.apache.hadoop.hdds.annotation.InterfaceAudience;
+import org.apache.hadoop.hdds.annotation.InterfaceStability;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.exceptions.OMException;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.S3Authentication;
+import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB;
+import org.apache.hadoop.security.token.SecretManager;
+
+import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.INVALID_TOKEN;
+import static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMTokenProto.Type.S3AUTHINFO;
+
+/**
+ * Utility class which holds methods required for parse/validation of
+ * S3 Authentication Information which is part of OMRequest.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public final class S3SecurityUtil {
+
+  private S3SecurityUtil() {
+  }
+
+  /**
+   * Validate S3 Credentials which are part of {@link OMRequest}.
+   *
+   * If validation is successful returns, else throw {@link OMException}
+   * @throws OMException
+   */
+  public static void validateS3Credential(OMRequest omRequest,
+      OzoneManager ozoneManager) throws OMException {
+    if (ozoneManager.isSecurityEnabled()) {
+      if (omRequest.hasS3Authentication()) {

Review comment:
       Do we need to check this again here, given we already checked in OzoneManagerProtocolServerSideTranslatorPB.java#140?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on pull request #2778: HDDS-5884. OM Validate S3 Auth for write requests.

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2778:
URL: https://github.com/apache/ozone/pull/2778#issuecomment-954270903


   Thank You @avijayanhwx for the review


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2778: HDDS-5884. OM Validate S3 Auth for write requests.

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2778:
URL: https://github.com/apache/ozone/pull/2778#discussion_r738597640



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/S3SecurityUtil.java
##########
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership.  The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.hadoop.ozone.security;
+
+import org.apache.hadoop.hdds.annotation.InterfaceAudience;
+import org.apache.hadoop.hdds.annotation.InterfaceStability;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.exceptions.OMException;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.S3Authentication;
+import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB;
+import org.apache.hadoop.security.token.SecretManager;
+
+import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.INVALID_TOKEN;
+import static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMTokenProto.Type.S3AUTHINFO;
+
+/**
+ * Utility class which holds methods required for parse/validation of
+ * S3 Authentication Information which is part of OMRequest.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public final class S3SecurityUtil {
+
+  private S3SecurityUtil() {
+  }
+
+  /**
+   * Validate S3 Credentials which are part of {@link OMRequest}.
+   *
+   * If validation is successful returns, else throw {@link OMException}
+   * @throws OMException
+   */
+  public static void validateS3Credential(OMRequest omRequest,
+      OzoneManager ozoneManager) throws OMException {
+    if (ozoneManager.isSecurityEnabled()) {
+      if (omRequest.hasS3Authentication()) {

Review comment:
       @avijayanhwx I have another Jira HDDS-5885 can i do this as part of that. So that I donot need to wait for Clean CI run, as to get Clean CI due to unstable run's it is taking 2-3 runs.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 merged pull request #2778: HDDS-5884. OM Validate S3 Auth for write requests.

Posted by GitBox <gi...@apache.org>.
bharatviswa504 merged pull request #2778:
URL: https://github.com/apache/ozone/pull/2778


   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2778: HDDS-5884. OM Validate S3 Auth for write requests.

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2778:
URL: https://github.com/apache/ozone/pull/2778#discussion_r738815084



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/S3SecurityUtil.java
##########
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership.  The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.hadoop.ozone.security;
+
+import org.apache.hadoop.hdds.annotation.InterfaceAudience;
+import org.apache.hadoop.hdds.annotation.InterfaceStability;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.exceptions.OMException;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.S3Authentication;
+import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB;
+import org.apache.hadoop.security.token.SecretManager;
+
+import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.INVALID_TOKEN;
+import static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMTokenProto.Type.S3AUTHINFO;
+
+/**
+ * Utility class which holds methods required for parse/validation of
+ * S3 Authentication Information which is part of OMRequest.
+ */
+@InterfaceAudience.Private
+@InterfaceStability.Evolving
+public final class S3SecurityUtil {
+
+  private S3SecurityUtil() {
+  }
+
+  /**
+   * Validate S3 Credentials which are part of {@link OMRequest}.
+   *
+   * If validation is successful returns, else throw {@link OMException}
+   * @throws OMException
+   */
+  public static void validateS3Credential(OMRequest omRequest,
+      OzoneManager ozoneManager) throws OMException {
+    if (ozoneManager.isSecurityEnabled()) {
+      if (omRequest.hasS3Authentication()) {

Review comment:
       @avijayanhwx discussed offline he is fine with it.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org