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

[Test] Fix superuser API key bwc test #82792

Merged
merged 11 commits into from
Jan 24, 2022

Conversation

ywangd
Copy link
Member

@ywangd ywangd commented Jan 19, 2022

This PR fixes the following BWC issues:

  • The role descriptors field for creating API keys became optional since version 7.3.0. For earlier versions, they must be specified. This PR specifies them conditionally based on the old cluster version. This also serves a variation of the test to show that dropping write access to system indices from thelimiting role will prevent the key from writing to system indices as a whole.
  • Deprecation messages for system indices access is added in v7.10.0.

Resolves: #82785

The role descriptors became optional since version 7.3.0. For earlier
versions, they must be specified. This PR specifies them conditionally
based on the old cluster version. This also serves a variation of the
test to show that dropping write access to system indices from the
limiting role will prevent the key from writing to system indices as a
whole.

Resolves: elastic#82785
@ywangd ywangd added >test Issues or PRs that are addressing/adding tests :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC v8.0.0 auto-backport-and-merge v8.1.0 labels Jan 19, 2022
@ywangd ywangd requested a review from jkakavas January 19, 2022 11:30
@elasticmachine elasticmachine added the Team:Security Meta label for security team label Jan 19, 2022
@elasticmachine
Copy link
Collaborator

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

@ywangd ywangd changed the title [Test] provide role descriptors for API key creation [Test] Fix superuser API key bwc test Jan 19, 2022
@ywangd ywangd added the test-full-bwc Trigger full BWC version matrix tests label Jan 19, 2022
@ywangd
Copy link
Member Author

ywangd commented Jan 19, 2022

@elasticmachine run elasticsearch-ci/full-bwc

@ywangd
Copy link
Member Author

ywangd commented Jan 20, 2022

@elasticmachine run elasticsearch-ci/part-2-fips

Copy link
Member

@jkakavas jkakavas left a comment

Choose a reason for hiding this comment

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

LGTM

+ "version, direct access to system indices will be prevented by default"
).toBuilder().addHeader("Authorization", apiKeyAuthHeader)
);
// Configure the warning to be optional due to #82837, it is ok since this test is for something else
Copy link
Member

Choose a reason for hiding this comment

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

maybe add a TODO to change this back or as part of the fix for #82837 ? This comment can be enough on its own though :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I added a TODO. Thanks!

@ywangd ywangd merged commit 43ea63b into elastic:master Jan 24, 2022
ywangd added a commit to ywangd/elasticsearch that referenced this pull request Jan 24, 2022
The role descriptors became optional since version 7.3.0. For earlier
versions, they must be specified. This PR specifies them conditionally
based on the old cluster version. This also serves a variation of the
test to show that dropping write access to system indices from the
limiting role will prevent the key from writing to system indices as a
whole.

Resolves: elastic#82785
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.0

ywangd added a commit that referenced this pull request Jan 24, 2022
The role descriptors became optional since version 7.3.0. For earlier
versions, they must be specified. This PR specifies them conditionally
based on the old cluster version. This also serves a variation of the
test to show that dropping write access to system indices from the
limiting role will prevent the key from writing to system indices as a
whole.

Backport: #82792
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team >test Issues or PRs that are addressing/adding tests test-full-bwc Trigger full BWC version matrix tests v8.0.0-rc2 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] FullClusterRestartIT testApiKeySuperuser failing for pre 7.3.0 old clusters
5 participants