-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Remove system-index write-access from superuser role #81400
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
Merged
Merged
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
46614de
Change superuser role
tvernum 7da9999
Switch XPackSecurity user to have own role
tvernum f41dfed
Use custom role for test infra
tvernum 852fed8
Fix spotless/checkstyle
tvernum 36a3bbb
Merge branch 'master' into superuser-no-system-indices
tvernum 0c4d814
Include new root role in high level client test
tvernum 9c80ab1
Include new root role in watcher test
tvernum a027a8d
Include new root role in JDBC test
tvernum 7238596
Update doc snippet test to accommodate role change
tvernum 7712ff9
Merge branch 'master' into superuser-no-system-indices
tvernum 72f9956
Run SystemIndices test as root instead of superuser
tvernum 1163e87
Fix X-Pack doc snippet tests
tvernum d5fa450
Merge branch 'master' into superuser-no-system-indices
tvernum 9db3412
Run fleet and logstash tests as _root
tvernum 0143c47
Add root role to graph QA roles.yml
tvernum d77e7d4
Merge branch 'master' into superuser-no-system-indices
tvernum 0d5f1c1
Merge branch 'master' into superuser-no-system-indices
tvernum 6503d8c
Add root role to IdP QA roles.yml
tvernum 62fcff2
Add root role to ILM QA roles.yml
tvernum 3dbcb99
Add root role to Security-on-Basic QA roles.yml
tvernum e7e1962
Add root role to ML QA roles.yml
tvernum 5629727
Fix role definitions for MultipleIndicesPermissionsTests
tvernum 942f629
Merge branch 'master' into superuser-no-system-indices
tvernum 91f716b
Add root role to SQL-server-security QA roles.yml
tvernum 4f666ee
Fix roles setup for LicensingTests
tvernum 6060d38
Update security-on-basic QA roles.yml
tvernum 169d61d
Unify root role name and fix ML test
tvernum 1432cb2
Merge branch 'master' into superuser-no-system-indices
tvernum a432c32
Fix profile QA test
tvernum aa21192
Don't shortcircuit superuser role
tvernum 09cf887
Fix roles.yml for text-structure
tvernum a17c16e
Allow superuser to read restricted indices cross-cluster
tvernum fd46475
Fix import
tvernum 4d35211
Update roles.yml in security-on-trial QA
tvernum 0c25f60
Fix test that broke with changed superuser resolution behaviour
tvernum eb18730
Fix test that broke with changed superuser resolution behaviour
tvernum 3983254
Fix service-account QA test
tvernum 19e0544
Fix roles.yml for more QA tests
tvernum dae4435
Merge branch 'master' into superuser-no-system-indices
tvernum 597e61d
Fix MultiNode QA test (roles.yml)
tvernum cd3df6b
Fix Password-protected-keystore QA test (roles.yml)
tvernum 9823a23
Merge branch 'master' into superuser-no-system-indices
tvernum 07b2181
Use new 'rolesFiles' support instead of duplicating role definition
tvernum fd3a5f0
Remove extra blank line :(
tvernum 043fe27
Only add default roles.yml if there are users
tvernum 85bd940
Switch gradle run to use _es_test_root role
tvernum 17e51d0
Merge branch 'master' into superuser-no-system-indices
tvernum e39f4c5
Address feedback
tvernum 35198d5
Merge branch 'master' into superuser-no-system-indices
tvernum 4cfff50
Fix field rename missed by IDE
tvernum eec19b2
Fix more field renames missed by IDE
tvernum 8d275d4
Move superuser fallback into CompositeRolesStore
tvernum 4bd28a8
Merge branch 'master' into superuser-no-system-indices
tvernum fcf32ba
Fix indent of multi-line string constant
tvernum 6890401
Remove application privileges from test root role
tvernum 0bd92d2
Merge branch 'master' into superuser-no-system-indices
tvernum 9842902
Merge branch 'master' into superuser-no-system-indices
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
_root: | ||
cluster: [ "ALL" ] | ||
indices: | ||
- names: [ "*" ] | ||
allow_restricted_indices: true | ||
privileges: [ "ALL" ] | ||
run_as: [ "*" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
# The roles below are automatically defined by the "testcluster" setup | ||
_es_test_root: | ||
cluster: [ "ALL" ] | ||
indices: | ||
- names: [ "*" ] | ||
allow_restricted_indices: true | ||
privileges: [ "ALL" ] | ||
run_as: [ "*" ] | ||
applications: | ||
- application: "*" | ||
privileges: [ "*" ] | ||
resources: [ "*" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1572,32 +1572,61 @@ public void testSuperuserRole() { | |
iac = superuserRole.indices().authorize(UpdateSettingsAction.NAME, Sets.newHashSet("aaaaaa", "ba"), lookup, fieldPermissionsCache); | ||
assertThat(iac.getIndexPermissions("aaaaaa").isGranted(), is(true)); | ||
assertThat(iac.getIndexPermissions("b").isGranted(), is(true)); | ||
|
||
// Read security indices => allowed | ||
iac = superuserRole.indices() | ||
.authorize( | ||
randomFrom(SearchAction.NAME, GetIndexAction.NAME), | ||
Sets.newHashSet(RestrictedIndicesNames.SECURITY_MAIN_ALIAS), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||
lookup, | ||
fieldPermissionsCache | ||
); | ||
assertThat("For " + iac, iac.getIndexPermissions(RestrictedIndicesNames.SECURITY_MAIN_ALIAS).isGranted(), is(true)); | ||
assertThat("For " + iac, iac.getIndexPermissions(internalSecurityIndex).isGranted(), is(true)); | ||
|
||
// Write security indices => denied | ||
iac = superuserRole.indices() | ||
.authorize( | ||
randomFrom(IndexAction.NAME, DeleteIndexAction.NAME, SearchAction.NAME), | ||
randomFrom(IndexAction.NAME, DeleteIndexAction.NAME), | ||
Sets.newHashSet(RestrictedIndicesNames.SECURITY_MAIN_ALIAS), | ||
lookup, | ||
fieldPermissionsCache | ||
); | ||
assertThat(iac.getIndexPermissions(RestrictedIndicesNames.SECURITY_MAIN_ALIAS).isGranted(), is(true)); | ||
assertThat(iac.getIndexPermissions(internalSecurityIndex).isGranted(), is(true)); | ||
assertThat("For " + iac, iac.getIndexPermissions(RestrictedIndicesNames.SECURITY_MAIN_ALIAS).isGranted(), is(false)); | ||
assertThat("For " + iac, iac.getIndexPermissions(internalSecurityIndex).isGranted(), is(false)); | ||
|
||
assertTrue(superuserRole.indices().check(SearchAction.NAME)); | ||
assertFalse(superuserRole.indices().check("unknown")); | ||
|
||
assertThat(superuserRole.runAs().check(randomAlphaOfLengthBetween(1, 30)), is(true)); | ||
|
||
// Read security indices => allowed | ||
assertThat( | ||
superuserRole.indices() | ||
.allowedIndicesMatcher(randomFrom(IndexAction.NAME, DeleteIndexAction.NAME, SearchAction.NAME)) | ||
.allowedIndicesMatcher(randomFrom(GetAction.NAME, IndicesStatsAction.NAME)) | ||
.test(mockIndexAbstraction(RestrictedIndicesNames.SECURITY_MAIN_ALIAS)), | ||
is(true) | ||
); | ||
assertThat( | ||
superuserRole.indices() | ||
.allowedIndicesMatcher(randomFrom(IndexAction.NAME, DeleteIndexAction.NAME, SearchAction.NAME)) | ||
.allowedIndicesMatcher(randomFrom(GetAction.NAME, IndicesStatsAction.NAME)) | ||
.test(mockIndexAbstraction(internalSecurityIndex)), | ||
is(true) | ||
); | ||
|
||
// Write security indices => denied | ||
assertThat( | ||
superuserRole.indices() | ||
.allowedIndicesMatcher(randomFrom(IndexAction.NAME, DeleteIndexAction.NAME)) | ||
.test(mockIndexAbstraction(RestrictedIndicesNames.SECURITY_MAIN_ALIAS)), | ||
is(false) | ||
); | ||
assertThat( | ||
superuserRole.indices() | ||
.allowedIndicesMatcher(randomFrom(IndexAction.NAME, DeleteIndexAction.NAME)) | ||
.test(mockIndexAbstraction(internalSecurityIndex)), | ||
is(false) | ||
); | ||
} | ||
|
||
public void testLogstashSystemRole() { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.