HDDS-10604. Whitelist based compliance check for crypto related configuration options#6860
HDDS-10604. Whitelist based compliance check for crypto related configuration options#6860fapifta merged 19 commits intoapache:masterfrom
Conversation
…ionSource Change-Id: Ib6ff17f7ad48e43f9e69cebf5a25859e29f133d6
Change-Id: I9695dae13b90ed798a159d9a2abae15d7702a56f
Change-Id: I0a8a8328056b8b3879cdb4e202a693242812aa06
Change-Id: Ib385f3ac64d459e40549161e85c6c3408ed0e681
Change-Id: I6f21a2f7bca52cc766f4e7869749b8857a01fb35
Change-Id: I0c5606e846010b850f2ebb7bbf59e1a2e24bea16
Change-Id: Ia0fa7e22c3a70f9e09ff680110e0da7dad095e8f
Change-Id: I7a19bb73ed0b3dcb7da2481ce08e697863344ed2
…onfigurationSource. Change-Id: Ic3d66056f3a99b12b790346111e8128b8783c26b
Change-Id: I2e92d45508666d98eb4e7c607c04fa56fcae92b0
fapifta
left a comment
There was a problem hiding this comment.
Thank you for your work on this one @dombizita!
I know we have looked at problems arose in CI runs together, but now as I look at the changes altogether a few things I realized, please find my comments inline with a few suggestions/question/ideas.
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/conf/DelegatingProperties.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/conf/DelegatingProperties.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/conf/OzoneConfiguration.java
Show resolved
Hide resolved
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/conf/OzoneConfiguration.java
Outdated
Show resolved
Hide resolved
...-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/LegacyHadoopConfigurationSource.java
Show resolved
Hide resolved
hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/conf/TestOzoneConfiguration.java
Show resolved
Hide resolved
Change-Id: I7969ce285caae7d4206c867ef196588ca7b4dd98
Change-Id: Id9b6d613eebf1ceefe981fa15138e3a8fbe9d617
Change-Id: If1f8c5685a69b9ea5ddc711317f28b919e127891
Change-Id: Id09e59492a43e0c23c1a9324b1fa8496fdc872a1
Change-Id: Ib05465d46789d455176acff6f3e58fe8ab1b9c9e
Change-Id: If2596dbb206a56a26a3b10ecea697faf2a902fc4
Change-Id: I909c37f15008409511df134c06206df560d70c0c
Change-Id: I7fc507671df1a1f2cae12433ae894d4d7f8522b6
|
With the recent changes I added, when we call the I'll look into this later. |
|
I checked where do we use the entrySet() method in the Configuration class on its Properties (I didn't find usages in other configuration related classes). These are the occurrences:
Based on this, we can say that the only occurrence where we are actually doing something with a configuration value that we got through a props.entrySet() call is handled. But because of the other usages I can't throw an UnsupportedOperationException. I update my patch, so I can see a better CI run, based on the ongoing review I can change it later. |
…et() call Change-Id: I313db78e455b78e0a6efaef4334a122eeee5e420
fapifta
left a comment
There was a problem hiding this comment.
Thank you @dombizita for going after all the possible cases where we use the entryset, and also to summarize it here. It is really pleasant to look at the change overall as it became elegant and simple at the end of the day, so even it took some time, I think it does worth it looking at what we have now.
What changes were proposed in this pull request?
The goal of this is change is that whenever we ask for a configuration option's value, we are ensuring to do the necessary compliance checks.
In Ozone we have:
OzoneConfigurationclass, which extends the Hadoop'sConfigurationclass. It also implements theMutableConfigurationSourceOzone interface.MutableConfigurationSource. This has a Configuration field, which is used to get configuration options.InMemoryConfiguration, which is only used for testing, so I didn't change anything there.I went through the code and checked how do we get configs. Overall we want to ensure if we get any config property, the compliance check went through before returning them. To make this happen, we only need to make sure that the
Configuration#getPropsmethod gives us aPropertiesobject back, thatsgetPropertymethod does the compliance check. I created aDelegatingPropertieshelper class, so we'll delegate the operations to the parent's properties and also do the compliance check in thegetProperty. I also added the compliance check to the Propertiesiterator(), as with that we can access the properties values without calling thegetProperty()method.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10604
How was this patch tested?
Added unit tests, CI: https://github.com/dombizita/ozone/actions/runs/9645109413