Skip to content

[Security Solution] Realign privileges serverless and ess#207258

Closed
semd wants to merge 9 commits intoelastic:mainfrom
semd:207050/realign_serverless_ess_privileges
Closed

[Security Solution] Realign privileges serverless and ess#207258
semd wants to merge 9 commits intoelastic:mainfrom
semd:207050/realign_serverless_ess_privileges

Conversation

@semd
Copy link
Copy Markdown
Contributor

@semd semd commented Jan 20, 2025

Summary

Issue: #207050

Re-consolidate the Security features and privileges for serverless and ESS environments. This was not possible before due to the lack of role migrations.

The only privilege that needs to be migrated is endpoint-exceptions, which is currently a sub-feature only in serverless projects. This PR is making this privilege a sub-feature everywhere, also in stateful environments.
It also migrates all existing roles to the new structure, preventing the introduction of breaking changes.

Next changes

After these changes, we will be able to reduce a lot of complexity from the ProductFeatures service, using the feature configs in the package as the SSoT directly.

The refactor of the ProductFeatures service will be done in a separate task, targeting 8.19/9.1, after the proposal is agreed upon by all relevant teams.
Realigning the privilege configs is the first step in that direction.

Screenshot

Endpoint exceptions sub-feature

@semd semd added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Defend Workflows “EDR Workflows” sub-team of Security Solution backport:version Backport to applied version labels v8.18.0 labels Jan 20, 2025
@semd semd self-assigned this Jan 20, 2025
@semd semd marked this pull request as ready for review January 21, 2025 15:07
@semd semd requested review from a team as code owners January 21, 2025 15:07
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-defend-workflows (Team:Defend Workflows)

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-threat-hunting-explore (Team:Threat Hunting:Explore)

@semd
Copy link
Copy Markdown
Contributor Author

semd commented Jan 22, 2025

@elasticmachine merge upstream

@semd
Copy link
Copy Markdown
Contributor Author

semd commented Jan 22, 2025

I noticed a problem. It only happens with particular set of conditions:

  • Security serverless projects
  • A custom role is defined with:
    • Security top-level feature is All.
    • Security sub-features are enabled
    • Security > Endpoint Exceptions sub-feature is Read

In this scenario, the role migration will assign Security > Endpoint Exceptions: All, a privilege not granted before. This happens because the Security minimal_all is configured to do so, which is necessary for non-serverless environments.

Changing to PR to draft while we try to find a solution that works for all environments.

@semd semd marked this pull request as draft January 22, 2025 14:31
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jan 22, 2025

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jan 23, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #97 / security (basic license) Privileges GET /api/security/privileges should include sub-feature privileges when respectlicenseLevel is false
  • [job] [logs] FTR Configs #97 / security (basic license) Privileges GET /api/security/privileges should include sub-feature privileges when respectlicenseLevel is false
  • [job] [logs] FTR Configs #44 / security Privileges GET /api/security/privileges should return a privilege map with all known privileges, without actions
  • [job] [logs] FTR Configs #44 / security Privileges GET /api/security/privileges should return a privilege map with all known privileges, without actions

Metrics [docs]

✅ unchanged

History

cc @semd

@gergoabraham
Copy link
Copy Markdown
Contributor

gergoabraham commented May 5, 2025

I noticed a problem. It only happens with particular set of conditions:

  • Security serverless projects

  • A custom role is defined with:

    • Security top-level feature is All.
    • Security sub-features are enabled
    • Security > Endpoint Exceptions sub-feature is Read

In this scenario, the role migration will assign Security > Endpoint Exceptions: All, a privilege not granted before. This happens because the Security minimal_all is configured to do so, which is necessary for non-serverless environments.

Changing to PR to draft while we try to find a solution that works for all environments.

hey @semd,

i've added a PR that hopefully fixes the issue you described by adding role migration conditionally based on build flavor. i'll add you as a reviewer, could you take a look at it sometime? i'd be happy to have your thoughts and concerns on this approach.

pr: #219566
the related commit is called unify and migrate endpoint exceptions RBAC

the pr is still draft, as i'm still fixing the tests, and also, planning to keep the pr open for a while, so we can collect more siemV2->siemV3 migrations if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants