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

[Fleet] Require AgentPolicies:All to add a fleet server #193014

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Sep 16, 2024

Summary

Resolve #187652

In the flow to add a fleet server, we may need to create a fleet server policy, this is why we should require the AgentPolicies:All to add a Fleet server.

That PR address that, and add a unit test to compute that role.

Manual tests

You can after enabling subfeaturePrivileges experimental features and with a trial license create a role with access to Agents:all Settings:all and AgentPolicies:read and check you cannot add a fleet server

UI Change

With Agents:all Settings:all and Without AgentPolicies:all

Screenshot 2024-09-16 at 9 47 46 AM

With Agents:all Settings:all AgentPolicies:alll

Screenshot 2024-09-16 at 9 48 02 AM

@nchaulet nchaulet added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team backport:prev-major Backport to (8.x, 8.16, 8.15) the previous major branch and all later branches still in development labels Sep 16, 2024
@nchaulet nchaulet self-assigned this Sep 16, 2024
@nchaulet nchaulet requested a review from a team as a code owner September 16, 2024 13:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.8MB 1.8MB -15.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 170.1KB 170.2KB +57.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @nchaulet

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

I think it makes sense for the "operator"/superuser persona, who has access to all privileges, to be the one that also manages Fleet Server enrollments. cc @nimarezainia for awareness and feedback.

@nchaulet nchaulet added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.16.0 and removed backport:prev-major Backport to (8.x, 8.16, 8.15) the previous major branch and all later branches still in development labels Sep 16, 2024
@nchaulet nchaulet merged commit 193935c into elastic:main Sep 17, 2024
29 checks passed
@nchaulet nchaulet deleted the fix-add-fleet-server-permissions branch September 17, 2024 12:13
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 17, 2024
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 26, 2024
… (#193156)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Fleet] Require AgentPolicies:All to add a fleet server
(#193014)](#193014)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2024-09-17T12:13:54Z","message":"[Fleet]
Require AgentPolicies:All to add a fleet server
(#193014)","sha":"193935cbf25c96ae1e6952f7233f001053e60a59","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor","v8.16.0"],"title":"[Fleet]
Require AgentPolicies:All to add a fleet
server","number":193014,"url":"https://github.com/elastic/kibana/pull/193014","mergeCommit":{"message":"[Fleet]
Require AgentPolicies:All to add a fleet server
(#193014)","sha":"193935cbf25c96ae1e6952f7233f001053e60a59"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193014","number":193014,"mergeCommit":{"message":"[Fleet]
Require AgentPolicies:All to add a fleet server
(#193014)","sha":"193935cbf25c96ae1e6952f7233f001053e60a59"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet]: Able to add Fleet Server host and shows invalid command with user role Agent policies: None.
6 participants