[8.x] Support for saved objects name attribute in audit log (#206644)#208680
Merged
kibanamachine merged 1 commit intoelastic:8.xfrom Jan 29, 2025
Merged
[8.x] Support for saved objects name attribute in audit log (#206644)#208680kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine merged 1 commit intoelastic:8.xfrom
Conversation
## Summary
Added support for human readable `name` attribute for saved objects
audit.
- Updated the saved object type/registration with `nameAttribute` option
- Updated the Saved Objects Security Extension to support passing object
names to the audit functions
- Updated the audit logger with a configuration option to opt out of
including saved object names (the SOR and SSC should be aware of this to
avoid operations when they are not necessary)
- Updated Saved Object Repository functions
- [x] `bulkCreate`
- [x] `bulkGet`
- [x] `bulkResolve`
- [x] `bulkUpdate`
- [x] `collectMultiNamespaceReferences`
- [x] `get`
- [x] `updateObjectsSpaces`
- [x] `bulkDelete`
- [x] `delete`
- [x] `removeReferencesTo`
- [x] Updated Secure Spaces Client functions
- [x] `auditObjectsForSpaceDeletion`
Functions that were not updated:
- `authorizeFind` - now we log audit before the actual find with only
types. Find is complex one, that can return a lot of saved objects. The
benefit of adding a separate audit event vs potential performance cost
can be considered negligible.
https://github.com/elastic/kibana/blob/2f6b9f67d8351a5688e9c3753a4a7234e466dc6a/src/core/packages/saved-objects/api-server-internal/src/lib/apis/find.ts#L166
- `deleteByNamespace` - doesn't have an audit log itself, however is
used only along with the `delete` which adds audit log with SO name
https://github.com/elastic/kibana/blob/2f6b9f67d8351a5688e9c3753a4a7234e466dc6a/x-pack/platform/plugins/shared/spaces/server/spaces_client/spaces_client.ts#L223-L225
- `checkConflicts` - audit was intensionally bypassed
https://github.com/elastic/kibana/blob/2f6b9f67d8351a5688e9c3753a4a7234e466dc6a/x-pack/platform/plugins/shared/security/server/saved_objects/saved_objects_security_extension.ts#L945-L948
- `disableLegacyUrlAliases` - function calls `bulkUpdate` in the end
(which adds audit log with SO name already). Adding name to the
`disableLegacyUrlAliases` audit log, will result in double saved objects
get operation which is not feasible.
https://github.com/elastic/kibana/blob/2f6b9f67d8351a5688e9c3753a4a7234e466dc6a/x-pack/platform/plugins/shared/spaces/server/spaces_client/spaces_client.ts#L228-L234
## How to test
Best way to test it is from the `Manage Saved Objects` page with audit
enabled.
- Import some test data set from the main page.
- Go to the `Manage Saved Objects`:
- Update single SO
- Delete singe SO
- Bulk update SOs
- Bulk delete SOs
- Import/export SOs
### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
### Release note
Added support for human readable name attribute for saved objects audit
events.
__Closes: https://github.com/elastic/kibana/issues/200538__
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 7b26912)
14 tasks
Contributor
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
|
|
Hello, in which release of 8.x will this be available please @elena-shostak ? |
Contributor
|
@Danouchka hey, it landed in |
|
Thank you very much , I found it ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.x:Questions ?
Please refer to the Backport tool documentation