-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing settings to plugin allowed list #1814
Conversation
Created FilterEntries enum, as the filter keys/namespaced-keys are used in more than once spot if we add a new filter key, we need a way to know if the entries were updated in the otherside of the codebase where the defaults are used. In the settings configuration, if a new enum value is added and not included a runtime exception will fire on startup, ensuring new settings are always included. This could be better where the enum defines the default values and how the settings are extracted from json, but that would be a considerable larger scope with the inclusion of generics. Signed-off-by: Peter Nied <[email protected]>
src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Moving back to draft until all test cases have been fix |
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
@@ -130,9 +131,9 @@ public static AuditConfig from(final Settings settings) { | |||
*/ | |||
@JsonInclude(JsonInclude.Include.NON_NULL) | |||
public static class Filter { | |||
private static Set<String> FIELDS = DefaultObjectMapper.getFields(Filter.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After adding changes to the .from
method, this made the order of these static fields was incorrect causing static constructors to fail. A great reminder to use lazy loading avoiding static order of operations management.
…it config Signed-off-by: Peter Nied <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1814 +/- ##
============================================
+ Coverage 60.87% 61.00% +0.13%
- Complexity 3215 3226 +11
============================================
Files 256 256
Lines 18012 18050 +38
Branches 3211 3212 +1
============================================
+ Hits 10965 11012 +47
+ Misses 5467 5459 -8
+ Partials 1580 1579 -1
Continue to review full report at Codecov.
|
@opensearch-project/security Could I get a review on this pull request? |
@peternied Could you please explain what the root cause of the issue #1581 is? That'll help me understand how this PR fixes the issue. |
1 similar comment
@peternied Could you please explain what the root cause of the issue #1581 is? That'll help me understand how this PR fixes the issue. |
@cliu123 I've updated the description with the root cause/the nature of the fix.
|
@peternied Please merge when you are ready. |
There is an issue with the main branch build process, I am going to hold off on merging until it has been resolved |
* Add missing settings to plugin allowed list As settings have migrated from opendistro_security -> plugins.security, there were missed settings for the audit filter entries. This caused unknown setting errors when starting OpenSearch, and these settings values were not being applied correctly affecting the runtime behavior of the audit log filters. Signed-off-by: Stephen Crawford <[email protected]>
* Add missing settings to plugin allowed list As settings have migrated from opendistro_security -> plugins.security, there were missed settings for the audit filter entries. This caused unknown setting errors when starting OpenSearch, and these settings values were not being applied correctly affecting the runtime behavior of the audit log filters.
Description
As settings have migrated from
opendistro_security
->plugins.security
, there were missed settings for the audit filter entries. This causedunknown setting
errors when starting OpenSearch, and these settings values were not being applied correctly affecting the runtime behavior of the audit log filters.Created FilterEntries enum, as the filter keys/namespaced-keys are used
in more than once spot if we add a new filter key, we need a way to know
if the entries were updated in the otherside of the codebase where the
defaults are used. In the settings configuration, if a new enum value
is added and not included a runtime exception will fire on startup,
ensuring new settings are always included.
This could be better where the enum defines the default values and how
the settings are extracted from json, but that would be a considerable
larger scope with the inclusion of generics.
Signed-off-by: Peter Nied [email protected]
Issues Resolved
Check List
New functionality has been documentedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.