-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
[Cloud Security][CDR] Update Wiz vuln privileges #112192
Conversation
Pinging @elastic/ml-core (Team:ML) |
@@ -30,7 +30,8 @@ | |||
import static org.elasticsearch.xpack.core.security.authz.store.ReservedRolesStore.getRemoteIndicesReadPrivileges; |
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.
Linting has resulted in changes to the comments:
./gradlew :x-pack:plugin:core:spotlessApply
Pinging @elastic/es-security (Team:Security) |
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices("logs-wiz.vulnerability-*") | ||
.privileges("read", "view_index_metadata") | ||
.build(), |
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.
Looks good - since logs-*
is a known collision pattern https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices("security_solution-wiz.vulnerability_latest-*") | ||
.privileges( | ||
"create_index", | ||
"read", | ||
"index", | ||
"delete", | ||
TransportIndicesAliasesAction.NAME, | ||
TransportUpdateSettingsAction.TYPE.name() | ||
) |
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.
For indices not owned by Kibana, the kibana_system
user should only have read
privileges. security_solution-*
falls under that pattern.
Can you please provide any additional information on why the elevated privileges are needed? I can then raise it with the KB security team.
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.
The Transform we're adding in the corresponding PR reads from the logs-wiz.vulnerability-default
index and writes the result to the security_solution-wiz.vulnerability_latest-v1
index. This index is created in Kibana after the integration installation, which is why these privileges are necessary.
We've implemented the same logic for our native integration for the same reason—creating an index via the Transform, as shown here.
@CohenIdo Could you please add corresponding test for |
Arrays.asList( | ||
"logs-cloud_security_posture.findings_latest-default", | ||
"logs-cloud_security_posture.scores-default", | ||
"logs-cloud_security_posture.vulnerabilities_latest-default", | ||
"logs-cloud_security_posture.findings_latest-default-" + Version.CURRENT, | ||
"logs-cloud_security_posture.scores-default-" + Version.CURRENT, | ||
"logs-cloud_security_posture.vulnerabilities_latest-default" + Version.CURRENT | ||
"logs-cloud_security_posture.vulnerabilities_latest-default" + Version.CURRENT, | ||
"security_solution-wiz.vulnerability_latest-" + Version.CURRENT |
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 new index I added, security_solution-wiz.vulnerability_latest
, is used by the cloud security solution, this is the reason it was added under the same test case.
Done:) |
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.
Looks good from es-security
side 👍
Hey @CohenIdo After having discussed this with the KB team, we've got a few questions -
We try to be quite restrictive for |
It's a good point, I will test that with those privilege, I guess you right and we can use just
Our PMs probably will be able to help here @smriti0321 @tinnytintin10 |
@SiddharthMantri, from the transform docs:
|
Thanks for the catch on doc update @SiddharthMantri and @CohenIdo , I will work on this along with our documentation team. @benironside do you know who will be able to help with the updates on this page- https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html? Also, we will introduce the change closer to GA of this feature. @CohenIdo |
./ci |
Hey @CohenIdo ! So after consulting with the team, I think we are good now. It's not super apparent from the PR, but we'd like to know why the source and destination index can't be the same one? Something like this: Lines 357 to 383 in afd4bf4
|
Good Idea @SiddharthMantri , I changed the index pattern to match any future integration we are going to add. |
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! After discussing with @CohenIdo, we now know why the name pattern was added. Thank you for your patience! Can we add the summary from the discussion behind the naming to the PR description?
Solves:
Summary
Update
kibana_system
privileges:Integration PR:
Please note: We considered using the
logs
prefix for the destination index, which is already mentioned in the documentation as an index that users should avoid writing to due to pattern collisions. The reasons we decided not to use thelogs
index are summarized here.