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

Encrypted saved objects plugin to allow specifying a custom id on create #42688

Closed
mikecote opened this issue Aug 6, 2019 · 9 comments · Fixed by #83482
Closed

Encrypted saved objects plugin to allow specifying a custom id on create #42688

mikecote opened this issue Aug 6, 2019 · 9 comments · Fixed by #83482
Labels
enhancement New value added to drive a business result Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@mikecote
Copy link
Contributor

mikecote commented Aug 6, 2019

Use case (short version)

Making task manager use encrypted saved objects would need to keep the functionality of specifying ids when scheduling tasks.

Use case (long version)

Alerts will soon contain API keys to allow executing requests on behalf of the user. When the alert fires actions, those actions also need to execute requests on behalf of the creator of the alert and not the creator of the action. Task manager sits between alerts and actions to handle scaling and error handling.

In order to have alerts pass the API key to an action, I was thinking of storing them within the task. We could convert task saved object type to use encrypted saved objects (ESO) and encrypt a specific attribute. One feature missing in ESO is the ability to specify ids on create. Task manager supports this and isn't something that can be rolled back.

@mikecote mikecote added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! enhancement New value added to drive a business result labels Aug 6, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security

@kobelb
Copy link
Contributor

kobelb commented Aug 6, 2019

Is task manager using a UUID as the ID currently?

@mikecote
Copy link
Contributor Author

mikecote commented Aug 6, 2019

@kobelb it's now using whatever the saved objects client is providing to generate ids (when an id is not provided).

@kobelb
Copy link
Contributor

kobelb commented Aug 6, 2019

@kobelb it's now using whatever the saved objects client is providing to generate ids (when an id is not provided).

I'm confused. If you're using the SavedObjectsClient itself to generate IDs, why can't the ESO specify the ID?

@mikecote
Copy link
Contributor Author

mikecote commented Aug 6, 2019

Everything with ESO works fine when using generated IDs. When providing custom ids (since task manager supports both) ESO throws an error here https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/encrypted_saved_objects/server/lib/encrypted_saved_objects_client_wrapper.ts#L56-L58.

@kobelb
Copy link
Contributor

kobelb commented Aug 6, 2019

When task manager specifies an ID, is it always a UUID?

@mikecote
Copy link
Contributor Author

mikecote commented Aug 6, 2019

Most of the time it will be a reserved word, something like Maps-${TELEMETRY_TASK_TYPE} https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/maps/server/maps_telemetry/telemetry_task.js#L11. This allows to reference a scheduled task programatically at a future time, avoid duplication in scheduling, etc.

@kobelb
Copy link
Contributor

kobelb commented Aug 6, 2019

Most of the time it will be a reserved word, something like Maps-${TELEMETRY_TASK_TYPE} https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/maps/server/maps_telemetry/telemetry_task.js#L11. This allows to reference a scheduled task programatically at a future time, avoid duplication in scheduling, etc.

Thanks. I was hoping we could validate that the provided ID was a UUID v4, but it sounds like to support your use-case we'd need to allow any arbitrary ID.

@mikecote
Copy link
Contributor Author

mikecote commented Aug 6, 2019

Correct, they can be anything the developer wants (in task manager's case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
3 participants