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

[doc] fix the necessary privileges of central pipeline management #16902

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

kaisecheng
Copy link
Contributor

@kaisecheng kaisecheng commented Jan 15, 2025

This commit updated the instructions of using central pipeline management with the necessary privileges

fixes: #16905
relates: https://github.com/elastic/ingest-dev/issues/4812

Copy link
Contributor

📃 DOCS PREVIEWhttps://logstash_bk_16902.docs-preview.app.elstc.co/diff

@@ -249,8 +249,7 @@ POST /_security/api_key
"name": "logstash_host001", <1>
"role_descriptors": {
"logstash_monitoring": { <2>
"cluster": ["monitor"],
"index": ["read"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it gives syntax error

Comment on lines +17 to +22
"indices": [
{
"names": [ "logstash-*" ],
"privileges": ["read","view_index_metadata"]
}
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These few lines were unfortunately removed by me five years ago

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, thanks for fixing this. Indeed names and privileges are required fields.

}
---------------------------------------------------------------

. Assign your Logstash users the `logstash_reader` role. If the Logstash user
will be using
{logstash-ref}/logstash-centralized-pipeline-management.html[centralized pipeline management],
also assign the `logstash_admin` role. You can create and manage users from the
also assign the `logstash_system` role. You can create and manage users from the
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need cluster privilege "monitor" to query /_xpack when using central pipeline management.

Elasticsearch has two built-in roles: logstash_admin, logstash_system
logstash_admin

{
  "cluster": ["manage_logstash_pipelines"], 
  "indices": [
    {
      "names": [ ".logstash*" ], 
      "privileges": ["create","read","delete","index","manage"]  
    }
  ]
}

logstash_system

{
  "cluster": ["monitor", "cluster:admin/xpack/monitoring/bulk"]
}

So, we need logstash_system here

should have the built-in `logstash_admin` role and the customized `logstash_writer` role, which provides access to system
indices for managing configurations. Starting with Elasticsearch version 7.10.0, the
`logstash_admin` role inherits the `manage_logstash_pipelines` cluster privilege for centralized pipeline management.
should have the built-in `logstash_admin` role and `logstash_system` role, which provides access to system
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original doc recommend to create a new role logstash_writer for writing indices and for central pipeline management.

logstash_writer

{
  "cluster": ["manage_index_templates", "monitor", "manage_ilm"], 
  "indices": [
    {
      "names": [ "logstash-*" ], 
      "privileges": ["write","create","create_index","manage","manage_ilm"]  
    }
  ]
}

I think using logstash_system is more align to other examples and user has less step to follow.

should have the built-in `logstash_admin` role and `logstash_system` role, which provides access to system
indices for managing configurations.

NOTE: Starting with Elasticsearch version 7.10.0, the `logstash_admin` role inherits the `manage_logstash_pipelines` cluster privilege for centralized pipeline management.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Logstash 9, we can consider to remove this note about upgrading from 7.x

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we create an issue and follow up once we land this change? Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -143,8 +144,8 @@ If you're using {es} in {ecloud}, you can set your auth credentials here.
This setting is an alternative to both `xpack.management.elasticsearch.username`
and `xpack.management.elasticsearch.password`. If `cloud_auth` is configured,
those settings should not be used.
The credentials you specify here should be for a user with the `logstash_admin` role, which
provides access to system indices for managing configurations.
The credentials you specify here should be for a user with the `logstash_admin` and `logstash_system` roles, which
Copy link
Contributor Author

Choose a reason for hiding this comment

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

xpack feature need to call /_xpack, so logstash_system is a must

@kaisecheng kaisecheng marked this pull request as ready for review January 15, 2025 22:00
@robbavey robbavey requested a review from karenzone January 22, 2025 14:25
Copy link
Contributor

@karenzone karenzone left a comment

Choose a reason for hiding this comment

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

Builds and renders cleanly. Left minor comments inline for consideration. Otherwise, LGTM.

NOTE: I did a docs-only review, and I did not test these changes to validate them.

@@ -1,6 +1,6 @@
[discrete]
[[ls-user-access]]
=== Granting access to the Logstash indices
=== Granting access to the indices Logstash creates
Copy link
Contributor

Choose a reason for hiding this comment

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

Ohhhhh, I LIKE this. Nice clarification.

Copy link
Contributor

@mashhurs mashhurs left a comment

Choose a reason for hiding this comment

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

I have suggested nits, tested and LGTM!

Comment on lines +17 to +22
"indices": [
{
"names": [ "logstash-*" ],
"privileges": ["read","view_index_metadata"]
}
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, thanks for fixing this. Indeed names and privileges are required fields.

should have the built-in `logstash_admin` role and `logstash_system` role, which provides access to system
indices for managing configurations.

NOTE: Starting with Elasticsearch version 7.10.0, the `logstash_admin` role inherits the `manage_logstash_pipelines` cluster privilege for centralized pipeline management.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we create an issue and follow up once we land this change? Thank you!

Copy link
Contributor

📃 DOCS PREVIEWhttps://logstash_bk_16902.docs-preview.app.elstc.co/diff

@kaisecheng kaisecheng merged commit dc740b4 into elastic:main Jan 23, 2025
5 checks passed
@kaisecheng
Copy link
Contributor Author

@logstashmachine backport 8.x

github-actions bot pushed a commit that referenced this pull request Jan 23, 2025
…6902)

CPM requires two roles logstash_admin and logstash_system

Co-authored-by: Karen Metts <[email protected]>
(cherry picked from commit dc740b4)
@kaisecheng
Copy link
Contributor Author

@logstashmachine backport 8.17

@kaisecheng
Copy link
Contributor Author

@logstashmachine backport 7.17

github-actions bot pushed a commit that referenced this pull request Jan 23, 2025
…6902)

CPM requires two roles logstash_admin and logstash_system

Co-authored-by: Karen Metts <[email protected]>
(cherry picked from commit dc740b4)
kaisecheng added a commit that referenced this pull request Jan 23, 2025
…6902) (#16930)

CPM requires two roles logstash_admin and logstash_system

Co-authored-by: Karen Metts <[email protected]>
(cherry picked from commit dc740b4)

Co-authored-by: kaisecheng <[email protected]>
kaisecheng added a commit that referenced this pull request Jan 23, 2025
…6902) (#16928)

CPM requires two roles logstash_admin and logstash_system

Co-authored-by: Karen Metts <[email protected]>
(cherry picked from commit dc740b4)

Co-authored-by: kaisecheng <[email protected]>
kaisecheng added a commit to kaisecheng/logstash that referenced this pull request Jan 23, 2025
[doc] fix the necessary privileges of central pipeline management
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Doc] update the example of using central pipeline management
3 participants