-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[kbn/es serverless] Allow ES serverless resources (ex. users, users_roles, etc) to be overwritten via yarn es serverless command
#167087
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
Merged
paul-tavares
merged 23 commits into
elastic:main
from
paul-tavares:task/olm-serverless-es-file-realm-users-roles
Sep 27, 2023
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
bf8ea61
add `soc_manager` to ES serverless resources
paul-tavares 246d64c
Update serverless CLI command to support `--resources` argument
paul-tavares bbe498a
add list of security solution ES serverless resources
paul-tavares 7a241f6
Merge remote-tracking branch 'origin/task/olm-serverless-es-file-real…
paul-tavares 2e49a09
add security solution script to start ES in serverless with users/roles
paul-tavares b816b1c
Fix resources file paths
paul-tavares 1d971cd
fix es serverless script
paul-tavares ec6debf
Merge remote-tracking branch 'upstream/main' into task/olm-serverless…
paul-tavares c27b914
additional improvements to the es start script
paul-tavares 31d00c5
Updates to the README file for security solution es serverless resources
paul-tavares 0ccbb7b
updated README file
paul-tavares 3822817
add tests for to validate use of `--resources` in `setupServerlessVol…
paul-tavares 64be34c
add available users for login to script output
paul-tavares 8feff00
better format of users available on kbn serverless
paul-tavares fb04041
remove `--teardown` from example
paul-tavares 34e9b85
Merge remote-tracking branch 'upstream/main' into task/olm-serverless…
paul-tavares b5d7109
remove commented out code
paul-tavares 5d50a93
add log when resource is overridden
paul-tavares 3a7fadd
Merge remote-tracking branch 'upstream/main' into task/olm-serverless…
paul-tavares 37cfd8f
Correct duplicate word
paul-tavares 3fa9282
Fix type issue in markdown editor
paul-tavares cca86c9
Merge remote-tracking branch 'upstream/main' into task/olm-serverless…
paul-tavares 10243af
Merge branch 'main' into task/olm-serverless-es-file-realm-users-roles
paul-tavares File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| elastic_serverless:$2a$10$nN6sRtQl2KX9Gn8kV/.NpOLSk6Jwn8TehEDnZ7aaAgzyl/dy5PYzW | ||
| system_indices_superuser:$2a$10$nN6sRtQl2KX9Gn8kV/.NpOLSk6Jwn8TehEDnZ7aaAgzyl/dy5PYzW | ||
| soc_manager:$2a$10$nN6sRtQl2KX9Gn8kV/.NpOLSk6Jwn8TehEDnZ7aaAgzyl/dy5PYzW |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| superuser:elastic_serverless | ||
| system_indices_superuser:system_indices_superuser | ||
| soc_manager:soc_manager |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...cripts/endpoint/common/roles_users/serverless/es_serverless_resources/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Security Solution Serverless Resources | ||
|
|
||
| Directory contains ES serverless resources that can be used to override the defaults that are loaded when ES is started in serverless mode. For more information on how these are used [packages/kbn-es/src/serverless_resources/README.md](https://github.com/elastic/kibana/blob/main/packages/kbn-es/src/serverless_resources/README.md) | ||
|
|
||
| > **ℹ️ NOTE** | ||
| > | ||
| > The files referenced via `--resources` argument will be bound and mounted to the ES docker containers that are running ES. This means that any changes to the files done on the host machine will be automatically (after a delay - 5s by default) picked up by Elasticsearch and applied to the ES docker nodes. | ||
|
|
||
| ## Usage | ||
|
|
||
| Example executed from the root directory of Kibana: | ||
|
|
||
| ```shell | ||
| yarn es serverless \ | ||
| --clean \ | ||
| --kill \ | ||
| -E xpack.security.authc.api_key.enabled=true \ | ||
| -E http.host=0.0.0.0 \ | ||
| --resources=./x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml \ | ||
| --resources=./x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users \ | ||
| --resources=./x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users_roles | ||
| ``` | ||
|
|
||
| > **💡️TIP** | ||
| > | ||
| > If needing to make custom changes to any of the ES resources for personal dev. purposes, copy the files located in this folder to your own local directly, make changes there and then use those file paths when starting ES | ||
|
|
||
|
|
||
|
|
||
| ## Files | ||
|
|
||
| ### `roles.yml` | ||
|
|
||
| The list of Roles that are loaded into security serverless projects. The values in this file should match those in the [project controller](https://github.com/elastic/project-controller/blob/main/internal/project/security/config/roles.yml) and should remain in sync. | ||
|
|
||
| ### `users` | ||
|
|
||
| List of users that are loaded into ES for serverless. This file currently includes a user for each of the Security Project roles (same name as the role). All users in this file have their password set to `changeme` | ||
|
|
||
| Format: `user:encrypted_password` | ||
|
|
||
| ### `users_roles` | ||
|
|
||
| A map of role names (should match those define in the `roles.yml`) to list of users (values found in the `users` file). All Security serverless roles are listed in this file along with one user by the same name. | ||
|
|
||
| Format: `role_name:username,username,username` | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.