[ 
https://issues.apache.org/jira/browse/HDDS-2015?focusedWorklogId=306582&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-306582
 ]

ASF GitHub Bot logged work on HDDS-2015:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Sep/19 17:55
            Start Date: 04/Sep/19 17:55
    Worklog Time Spent: 10m 
      Work Description: dineshchitlangia commented on pull request #1386: 
HDDS-2015. Encrypt/decrypt key using symmetric key while writing/reading
URL: https://github.com/apache/hadoop/pull/1386#discussion_r320893985
 
 

 ##########
 File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
 ##########
 @@ -601,6 +605,16 @@ public OzoneOutputStream createKey(
     HddsClientUtils.verifyResourceName(volumeName, bucketName);
     HddsClientUtils.checkNotNull(keyName, type, factor);
     String requestId = UUID.randomUUID().toString();
+
+    if(Boolean.valueOf(metadata.get(OzoneConsts.GDPR_FLAG))){
+      try{
+        GDPRSymmetricKey gKey = new GDPRSymmetricKey();
+        metadata.putAll(gKey.getKeyDetails());
+      }catch (Exception e) {
+        throw new IOException(e);
 
 Review comment:
   @ajayydv The only time this line would create an exception is when the host 
does not have JCE policy jars installed as the default secret is 32 chars and 
without the JCE policy jars it would throw "java.security.InvalidKeyException: 
Illegal key size or default parameters". Since we are throwing the exception 
and not bypassing it without successful key generation, a debug statement won't 
add much value.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 306582)
    Time Spent: 3h 20m  (was: 3h 10m)

> Encrypt/decrypt key using symmetric key while writing/reading
> -------------------------------------------------------------
>
>                 Key: HDDS-2015
>                 URL: https://issues.apache.org/jira/browse/HDDS-2015
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Dinesh Chitlangia
>            Assignee: Dinesh Chitlangia
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> *Key Write Path (Encryption)*
> When a bucket metadata has gdprEnabled=true, we generate the GDPRSymmetricKey 
> and add it to Key Metadata before we create the Key.
> This ensures that key is encrypted before writing.
> *Key Read Path(Decryption)*
> While reading the Key, we check for gdprEnabled=true and they get the 
> GDPRSymmetricKey based on secret/algorithm as fetched from Key Metadata.
> Create a stream to decrypt the key and pass it on to client.
> *Test*
> Create Key in GDPR Enabled Bucket -> Read Key -> Verify content is as 
> expected -> Update Key Metadata to remove the gdprEnabled flag -> Read Key -> 
> Confirm the content is not as expected.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to