-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] Allow package to specify cluster privileges #114945
[Fleet] Allow package to specify cluster privileges #114945
Conversation
22fe4e2
to
e9a1c80
Compare
Pinging @elastic/fleet (Team:Fleet) |
@@ -121,12 +121,25 @@ export async function storedPackagePoliciesToAgentPermissions( | |||
}); | |||
} | |||
|
|||
let clusterRoleDescriptor = {}; | |||
if ( | |||
packagePolicy.elasticsearch && |
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.
nit: we could use optional chaining ?.
for this and save a few lines
💚 Build SucceededMetrics [docs]Public APIs missing comments
Saved Objects .kibana field count
History
To update your PR or re-run it, just comment with: cc @nchaulet |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…115416) * [Fleet] Allow package to specify cluster privileges (#114945) * Fix types * Fix types Co-authored-by: Nicolas Chaulet <[email protected]>
Summary
Resolve #114686
Related to elastic/package-spec#226
Depends on elastic/package-registry#750
Allow packages to specify cluster privileges:
elasticsearch.privileges.cluster: ["monitor"]
in the package manifest.yml this will be returned by the package registry APIHow to tests
I added basic unit test to ensure we generate the correct privileges
This PR is a little hard to test locally as there is a lot of moving parts, this is how I tested it my self:
elasticsearch.privileges.cluster: ["monitor_ml"]
in the manifest.yml.fleet-agents
for the default api key to check if the API key has the correct privileges