-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
WIldcard IndicesPermissions don't cover .security #36765
Closed
albertzaharovits
wants to merge
26
commits into
elastic:master
from
albertzaharovits:strict_privilege_take_3
Closed
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
fa07a97
Names
albertzaharovits c12fa0e
getting there
albertzaharovits 59ff695
HashCode and trimms
albertzaharovits 536640d
HasPrivilege
albertzaharovits 4ee6cbd
Husling
albertzaharovits ac9ec5a
ReservedRolesStore
albertzaharovits 52e7c2a
Merge branch 'master' into strict_privilege_take_3
albertzaharovits c806970
Trimming
albertzaharovits c7f7f2b
AuthorizedIndices remove hack + tests
albertzaharovits f77fff1
More tests and checkstyle
albertzaharovits 2e92793
Javadoc and renames
albertzaharovits 6750306
two comments
albertzaharovits b6ea0b3
import static
albertzaharovits 527a22e
import static
albertzaharovits 82577ba
Merge branch 'backup_security_index' into strict_privilege_take_3
albertzaharovits 4340bcc
Merge branch 'backup_security_index' into strict_privilege_take_3
albertzaharovits 2a3f38d
Fix check
albertzaharovits aadd062
Implicit authorize monitoring passthrough
albertzaharovits d63577d
import static
albertzaharovits 7759040
Merge branch 'backup_security_index' into strict_privilege_take_3
albertzaharovits eaa4eb2
Merge branch 'master' into strict_privilege_take_3
albertzaharovits ee7e2c2
review nits
albertzaharovits d6191cf
Compilation minor error
albertzaharovits 55aefb6
Merge branch 'master' into strict_privilege_take_3
albertzaharovits 9f6c739
RoleDescriptor allow_restricted_indices
albertzaharovits e50ebfc
Mapping
albertzaharovits 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
219 changes: 177 additions & 42 deletions
219
...c/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
12 changes: 0 additions & 12 deletions
12
.../core/src/main/java/org/elasticsearch/xpack/core/security/index/IndexAuditTrailField.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...in/core/src/main/java/org/elasticsearch/xpack/core/security/index/SystemIndicesNames.java
This file contains 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,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.core.security.index; | ||
|
||
import org.elasticsearch.xpack.core.upgrade.IndexUpgradeCheckVersion; | ||
|
||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public final class SystemIndicesNames { | ||
|
||
public static final String AUDIT_INDEX_NAME_PREFIX = ".security_audit_log"; | ||
public static final String INTERNAL_SECURITY_INDEX = ".security-" + IndexUpgradeCheckVersion.UPRADE_VERSION; | ||
public static final String SECURITY_INDEX_NAME = ".security"; | ||
private static final Set<String> index_names; | ||
|
||
static { | ||
Set<String> indexNames = new HashSet<>(); | ||
indexNames.add(SECURITY_INDEX_NAME); | ||
indexNames.add(INTERNAL_SECURITY_INDEX); | ||
index_names = Collections.unmodifiableSet(indexNames); | ||
} | ||
|
||
public static Set<String> indexNames() { | ||
return index_names; | ||
} | ||
|
||
private SystemIndicesNames() { | ||
} | ||
|
||
} |
This file contains 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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; | ||
import org.elasticsearch.xpack.core.security.authz.permission.Role; | ||
import org.elasticsearch.xpack.core.security.index.IndexAuditTrailField; | ||
import org.elasticsearch.xpack.core.security.index.SystemIndicesNames; | ||
import org.elasticsearch.xpack.core.security.support.MetadataUtils; | ||
|
||
/** | ||
|
@@ -20,7 +20,7 @@ public class XPackUser extends User { | |
public static final Role ROLE = Role.builder(new RoleDescriptor(ROLE_NAME, new String[] { "all" }, | ||
new RoleDescriptor.IndicesPrivileges[] { | ||
RoleDescriptor.IndicesPrivileges.builder().indices("/@&~(\\.security.*)/").privileges("all").build(), | ||
RoleDescriptor.IndicesPrivileges.builder().indices(IndexAuditTrailField.INDEX_NAME_PREFIX + "-*") | ||
RoleDescriptor.IndicesPrivileges.builder().indices(SystemIndicesNames.AUDIT_INDEX_NAME_PREFIX + "-*") | ||
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. We can simplify this when we remove index audit. |
||
.privileges("read").build() | ||
}, | ||
new String[] { "*" }, | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have
allowRestrictedIndices(true)