Skip to content

Conversation

slobodanadamovic
Copy link
Contributor

@slobodanadamovic slobodanadamovic commented Mar 19, 2025

The CCS is currently not supported for failure store backing indices. This PR adjusts the selector parsing (introduced in #118614) to prevent using ::failures and ::data selectors with cross-cluster expressions.

For example, GET my_remote_cluster:logs-*::failures/_search request will fail early, during expression parsing.
To test manually, run ./gradlew run-ccs and execute the example request.

@slobodanadamovic slobodanadamovic added >non-issue :Security/Security Security issues without another label :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team Team:Security Meta label for security team auto-backport Automatically create backport pull requests when merged v8.19.0 v9.1.0 labels Mar 19, 2025
@slobodanadamovic slobodanadamovic self-assigned this Mar 19, 2025
@slobodanadamovic slobodanadamovic changed the title [Failure Store] Prevent usage of ::failures selector with remote cluster expressions [Failure Store] Prevent usage of ::failures selector with cross-cluster expressions Mar 19, 2025
@slobodanadamovic slobodanadamovic marked this pull request as ready for review March 19, 2025 21:52
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@slobodanadamovic slobodanadamovic marked this pull request as draft March 19, 2025 23:07
@slobodanadamovic slobodanadamovic requested a review from n1v0lg March 21, 2025 21:36
Copy link
Contributor

@gmarouli gmarouli left a comment

Choose a reason for hiding this comment

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

LGTM

@slobodanadamovic
Copy link
Contributor Author

LGTM 👍 We'll need to figure out where, but will need to document that while CCS across failure stores is not officially supported, users should be aware that cross-cluster access of failure indices is possible in edge-case conditions, under RCS 1.

Yeah, RCS1 is special in sense that users can define roles which grants direct access to failure store indices and search them - there is no way for us to prevent that (nor should we). I think this is fine in the short term, since we do want to support CCS in the long term.

@slobodanadamovic
Copy link
Contributor Author

FIPS failures are unrelated. Fix incoming: #125754

@slobodanadamovic slobodanadamovic merged commit 1d6c6a5 into elastic:main Mar 28, 2025
22 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 125252

@slobodanadamovic
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Questions ?

Please refer to the Backport tool documentation

slobodanadamovic added a commit to slobodanadamovic/elasticsearch that referenced this pull request Mar 28, 2025
…essions (elastic#125252)

The CCS is currently not supported for failure store backing indices.
This PR adjusts the selector parsing (introduced in elastic#118614) to prevent
using `::failures` and `::data` selectors with cross-cluster expressions.

For example, `GET my_remote_cluster:logs-*::failures/_search` request
will fail early, during expression parsing.
To test manually, run `./gradlew run-ccs` and execute the example request.

(cherry picked from commit 1d6c6a5)

# Conflicts:
#	server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java
#	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
…essions (elastic#125252)

The CCS is currently not supported for failure store backing indices. 
This PR adjusts the selector parsing (introduced in elastic#118614) to prevent 
using `::failures` and `::data` selectors with cross-cluster expressions.

For example, `GET my_remote_cluster:logs-*::failures/_search` request 
will fail early, during expression parsing. 
To test manually, run `./gradlew run-ccs` and execute the example request.
elasticsearchmachine pushed a commit that referenced this pull request Mar 31, 2025
…r expressions (#125252) (#125831)

* [Failure Store] Prevent usage of :: selectors with cross-cluster expressions (#125252)

The CCS is currently not supported for failure store backing indices.
This PR adjusts the selector parsing (introduced in #118614) to prevent
using `::failures` and `::data` selectors with cross-cluster expressions.

For example, `GET my_remote_cluster:logs-*::failures/_search` request
will fail early, during expression parsing.
To test manually, run `./gradlew run-ccs` and execute the example request.

(cherry picked from commit 1d6c6a5)

# Conflicts:
#	server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java
#	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java

* backport also test assertion fix
slobodanadamovic added a commit to slobodanadamovic/elasticsearch that referenced this pull request Mar 31, 2025
This PR prevents using `::` selectors in remote index expressions and adds
a basing integration test with security off

Relates to elastic#125252
slobodanadamovic added a commit to slobodanadamovic/elasticsearch that referenced this pull request Mar 31, 2025
This PR prevents using `::` selectors in remote index expressions and adds
a basing integration test with security off

Relates to elastic#125252
slobodanadamovic added a commit that referenced this pull request Apr 1, 2025
…ff (#125968)

This PR prevents using `::` selectors in remote index expressions and adds
a basic integration test with security off.

Relates to #125252
slobodanadamovic added a commit to slobodanadamovic/elasticsearch that referenced this pull request Apr 1, 2025
…ff (elastic#125968)

This PR prevents using `::` selectors in remote index expressions and adds
a basic integration test with security off.

Relates to elastic#125252

(cherry picked from commit 83d7fe0)

# Conflicts:
#	server/src/main/java/org/elasticsearch/action/ResolvedIndices.java
elasticsearchmachine pushed a commit that referenced this pull request Apr 1, 2025
…ff (#125968) (#126023)

This PR prevents using `::` selectors in remote index expressions and adds
a basic integration test with security off.

Relates to #125252

(cherry picked from commit 83d7fe0)

# Conflicts:
#	server/src/main/java/org/elasticsearch/action/ResolvedIndices.java
slobodanadamovic added a commit that referenced this pull request Apr 9, 2025
Adjust existing RCS1 tests to randomize using API keys for authorization
and `skip_unavailable` setting.

Followup on #125252
slobodanadamovic added a commit to slobodanadamovic/elasticsearch that referenced this pull request Apr 9, 2025
…#125782)

Adjust existing RCS1 tests to randomize using API keys for authorization
and `skip_unavailable` setting.

Followup on elastic#125252
elasticsearchmachine pushed a commit that referenced this pull request Apr 9, 2025
#126555)

Adjust existing RCS1 tests to randomize using API keys for authorization
and `skip_unavailable` setting.

Followup on #125252
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 :Data Management/Data streams Data streams and their lifecycles >non-issue :Security/Security Security issues without another label Team:Data Management Meta label for data/management team Team:Security Meta label for security team v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants