Skip to content
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

Handle the audit config being null #4650

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

merlinz01
Copy link
Contributor

This was causing an error if the audit config was null and was posted to the event bus.

Description

  • Category: Bugfix
  • Why these changes are required? An empty audit config causes the logs to be filled with an irrelevant error.
  • What is the old behavior before changes and new behavior after changes?
    Old behavior:
    Lots of errors when the audit config is missing
    New behavior:
    Audit config is set to the default when missing

Issues Resolved

#4315
https://forum.opensearch.org/t/ava-lang-nullpointerexception-cannot-invoke-object-getclass-because-event-is-null/20821/

Is this a backport? No.
Do these changes introduce new permission(s) to be displayed in the static dropdown on the front-end? No.

Testing

None

Check List

  • New functionality includes testing
  • New functionality has been documented
  • New Roles/Permissions have a corresponding security dashboards plugin PR
  • API changes companion pull request created
  • Commits are signed per the DCO using --signoff

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.

This was causing an error if the audit config was null and was posted to the event bus.

Signed-off-by: Merlin <na@notaccessible.xyz>
@cwperks
Copy link
Member

cwperks commented Aug 16, 2024

reason: AuditConfig() has private access in AuditConfig

Would a different constructor work? i.e. new AuditConfig(false, Filter.DEFAULT, ComplianceConfig.DEFAULT)?

Signed-off-by: Merlin <na@notaccessible.xyz>
@merlinz01
Copy link
Contributor Author

Trying AuditConfig.from(Settings.EMPTY) as done here for ComplianceConfig.

@cwperks cwperks added the backport 2.x backport to 2.x branch label Aug 16, 2024
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 65.26%. Comparing base (ec9fadb) to head (438afdf).
Report is 7 commits behind head on main.

Files Patch % Lines
...ch/security/securityconf/DynamicConfigFactory.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4650   +/-   ##
=======================================
  Coverage   65.26%   65.26%           
=======================================
  Files         317      317           
  Lines       22311    22312    +1     
  Branches     3588     3589    +1     
=======================================
+ Hits        14562    14563    +1     
  Misses       5954     5954           
  Partials     1795     1795           
Files Coverage Δ
...ch/security/securityconf/DynamicConfigFactory.java 55.29% <50.00%> (-0.33%) ⬇️

... and 2 files with indirect coverage changes

@cwperks cwperks merged commit d76bbfb into opensearch-project:main Aug 19, 2024
42 of 43 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 19, 2024
Signed-off-by: Merlin <na@notaccessible.xyz>
(cherry picked from commit d76bbfb)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@merlinz01 merlinz01 deleted the handle-null-audit-error branch August 19, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants