Skip to content

Conversation

@JVerwolf
Copy link
Contributor

@JVerwolf JVerwolf commented Jan 30, 2025

Reverts #121119 with a fix for #120168, which was causing the system index migration service to fail when security was enabled.

The fix is to add the priviledge:

        TransportAddIndexBlockAction.TYPE.name() + "*", // needed for SystemIndexMigrator

to the _system user. This allows the system user to access the "blocks" API.

This PR removes a potential cause of data loss when migrating system indices. It does this by changing the way we set a "write-block" on the system index to migrate - now using a dedicated transport request rather than a settings update. Furthermore, we no longer delete the write-block prior to deleting the index, as this was another source of potential data loss. Additionally, we now remove the block if the migration fails.

8.x Branch PR: #121329

@JVerwolf JVerwolf added >bug :Core/Infra/Core Core issues without another label labels Jan 30, 2025
@JVerwolf JVerwolf requested a review from a team January 30, 2025 19:40
@JVerwolf JVerwolf requested a review from a team as a code owner January 30, 2025 19:40
@elasticsearchmachine elasticsearchmachine added Team:Core/Infra Meta label for core/infra team v9.1.0 labels Jan 30, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@JVerwolf JVerwolf changed the title Bugfix/fix priveledges in system migration block main Fix priviledges in system migration WRITE block Jan 30, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @JVerwolf, I've created a changelog YAML for you.

@JVerwolf JVerwolf changed the title Fix priviledges in system migration WRITE block Fix privileges in system migration WRITE block Jan 30, 2025
@JVerwolf JVerwolf changed the title Fix privileges in system migration WRITE block Fix privileges for system index migration WRITE block Jan 30, 2025
…ix-priveledges-in-system-migration-block-main
…of github.com:JVerwolf/elasticsearch into bugfix/fix-priveledges-in-system-migration-block-main
…ix-priveledges-in-system-migration-block-main
…ix-priveledges-in-system-migration-block-main
@alexey-ivanov-es
Copy link
Contributor

Do we need two changelog files?

"indices:data/read/*", // needed for SystemIndexMigrator
"indices:admin/refresh", // needed for SystemIndexMigrator
"indices:admin/aliases", // needed for SystemIndexMigrator
TransportAddIndexBlockAction.TYPE.name() + "*", // needed for SystemIndexMigrator
Copy link
Contributor

Choose a reason for hiding this comment

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

this change w.r.t. security LGTM ( I have not reviewed the rest of the code)

@JVerwolf
Copy link
Contributor Author

JVerwolf commented Feb 6, 2025

@elasticmachine update branch

@JVerwolf JVerwolf added the auto-backport Automatically create backport pull requests when merged label Feb 6, 2025
@JVerwolf
Copy link
Contributor Author

JVerwolf commented Feb 7, 2025

@elasticmachine update branch

…ix-priveledges-in-system-migration-block-main
…of github.com:JVerwolf/elasticsearch into bugfix/fix-priveledges-in-system-migration-block-main
@JVerwolf JVerwolf merged commit 418dec0 into elastic:main Feb 10, 2025
17 checks passed
JVerwolf added a commit to JVerwolf/elasticsearch that referenced this pull request Feb 10, 2025
This PR removes a potential cause of data loss when migrating system indices. It does this by changing the way we set a "write-block" on the system index to migrate - now using a dedicated transport request rather than a settings update. Furthermore, we no longer delete the write-block prior to deleting the index, as this was another source of potential data loss. Additionally, we now remove the block if the migration fails.
elasticsearchmachine pushed a commit that referenced this pull request Feb 10, 2025
* Fix privileges for system index migration WRITE block  (#121327)

This PR removes a potential cause of data loss when migrating system indices. It does this by changing the way we set a "write-block" on the system index to migrate - now using a dedicated transport request rather than a settings update. Furthermore, we no longer delete the write-block prior to deleting the index, as this was another source of potential data loss. Additionally, we now remove the block if the migration fails.

* Update release notes

* Delete docs/changelog/122214.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants