fixed plugins unknown setting and disabled_rest_categories#6021
fixed plugins unknown setting and disabled_rest_categories#6021cwperks merged 3 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
|
TY for this PR @ThyTran1402 can you please fix the CHANGELOG conflict error? |
|
Otherwise this PR LGTM! 🚢 |
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
Yup. I already fixed the changelog merge conflict 😃. Thank you for reviewing the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6021 +/- ##
==========================================
+ Coverage 73.88% 73.93% +0.04%
==========================================
Files 440 440
Lines 27229 27265 +36
Branches 4044 4055 +11
==========================================
+ Hits 20119 20159 +40
+ Misses 5199 5193 -6
- Partials 1911 1913 +2
🚀 New features to boost your workflow:
|
| getOrDefault(properties, FilterEntries.IGNORE_USERS.getKey(), DEFAULT_IGNORED_USERS) | ||
| ); | ||
| final List<String> rawIgnoredUsers = getOrDefault(properties, FilterEntries.IGNORE_USERS.getKey(), DEFAULT_IGNORED_USERS); | ||
| final Set<String> ignoredAuditUsers = rawIgnoredUsers.size() == 1 && "NONE".equalsIgnoreCase(rawIgnoredUsers.get(0)) |
There was a problem hiding this comment.
why not filter out NONE from rawIngoredUsers?
There was a problem hiding this comment.
hmmm I think NONE is the sentinel config value, not actual username. It means don't ignore any users. So, rawIngoredUsers holds exactly what's in the config, keeping the input separate from the output logic. If we filtered it, we could lose the information that the user explicitly configured rather than just providing an empty list.
There was a problem hiding this comment.
So, NONE is like special handling not regular filter.
Description
AuditCategory.parse() now treats a single "NONE" value (case-insensitive) as an empty set, consistent with the existing behavior in the static opensearch.yml path. This fixes disabled_rest_categories and disabled_transport_categories for both config paths.
Filter.from(Map) (the dynamic/REST path) now applies the same "NONE" → empty set conversion for ignore_users that fromSettingStringSet() already applied for the static path.
The correct key for opensearch.yml is plugins.security.audit.config.ignore_users (note the .config. segment); using the wrong key plugins.security.audit.ignore_users is a documentation/usage issue — no code change required
Issues Resolved
Testing
Check List
By 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.