-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add built-in user and role for code plugin #37030
Conversation
f39db78
to
00badc4
Compare
Pinging @elastic/es-security |
@spalger @polyfractal could you help reviewing this PR? |
Why are we creating a new role, but not a new user? How will the |
@tvernum By default, the |
@tvernum would you mind taking the review on this? Not sure I know enough about security to intelligently review past syntax/style :) |
...core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java
Show resolved
Hide resolved
00badc4
to
6d301f3
Compare
I will review, but I'll be out for the next couple of days, so I won't get to it until mid next week. It would be helpful if you could provide some background about how you intend for this to work. I can review the change at a purely technical level, but in order to understand whether it's the right change to be making I'll need to understand what these Also, before I can approve this, we'll need corresponding changes to |
so we are trying to follow how beats/apm/monitoring security works in Kibana first, the kibana_system role would have read/write access to all code-* indices because it's the root role. since it has access to monitoring/reporting indices so we assume we should do the same. There is some background process we run inside kibana that need to read/write to code-* indices. then, for users that are not root user but need to have permission to manage code, they need to be granted code_admin role that read/writes code indices, this is similar to beats_admin I assume last, for normal users, they need to be granted read access to all code-* indices, we initially planned to create a code_user role, but it's seems beats and apm don't do that, so we just follow the pattern. Please let us known if we have misunderstood how beats/apm works in Kibana, it would be super helpful. |
Thanks for the explanation @zfy0701. Is I think you do want a |
6d301f3
to
30a90db
Compare
added a code_user role |
Thanks @spacedragon. |
30a90db
to
210b28a
Compare
@tvernum I added those unit tests, but It seems the ci jobs are failed. I don't know if these failures are related to my changes. |
Those failures don't look related. @elasticmachine run gradle build tests 1 ; run gradle build tests 2 |
@spacedragon I fixed a couple of tests, we'll see how CI goes. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@tvernum Thanks a lot for your help, could I merge this pr now? |
@spacedragon We need to get the build green before we can merge. I haven't been checking the most recent failures because Elasticsearch CI has had a bunch of internal problems, but they should be resolved now. |
It's all green now. |
@spacedragon Feel free to merge this. |
@spacedragon I've labelled this on the assumption that you will want to backport this to 6.7 |
* elastic/master: Optimize warning header de-duplication (elastic#37725) Bubble exceptions up in ClusterApplierService (elastic#37729) SQL: Improve handling of invalid args for PERCENTILE/PERCENTILE_RANK (elastic#37803) Remove unused ThreadBarrier class (elastic#37666) Add built-in user and role for code plugin (elastic#37030) Consolidate testclusters tests into a single project (elastic#37362) Fix docs for MappingUpdatedAction SQL: Introduce SQL DATE data type (elastic#37693) disabling bwc test while backporting elastic#37639 Mute ClusterDisruptionIT testAckedIndexing Set acking timeout to 0 on dynamic mapping update (elastic#31140) Remove index audit output type (elastic#37707) Mute FollowerFailOverIT testReadRequestsReturnsLatestMappingVersion [ML] Increase close job timeout and lower the max number (elastic#37770) Remove Custom Listeners from SnapshotsService (elastic#37629) Use m_m_nodes from Zen1 master for Zen2 bootstrap (elastic#37701) Fix index filtering in follow info api. (elastic#37752) Use project dependency instead of substitutions for distributions (elastic#37730) Update authenticate to allow unknown fields (elastic#37713) Deprecate HLRC EmptyResponse used by security (elastic#37540)
I dropped the |
I would like to partially revert this PR. With the introduction of Kibana Feature Controls (and Code's support for it), the reserved As far as I can tell, those roles aren't doing anything for customers today, as the corresponding code app isn't available yet. So if we remove this role, we shouldn't be revoking any access that users are relying on today. @elastic/codesearch do you agree, or am I overlooking anything here? |
agree, I don't think we need them |
This pr add a
code_system
as a reserved role, and grant index privilege.code-*
to bothcode_system
andkibana_system
.