Skip to content
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 .edr-workflow-insights perms for kibana_system #116485

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

joeypoon
Copy link
Member

@joeypoon joeypoon commented Nov 8, 2024

Adds necessary permissions for the new .edr-workflow-insights-* index. This index is created, managed, and used internally by only Kibana for the upcoming Security Workflow Insights feature (provides users with security workflow configuration suggestions).

@elasticsearchmachine elasticsearchmachine added v9.0.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Nov 8, 2024
@joeypoon joeypoon force-pushed the chore/security-config-insights-perms branch 5 times, most recently from 327cf7e to ca0a1b4 Compare November 10, 2024 17:19
@joeypoon joeypoon force-pushed the chore/security-config-insights-perms branch from ca0a1b4 to 424f09c Compare November 13, 2024 07:14
@joeypoon joeypoon changed the title Add .security-configuration-insights perms for kibana_system Add .security-workflow-insights perms for kibana_system Nov 13, 2024
@joeypoon joeypoon marked this pull request as ready for review November 13, 2024 07:15
@joeypoon joeypoon requested a review from a team as a code owner November 13, 2024 07:15
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Nov 13, 2024
@joeypoon joeypoon added the Team:Security Meta label for security team label Nov 13, 2024
@elasticsearchmachine elasticsearchmachine removed the Team:Security Meta label for security team label Nov 13, 2024
@gareth-ellis gareth-ellis added the :Security/Security Security issues without another label label Nov 18, 2024
@elasticsearchmachine elasticsearchmachine added Team:Security Meta label for security team and removed needs:triage Requires assignment of a team area label labels Nov 18, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@joeypoon joeypoon force-pushed the chore/security-config-insights-perms branch from 424f09c to 28f304b Compare November 19, 2024 07:07
@joeypoon joeypoon enabled auto-merge (squash) November 19, 2024 07:07
@joeypoon joeypoon force-pushed the chore/security-config-insights-perms branch from 28f304b to 7d46541 Compare November 19, 2024 08:16
@slobodanadamovic slobodanadamovic requested a review from a team November 19, 2024 08:37
// Security Solution workflows insights. Kibana creates, manages, and uses these
// to provide users with insights on potential configuration improvements
RoleDescriptor.IndicesPrivileges.builder()
.indices(".security-workflow-insights-*")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.indices(".security-workflow-insights-*")
.indices(".kibana-security-workflow-insights-*")

Elasticsearch has already defined many .security-* indices (e.g. .security-7, .security-profile, .security-token). Introducing .security-workflow-insights-* as part of the .security-* namespace might lead to unexpected behaviour, cause a confusion or even lead to an accidental exposure. We would like to keep .security-* prefix only for Elasticsearch internally managed indices.

Since this new system index is meant to be managed by Kibana only, how about naming it .kibana-security-workflow-insights-* instead?

Copy link
Member

Choose a reason for hiding this comment

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

Good catch! However, .kibana* is reserved for Kibana’s own data store/Saved Objects indices (cc @rudolf). I believe we`d need to use a use-case/area/solution-specific prefix here instead.

Copy link
Member Author

@joeypoon joeypoon Nov 19, 2024

Choose a reason for hiding this comment

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

Thanks for the context, that makes sense to me. Updated to .kibana-security-workflow-insights-* 👍. missed the comment, will think of different prefix.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah there are already special privileges for .kibana* and .kibana_* indices are included in the feature state.

Usually a system index should belong to some feature state so that these can be restored in a rollback. E.g. kibana's system indices .kibana_* are all included in the kibana feature state defined in the KibanaPlugin

public class KibanaPlugin extends Plugin implements SystemIndexPlugin {

Has there been any discussions around introducing a new system index with the Elasticsearch team?

Copy link
Member Author

Choose a reason for hiding this comment

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

Has there been any discussions around introducing a new system index with the Elasticsearch team?

No, I think this is closer to an internal index rather than a system index. Similar to the other . prefixed indices installed by the Elastic Defend package.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated to .edr-workflow-insights

Copy link
Contributor

@slobodanadamovic slobodanadamovic left a comment

Choose a reason for hiding this comment

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

As mentioned in https://github.com/elastic/elasticsearch/pull/116485/files#r1847945726, we would like to avoid introducing externally managed system indices that are under the .security-* namespace.

@joeypoon joeypoon force-pushed the chore/security-config-insights-perms branch 2 times, most recently from fd30ae8 to edb7328 Compare November 19, 2024 15:28
Copy link
Contributor

@slobodanadamovic slobodanadamovic left a 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 👍

Nit: Could you please update PR description and title to reflect the new index pattern?

@joeypoon joeypoon changed the title Add .security-workflow-insights perms for kibana_system Add .edr-workflow-insights perms for kibana_system Nov 19, 2024
@joeypoon joeypoon force-pushed the chore/security-config-insights-perms branch from edb7328 to 95f4e77 Compare November 20, 2024 07:54
Adds auto_configure, read, write, and create_index permissions for the
new .edr-workflow-insights-* index. This index is created and
used internally by Kibana.
@joeypoon joeypoon force-pushed the chore/security-config-insights-perms branch from 95f4e77 to 2ccc69b Compare November 20, 2024 10:21
@joeypoon
Copy link
Member Author

@elasticmachine update branch

@joeypoon joeypoon merged commit dcd7fb7 into elastic:main Nov 20, 2024
20 of 21 checks passed
rjernst pushed a commit to rjernst/elasticsearch that referenced this pull request Nov 20, 2024
…6485)

Adds auto_configure, read, write, and create_index permissions for the
new .security-workflows-insights-* index. This index is created and
used internally by Kibana.
joeypoon added a commit to elastic/kibana that referenced this pull request Nov 25, 2024
## Summary

Adds an SecurityWorkflowInsightsService that is setup during security
solution plugin initialization. The service setup installs the component
templates, index template, and datastream used by the service.

Depends on:
- elastic/elasticsearch#116485


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)

Co-authored-by: Konrad Szwarc <konrad.szwarc@elastic.co>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 25, 2024
…9606)

## Summary

Adds an SecurityWorkflowInsightsService that is setup during security
solution plugin initialization. The service setup installs the component
templates, index template, and datastream used by the service.

Depends on:
- elastic/elasticsearch#116485

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)

Co-authored-by: Konrad Szwarc <konrad.szwarc@elastic.co>
(cherry picked from commit 2e004f8)
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
…9606)

## Summary

Adds an SecurityWorkflowInsightsService that is setup during security
solution plugin initialization. The service setup installs the component
templates, index template, and datastream used by the service.

Depends on:
- elastic/elasticsearch#116485


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)

Co-authored-by: Konrad Szwarc <konrad.szwarc@elastic.co>
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
…6485)

Adds auto_configure, read, write, and create_index permissions for the
new .security-workflows-insights-* index. This index is created and
used internally by Kibana.
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…9606)

## Summary

Adds an SecurityWorkflowInsightsService that is setup during security
solution plugin initialization. The service setup installs the component
templates, index template, and datastream used by the service.

Depends on:
- elastic/elasticsearch#116485


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)

Co-authored-by: Konrad Szwarc <konrad.szwarc@elastic.co>
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/Security Security issues without another label Team:Security Meta label for security team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants