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 decryption in saved object find with partial fields #200049

Open
jeramysoucy opened this issue Nov 13, 2024 · 1 comment
Open

Handle decryption in saved object find with partial fields #200049

jeramysoucy opened this issue Nov 13, 2024 · 1 comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Security/Encrypted Saved Objects Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@jeramysoucy
Copy link
Contributor

Related: #198703

Description

The saved object repository's find function allows partial objects to be retrieved via the SavedObjectsFindOptions.fields parameter. When this occurs, the partial documents do not undergo migration, however, decryption is still attempted on any attributes with dangerouslyExposeValue set to true.

Decryption will fail if:

  • find is used to resolve encrypted saved object types AND
  • those types define encrypted attributes with dangerouslyExposeValue set to true AND
  • the SavedObjectsFindOptions.fields parameter contains one of the encrypted attributes that is "dangerously exposed" AND
  • the SavedObjectsFindOptions.fields parameter does not include all of the AAD attributes

Note: The find function handles decryption failures gracefully, however, an error log is generated for every decryption failure that occurs. Our serverless dashboards and alerts will pick up this failure without knowing the context.

This case may never occur, but because it is possible, it should be handled appropriately.

Potential solution

One solution would be to first determine if the find parameters target dangerously exposed encrypted attributes, and if it does, augment the fields parameter value with the required AAD fields in order to perform decryption successfully. The additional fields could be stripped from the objects before returning the response.

@jeramysoucy jeramysoucy added bug Fixes for quality problems that affect the customer experience Feature:Security/Encrypted Saved Objects Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Nov 13, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Security/Encrypted Saved Objects Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

No branches or pull requests

2 participants