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

[Saved Objects] Add ability to know when a onCopy happens vs onExport #109190

Closed
FrankHassanabad opened this issue Aug 19, 2021 · 3 comments
Closed
Labels
Feature:Detection Alerts Security Solution Detection Alerts Feature Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Detections and Resp Security Detection Response Team

Comments

@FrankHassanabad
Copy link
Contributor

FrankHassanabad commented Aug 19, 2021

Parent Meta: #109169

Describe the feature:
In the existing implementation, the Kibana core onExport is called for both copying and for exporting saved objects. The export option for rules already removes particular fields such as apiKey, apiKeyOwner, scheduledTaskId. Export also sets the value of enabled to be false.

However, on copying a rule and its references, we will need to re-provision the apiKey, apiKeyOwner and then update other fields such as updated_at, updated_by as well as do deep copying of exception lists so that the list_id and any other fields are not shallow linked between each other.

Describe a specific use case for the feature:
As a platform engineer, when I export vs. when I do a copy I need the Saved Object (SO) types of rules, exception lists, etc... to behave in two different ways.

The export functionality should preserve common fields such as updated_by, updated_at, etc...
The copying functionality should update these values to new values of last updated, who last updated it, etc.... The created_at, created_by should change to the author of who is copying it unless other examples show something different.

@FrankHassanabad FrankHassanabad added the Team:Detections and Resp Security Detection Response Team label Aug 19, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@FrankHassanabad FrankHassanabad changed the title [Saved Object Management] Add ability to know when a onCopy vs onExport is happening [Saved Object Management] Add ability to know when a onCopy happens vs onExport Aug 19, 2021
@FrankHassanabad FrankHassanabad added Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Aug 19, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@FrankHassanabad FrankHassanabad added the Feature:Detection Alerts Security Solution Detection Alerts Feature label Aug 19, 2021
@FrankHassanabad FrankHassanabad changed the title [Saved Object Management] Add ability to know when a onCopy happens vs onExport [Saved Objects] Add ability to know when a onCopy happens vs onExport Aug 19, 2021
@pgayvallet
Copy link
Contributor

As discussed, adding a purpose option to the exporter's exportByTypes and exportByObjects APIs, and then re-expose them it in the export context provided to the type owners via SavedObjectsExportTransformContext

@FrankHassanabad FrankHassanabad closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Detection Alerts Security Solution Detection Alerts Feature Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Detections and Resp Security Detection Response Team
Projects
None yet
Development

No branches or pull requests

3 participants