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

[SOM] Add visibleInManagement option to management metadata #112073

Merged

Conversation

pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented Sep 14, 2021

Summary

Fix #110146

Introduce a new visibleInManagement configuration option in SavedObjectType.management to allow type owners to define a type as exportable while hiding it from the SOM user interface.

Refer to #110146 for more functional details.

Checklist

@pgayvallet pgayvallet added Feature:Saved Objects Management release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.16.0 v8.0.0 labels Sep 14, 2021
Comment on lines 19 to 21
.getImportableAndExportableTypes()
.filter((type) => type.management!.visibleInManagement ?? true)
.map((type) => type.name);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I could have added the same filtering in other SOM routes (e.g find, scroll_count), but I think it's not worth it because:

  • The list of type from the _allowed_types endpoint is the source of truth for the UI regarding the types the user can search for or list in the SOM
  • Even if the user was to manually call the SOM endpoint while specifying types that are exportable but not visible in management, it's not a vulnerability or a privilege escalation, as it would have been allowed to do the same using the public SO apis)

@pgayvallet pgayvallet marked this pull request as ready for review September 15, 2021 08:45
@pgayvallet pgayvallet requested a review from a team as a code owner September 15, 2021 08:45
@elasticmachine
Copy link
Contributor

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


describe('types with `visibleInManagement` ', () => {
before(async () => {
await esArchiver.load(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It's not documented anywhere but the operations team wants everyone to move to using the import/export API instead of esArchiver

Meta issue: #102552
PR introducing kibanaServer.importExport API for tests #92526

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

API count

id before after diff
core 2283 2284 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@pgayvallet pgayvallet added the auto-backport Deprecated - use backport:version if exact versions are needed label Sep 21, 2021
@pgayvallet pgayvallet merged commit 221ee74 into elastic:master Sep 21, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 21, 2021
…c#112073)

* implement SavedObjectsTypeManagementDefinition.visibleInManagement

* update generated doc

* improve FTR tests

* fix FTR test
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Sep 21, 2021
… (#112639)

* implement SavedObjectsTypeManagementDefinition.visibleInManagement

* update generated doc

* improve FTR tests

* fix FTR test

Co-authored-by: Pierre Gayvallet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Saved Objects Management release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SavedObjects] Ability to allow a type to be importable without it showing in the UI
4 participants