Skip to content

Conversation

paul-tavares
Copy link
Contributor

@paul-tavares paul-tavares commented Oct 21, 2024

Description

Adds create_index privilege to the kibana_system role for the following indices:

  • .logs-endpoint.heartbeat-*
  • .logs-endpoint.diagnostic.collection-*
  • .logs-endpoint.action.responses-*

This change is required in support of restricting DOT indexes from being created by non-privileged users. Up until now, when the Elastic Defend package is installed via Fleet, the Datastream templates for a few DOT prefixed indices are installed. The indexes are then created the first time the Elastic Defend integration executable (running on host machines) streams it first document - which under the restriction (in serverless) the Elastic Defend executable will no longer be given privileges to do. The alternative is to have Kibana create the indexes prior to the endpoint streaming any documents to elastic search.

@paul-tavares paul-tavares added >enhancement :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team v8.17.0 labels Oct 21, 2024
@paul-tavares paul-tavares self-assigned this Oct 21, 2024
@elasticsearchmachine elasticsearchmachine added v9.0.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Oct 21, 2024
@elasticsearchmachine
Copy link
Collaborator

Hi @paul-tavares, I've created a changelog YAML for you.

@paul-tavares paul-tavares changed the title [Security Solution] Add create_index to kibana_system role for index/DS .logs-endpoint.action.responses-* [Security Solution] Add create_index to kibana_system role for Elastic Defend indices Oct 22, 2024
@paul-tavares paul-tavares marked this pull request as ready for review October 22, 2024 22:59
@paul-tavares paul-tavares requested a review from a team as a code owner October 22, 2024 22:59
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@kc13greiner kc13greiner self-requested a review October 23, 2024 12:05
// telemetry
RoleDescriptor.IndicesPrivileges.builder().indices(".logs-endpoint.diagnostic.collection-*").privileges("read").build(),
// telemetry and also creates the index when policies are first created
RoleDescriptor.IndicesPrivileges.builder()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya @paul-tavares

Question: It looks like the kibana_system user has had read access for a bit, can you provide any context as to why it needs to create these indexes now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kc13greiner for looking at this PR.
This change is necessary in order to address the issues found last week when an attempt was made (and later backed out) to restrict DOT indices for serverless. I have updated the description of this PR to more clearly state the need for the changes, which I will include here now:

This change is required in support of restricting DOT indexes from being created by non-privileged users. Up until now, when the Elastic Defend package is installed via Fleet, the Datastream templates for a few DOT prefixed indices are installed. The indexes are then created the first time the Elastic Defend integration executable (running on host machines) streams it first document - which under the restriction (in serverless) the Elastic Defend executable will no longer be given privileges to do. The alternative is to have Kibana create the indexes prior to the endpoint streaming any documents to elastic search.

Let me know if you have any other questions...

(now: on to figure out whats wrong with the failing test... I may need some help there... 😁 )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the information!

@paul-tavares
Copy link
Contributor Author

Ok. Finally the build is 🟢 . Ready for review

Copy link
Contributor

@kc13greiner kc13greiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, we do not like to allowkibana_system anything other than read on system indices, but there are exceptions! (2/3 of the amended index privileges already have write and auto-configure). A restriction in serverless is definitely a good reason for an exception.

Thank you for the information - LGTM!

@paul-tavares paul-tavares merged commit d8bcbb6 into elastic:main Oct 23, 2024
21 checks passed
@paul-tavares paul-tavares deleted the task/olm-10840-update-kibana-system-role-for-response-actions branch October 23, 2024 20:29
@paul-tavares
Copy link
Contributor Author

Hey @kc13greiner - Do I need to tag this PR with anything so that it:

  1. Makes it to the next ES snapshot?
  2. Makes it to the next Serverless release?

Also,
Do you know if this changes will show up in Cloud QA tomorrow so that I can test with a live serverless environment? (FYI: I also have @leehinman helping me to enable the DOT prefix restriction in a serverless deployment once I have that created)

thanks for your help and time on this.

@kc13greiner
Copy link
Contributor

Im not sure 😅 let's check with @elastic/es-security, do you know how the flow works?

davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Oct 24, 2024
…astic Defend indices (elastic#115241) Adds create_index privilege to the kibana_system role for Elastic Defend internal indices Indices: ``` .logs-endpoint.heartbeat-* .logs-endpoint.diagnostic.collection-* .logs-endpoint.action.responses-* ```
georgewallace pushed a commit to georgewallace/elasticsearch that referenced this pull request Oct 25, 2024
…astic Defend indices (elastic#115241) Adds create_index privilege to the kibana_system role for Elastic Defend internal indices Indices: ``` .logs-endpoint.heartbeat-* .logs-endpoint.diagnostic.collection-* .logs-endpoint.action.responses-* ```
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Nov 4, 2024
…astic Defend indices (elastic#115241) Adds create_index privilege to the kibana_system role for Elastic Defend internal indices Indices: ``` .logs-endpoint.heartbeat-* .logs-endpoint.diagnostic.collection-* .logs-endpoint.action.responses-* ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement external-contributor Pull request authored by a developer outside the Elasticsearch team :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team v8.17.0 v9.0.0

3 participants