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

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

                Author: ASF GitHub Bot
            Created on: 05/Sep/19 16:50
            Start Date: 05/Sep/19 16:50
    Worklog Time Spent: 10m 
      Work Description: anuengineer 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_r321372069
 
 

 ##########
 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:
   Yes, And see my comment above. The fact that Illegal key size is the result 
of Java Security policy is not very obvious. If you can add that to your throw 
or log statement, it would be really good. Then the user realizes why it is 
failing. The issue more precisely is that this is client code; we have no 
control over where or on what machines this code is run. It is quite possible 
that when the Ozone cluster is being setup the Admins installed the right 
policy; but some client machine may not have that. If the key has been written 
by a client with 256 bits length, then the new client has no choice but the use 
the same algorithm to decode it. Communicating that issue to the user might 
save some pain for them.
 
----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 307322)
    Time Spent: 4h 20m  (was: 4h 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: 4h 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to