-
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 privileges for kIbana_system user to serve cloud security posture… #84941
add privileges for kIbana_system user to serve cloud security posture… #84941
Conversation
Pinging @elastic/es-security (Team:Security) |
...core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java
Outdated
Show resolved
Hide resolved
"cloud_security_posture-findings_latest", | ||
"cloud_security_posture-benchmark_scores" | ||
) | ||
.privileges("create_index", "delete_index", "read", "index", "delete" ,"write" ,"all") |
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.
Do we need delete
? I don't see it as a requirement for the transform APIs nor do I expect Kibana to be deleting documents from these indices
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.
in the doc, it mentioned the required privileges are:
source indices: read, view_index_metadata
destination index: read, create_index, index
while when the Transform is initiated with those privileges we are getting the next error message:
task encountered irrecoverable failure: org.elasticsearch.ElasticsearchSecurityException: action [indices:data/write/delete/byquery] is unauthorized for user [kibana_system] with roles [kibana_system] on indices [cloud_security_posture-findings_latest], this action is granted by the index privileges [delete,write,all]
As a solution, I added the following privileges: [delete,write,all]
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.
@elastic/ml-data (I hope this is the right team) are our docs out of date here? I'm surprised that installing a transform is attempting a delete by query on the destination index and that the docs don't indicate this. I'm also surprised this issue doesn't affect our other transforms installed by Fleet?
task encountered irrecoverable failure: org.elasticsearch.ElasticsearchSecurityException: action [indices:data/write/delete/byquery] is unauthorized for user [kibana_system] with roles [kibana_system] on indices [cloud_security_posture-findings_latest], this action is granted by the index privileges [delete,write,all]
That error seems to indicate that they need one of these [delete,write,all]
privileges, but not all of them. Can we test what the minimum required here is?
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.
Hi @joshdover - I think @elastic/ml-core would help here
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.
@joshdover we need delete by query. This is for the new data retention policies that transforms can create. Our docs our out of date if delete is not included.
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.
I will create an ES issue to capture this inaccuracy and adding a check early on to verify security (like we do for write/read).
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.
#85409 for tracking our missing validation and documentation.
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.
Thank you all, I added the delete
privilege.
.privileges("read", "view_index_metadata") | ||
.build(), | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices("cloud_security_posture-findings_latest", "cloud_security_posture-benchmark_scores") |
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.
Do we still need these?
Ping @elastic/kibana-security for review |
23bb91a
to
31a3f83
Compare
31a3f83
to
4e327b2
Compare
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.
namings lgtm
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.
Kibana Security Review --
Thanks for tagging us, LGTM for posterity
1525089
to
090c876
Compare
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.
LGTM from a Fleet perspective, still need approval from @elastic/es-security
For full disclosure - We are just starting to work on 2 more Security packages (host risk score and beaconing) which contain multiple transforms, and we anticipate more in the near future. Are we sure that extending the privileges of |
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.
LGTM
My personal preference, not a requirement, is that system generated data go into index names that start with .
.
@sophiec20 Agreed, this is not a long-term solution we can keep sustaining. Please see elastic/package-spec#293 for discussion of other options. AFAIK no option has been proposed that wouldn't involve having Elasticsearch implement a package install API. If transforms shipped in packages is going to be a growing feature we need to start having more discussions with Elasticsearch about implementing this feature. cc @ruflin |
Add privileges for
kibana_system
user to allow support in Cloud Security Posture's feature.