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

Verify Usage of Opensearch Core System and Hidden Indices #3163

Closed
Tracked by #9239
Rishikesh1159 opened this issue Aug 11, 2023 · 2 comments
Closed
Tracked by #9239

Verify Usage of Opensearch Core System and Hidden Indices #3163

Rishikesh1159 opened this issue Aug 11, 2023 · 2 comments
Labels
enhancement New feature or request untriaged Require the attention of the repository maintainers and may need to be prioritized

Comments

@Rishikesh1159
Copy link
Member

Rishikesh1159 commented Aug 11, 2023

Description/Concept of System Indices and Hidden Indices on Opensearch core:

System Index - An index must extend system index plugin for a index to be called as system index.
Example: Security Plugin correctly extends and uses system Indices, more info here

Hidden index - An index must have hidden SETTING_INDEX_HIDDEN = "index.hidden" set on the index setting to call it as hidden. It doesn't matter if it starts with "." or not.
Example: Asynchronous-Search plugin correctly sets the index setting value here

Misconception:

Many plugins still misunderstand the actual definition of system and hidden indices. Usual misconception is that any index starting with . like .indexName is a system or hidden index, but this is incorrect. Any user can create an index with .indexName which is neither a system or hidden index. So users can mistakenly still create index starting with "." there is nothing stopping them from doing it.

To avoid this misconception all plugins should adopt/on-board with concept of system and hidden indices defined in opensearch core.

Goal:

The main ask of this issue is to make sure all plugins having/using system and hidden indices must on-board/adopt with concept defined in opensearch core.

Any plugin already on-board with opensearch core defined concept of system and hidden indices can ignore this issue and close the issue as completed on the plugin repo.

Additional info:

The following info provided below is not necessary for system/hidden indices, but might be useful info for plugins using system indices :

If your system indices need additonal security features/benefits provided by security plugin, follow the steps provided here. But to make sure these are additonal features provided by security plugin and it is completely decoupled from concept of system indices. It is upto the plugin owners to decide if they need these additional security benefits.

Open questions

In case of any questions or issues, please post it in core issue

@Rishikesh1159 Rishikesh1159 added enhancement New feature or request untriaged Require the attention of the repository maintainers and may need to be prioritized labels Aug 11, 2023
@cwperks
Copy link
Member

cwperks commented Aug 14, 2023

Hi @Rishikesh1159 , I agree that system indexes are confusing. SystemIndexPlugin.getSystemIndexDescriptors is the way to officially declare a system index/system index pattern from a plugin, but from Security's POV there is still one more area to register the index if a plugin wishes to get system index protection from the security plugin. The index would also need to be added in this list

# For example:

plugins.security.system_indices.enabled: true
plugins.security.system_indices.indices: [".plugins-ml-config", ".plugins-ml-connector", ".plugins-ml-model-group", ".plugins-ml-model", ".plugins-ml-task", ".opendistro-alerting-config", ".opendistro-alerting-alert*", ".opendistro-anomaly-results*", ".opendistro-anomaly-detector*", ".opendistro-anomaly-checkpoints", ".opendistro-anomaly-detection-state", ".opendistro-reports-*", ".opensearch-notifications-*", ".opensearch-notebooks", ".opensearch-observability", ".ql-datasources", ".opendistro-asynchronous-search-response*", ".replication-metadata-store", ".opensearch-knn-models", ".geospatial-ip2geo-data*"]

System index protection means that not even an admin can meddle with the index. The only user permitted to meddle with a system index is a user connecting with the admin certificate or a plugin after they have stashed the thread context and operate in a trusted local mode.

Not to add more confusion to system indices, but the security plugin also has a notion of protected indices which are indices that are given special protections, but are not system indices.

Do you have any documentation on system indices and what core does specific to system indices? From what I understand OpenSearch autocreates a system index if it has not already been created and a document is indexed. The system indices may also get precedence for queries, but is this documented somewhere outside of code?

@scrawfor99
Copy link
Collaborator

[Triage] @cwperks has confirmed usage in Security plugin. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged Require the attention of the repository maintainers and may need to be prioritized
Projects
None yet
Development

No branches or pull requests

3 participants