You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "fapifta (via GitHub)" <gi...@apache.org> on 2024/06/04 08:26:03 UTC
[PR] HDDS-10935. Create hdds-crypto module. [ozone]
fapifta opened a new pull request, #6770:
URL: https://github.com/apache/ozone/pull/6770
## What changes were proposed in this pull request?
In this pull request I am adding a new module as part of the preparation for crypto compliance. The new hdds-crypto module based on the design doc (#6685) will be the home of the general parts of our cryptography related code.
The module's aim is to provide the basic interfaces those that a specific compliance module will need to implement, and configuration related logic which may also define extension points for compliance implementations.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10935
## How was this patch tested?
A local build succeeded with the provided pom.xml, no further test beyond that is required.
--
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
Re: [PR] HDDS-10935. Create hdds-crypto and hdds-crypto-default modules. [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #6770:
URL: https://github.com/apache/ozone/pull/6770#discussion_r1635981509
##########
hadoop-hdds/crypto-default/pom.xml:
##########
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ 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. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>hdds-crypto-default</artifactId>
Review Comment:
Based on the design doc (#6685), this should be `hdds-crypto-unrestricted`. It is established as the default implementation by the default value for the config property:
https://github.com/apache/ozone/blob/c5532a8061dab4a39fad711b7a94cd7f52406ab6/hadoop-hdds/common/src/main/resources/ozone-default.xml#L1925-L1933
If the module is named `hdds-crypto-default`, we'll need to update the default value for `ozone.security.crypto.compliance.mode`. And having a default value of `default` seems kind of meaningless.
--
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
Re: [PR] HDDS-10935. Create hdds-crypto and hdds-crypto-default modules. [ozone]
Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta commented on code in PR #6770:
URL: https://github.com/apache/ozone/pull/6770#discussion_r1645154067
##########
hadoop-hdds/crypto-default/pom.xml:
##########
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ 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. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>hdds-crypto-default</artifactId>
Review Comment:
Thank you for remaining engaged on this review @adoroszlai, after doing the change, I also had a feeling that I don't particularly in fond of this name, however I was curious what do you think.
Now, after we ran a circle... I started to hesitate, and I am somewhere in between the `-interface` and the `-api` suffix, slightly on the side of `-api`. Let me explain how my mind plays tricks with me and changes direction after every comment you make.
The first thought of using `-interface` was a bit mindless, and after checking the project to do the rename, I realized that it is a prefix not a suffix in other modules. As a prefix looking at the `interface-*` modules' contents, my understanding is that, we express that a module defines a protocol/interface between services and clients, and in light of this realization I started to change my mind about the `interface` as a prefix for hdds-crypto.
Now that you are also expressing the same feeling, and suggest to use it as a suffix instead, I feel that using `-interface` as a suffix would overload this meaning, that is why I turn back towards the `-api` suffix, as it seems to be more appropriate to do not overload the meaning of `interface`.
So all in all, what if we go back to your initial suggestion and use `-api`?
--
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
Re: [PR] HDDS-10935. Create hdds-crypto and hdds-crypto-default modules. [ozone]
Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta commented on code in PR #6770:
URL: https://github.com/apache/ozone/pull/6770#discussion_r1642716901
##########
hadoop-hdds/crypto-default/pom.xml:
##########
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ 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. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>hdds-crypto-default</artifactId>
Review Comment:
@adoroszlai I like the idea of having a more specific name to the base module that contain the interfaces and potentially some generic logic. One question came to my mind, we use `-interface` as a suffix for a couple of modules already, even though they are defining proto interfaces for different purposes, wouldn't it be more consistent to use the `hdds-crypto-interface` as the name?
--
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
Re: [PR] HDDS-10935. Create hdds-crypto and hdds-crypto-default modules. [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #6770:
URL: https://github.com/apache/ozone/pull/6770#discussion_r1644687570
##########
hadoop-hdds/crypto-default/pom.xml:
##########
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ 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. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>hdds-crypto-default</artifactId>
Review Comment:
I think we should preserve the existing `interface-` prefix naming convention for modules with (mostly) proto interface definitions. In those cases there is no corresponding proper "implementation" module.
For crypto (and other APIs we may introduce in the future), I'd use it as a suffix.
--
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
Re: [PR] HDDS-10935. Create hdds-crypto and hdds-crypto-default modules. [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #6770:
URL: https://github.com/apache/ozone/pull/6770#discussion_r1642720823
##########
hadoop-hdds/crypto-default/pom.xml:
##########
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ 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. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>hdds-crypto-default</artifactId>
Review Comment:
@fapifta `-interface` is fine for me, too. Ratis uses `-api`.
--
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
Re: [PR] HDDS-10935. Create hdds-crypto and hdds-crypto-default modules. [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #6770:
URL: https://github.com/apache/ozone/pull/6770#discussion_r1637734841
##########
hadoop-hdds/crypto-default/pom.xml:
##########
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ 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. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>hdds-crypto-default</artifactId>
Review Comment:
Thanks @fapifta for the explanation. If module name is not used when selecting the implementation, no need to include `unrestricted` in it.
One more question: how about renaming the API module to `hdds-crypto-api`?
--
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
Re: [PR] HDDS-10935. Create hdds-crypto module. [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #6770:
URL: https://github.com/apache/ozone/pull/6770#issuecomment-2155481527
Thanks @fapifta for the patch. Is there any interface we can add in the initial patch? If not, can we combine this with the `hdds-crypto-default` module, which is also empty in its initial PR?
--
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
Re: [PR] HDDS-10935. Create hdds-crypto and hdds-crypto-default modules. [ozone]
Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta commented on code in PR #6770:
URL: https://github.com/apache/ozone/pull/6770#discussion_r1644671586
##########
hadoop-hdds/crypto-default/pom.xml:
##########
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ 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. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>hdds-crypto-default</artifactId>
Review Comment:
I have renamed the module keeping our naming convention, the name of the folder became "interface-crypto", and the name of the module became "hdds-interface-crypto", @adoroszlai please take a look if it is better this way (I am not that sure now after I did it and looked at 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
Re: [PR] HDDS-10935. Create hdds-crypto and hdds-crypto-default modules. [ozone]
Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta commented on PR #6770:
URL: https://github.com/apache/ozone/pull/6770#issuecomment-2159502628
@adoroszlai thank you for the review.
I have merged the two PR together, and administered the changes in the JIRA tickets and in the related PRs.
At the moment the content is unclear yet, as it depends on some outstanding PRs, and some further changes we need to do, however the modules can be created in parallel.
If you think it is better to move at least some functionality to the modules before we push them, I am open to that also, please let me know if you prefer that approach more, in that case I will move this PR to draft until we can start to push the first things into these new modules.
--
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
Re: [PR] HDDS-10935. Create hdds-crypto and hdds-crypto-default modules. [ozone]
Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta commented on code in PR #6770:
URL: https://github.com/apache/ozone/pull/6770#discussion_r1637166886
##########
hadoop-hdds/crypto-default/pom.xml:
##########
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ 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. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ozone</groupId>
+ <artifactId>hdds</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>hdds-crypto-default</artifactId>
Review Comment:
Thank you for bringing this up @adoroszlai, you are absolutely right, this conflict I tried to resolve in the PR description, but let me re-iterate that a bit.
So, yeah... naming things is always hard, here is my thought process on this as of now:
It is reasonable to use the value `unrestricted` as the `ozone.security.crypto.compliance.mode` property's default value, because this value aims to express that the default implementation is not restricted by any compliance mechanism in any jurisdiction. The unrestricted mode is usable in all the cases where the cluster is not falling under any regulation, and does not need to comply with any restrictions on crypto usage.
On the other hand, it is reasonable to use `default` in the module name, as it expresses the fact that the module contains our default implementation to the crypto module, which is most likely non-compliant in any jurisdictions.
All in all as I said, you are right, and thank you for pointing it out that the design doc explicitly suggests a different naming, but I came to this conclusion about the naming of the module later on when I got to really name these. In this sense I believe the design doc is the one that needs to be updated to conform with the approach I propose here.
Also note that, the design doc at least in between the lines implies that the name is important, but actually it is not, as at the end of the day, the module will be just a jar on the classpath, and the proper implementation won't be selected based on the module/jar name, but based on the content. The Service Provider Interface based approach gives us the opportunity to register the `default` module (/provider) to the `unrestricted` property value without any significant complexity or sophisticated logic added.
Please let me know if you can agree, however if you have any other reasonable naming I am happy to change my mind on this. At the moment I firmly believe we do not benefit from either using `unrestricted` in the module name or `default` in the property value, but both ways I think we loose the possibility of expressing our explicit intent within these two different contexts.
--
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