Skip to content

[Security solution] Endpoint exception RBAC in ESS siemV4 for 9.2#233433

Merged
tomsonpl merged 55 commits intoelastic:mainfrom
gergoabraham:siem-v4
Sep 26, 2025
Merged

[Security solution] Endpoint exception RBAC in ESS siemV4 for 9.2#233433
tomsonpl merged 55 commits intoelastic:mainfrom
gergoabraham:siem-v4

Conversation

@gergoabraham
Copy link
Copy Markdown
Contributor

@gergoabraham gergoabraham commented Aug 29, 2025

should be merged on the same week as:

Tip

Apologies for the huge PR. To help getting started, as we're getting closer to feature freeze:

  • The meaningful changes are only ca. 600 lines, while one snapshot test update (authorization.ts) is 3k lines on its own, and the rest is test updates and the necessary small updates in different plugins. But all the changes belong together unfortunately.
  • Exploratory migration tests are already performed from siemV3 to siemV4, both on ESS and serverless environments, both with custom and pre-defined roles when applicable. (result 1, result 2, result 3)
  • I added some comments on the changes with this Tip format to help the review.

Summary

The goal of this PR is to add Endpoint Exceptions sub-feature privilege to ESS and Serverless in the same way.

image

(with new text)

ESS

On ESS, Endpoint Exceptions did not have its own sub-privilege: it was included implicitly in the Security privilege (Security:ALL => EE:ALL, Security:READ => EE:READ). Therefore, a replacedBy role migration and api backward compatibility was added, in order to preserve behavior for the users.

Serverless

On Serverless, Endpoint Exceptions sub-feature privilege has already existed in the following way:

  • with Security sub-feature privilege customization disabled, it was included in Security privilege (not like other artifact sub-privileges as they are never included).
  • with sub-feature privilege customization enabled, it was defined by the Endpoint Exception sub-feature privilege manually.

Here, a replacedBy role migration and api backward compatibility was also added.

Including Endpoint Exceptions in Security:READ/ALL

Endpoint Exceptions is not included anymore in Security:READ/ALL privileges, it always has to be explicitly allowed, similarly to other artifacts.

Before (screenshot from serverless. on ESS it was hidden) After
imageimage imageimage
imageimage imageimage

Feature deprecations / role migrations

security:NONE

image
flowchart LR

    subgraph siemV3[siem/siemV2/siemV3]
        none1[none]
    end

    subgraph siemV4
        none2[none]
    end

    none1 --> none2
Loading

security:READ - same for ESS and serverless

image
flowchart LR

    subgraph siemV2[siem/siemV2/siemV3]
        read1[read]
    end

    subgraph siemV4
        read2[minimal_read]
        endpoint_exceptions_read
    end

    read1 --enable sub-feature privilege customization toggle--> read2
    read1 --> endpoint_exceptions_read
Loading

security:MINIMAL_READ (when the sub-feature customizsation toggle is enabled)

image

ESS

flowchart LR

    subgraph siemV2[siem/siemV2/siemV3]
        read1[minimal_read]
    end

    subgraph siemV4
        read2[minimal_read]
        endpoint_exceptions_read
    end

    read1 --> read2
    read1 --> endpoint_exceptions_read
Loading

Serverless - no change

flowchart LR

    subgraph siemV2[siem/siemV2/siemV3]
        read1[minimal_read]
        eer1[endpoint_exceptions_read]
        eew1[endpoint_exceptions_all]
    end

    subgraph siemV4
        read2[minimal_read]
        eer2[endpoint_exceptions_read]
        eew2[endpoint_exceptions_all]
    end

    read1 --> read2
    eer1 --> eer2
    eew1 --> eew2
Loading

security:ALL - same for ESS and serverless

image
flowchart LR

    subgraph siemV2[siem/siemV2/siemV3]
        all1[all]
    end

    subgraph siemV4
        read2[minimal_all]
        endpoint_exceptions_all
    end

    all1 --enable sub-feature privilege customization toggle--> read2
    all1 --> endpoint_exceptions_all
Loading

security:MINIMAL_ALL (when the sub-feature customization toggle is enabled)

image

ESS

flowchart LR

    subgraph siemV2[siem/siemV2/siemV3]
        all1[minimal_all]
    end

    subgraph siemV4
        all2[minimal_all]
        endpoint_exceptions_all
    end

    all1 --> all2
    all1 --> endpoint_exceptions_all
Loading

Serverless - no change

flowchart LR

    subgraph siemV2[siem/siemV2/siemV3]
        all1[minimal_all]
        eer1[endpoint_exceptions_read]
        eew1[endpoint_exceptions_all]
    end

    subgraph siemV4
        all2[minimal_all]
        eer2[endpoint_exceptions_read]
        eew2[endpoint_exceptions_all]
    end

    all1 --> all2
    eer1 --> eer2
    eew1 --> eew2
Loading

Testing ✅ done

see result 1, result 2, result 3

It should be tested on cloud deploy, both serverless and ESS.

What to test?

  • [serverless only] Pre-defined roles (like viewer, t1_analyst etc.) behave the same as before regarding endpoint exception access.
  • [ESS] Users having security none/read/all privilege on previous siem versions have the same endpoint exception access as before.*
  • [serverless+ESS] Deprecated roles are replaced as expected.*

* For these, custom roles can be created in the Dev console with previous siem versions.

Dev console commands
// Creating or updating `testrole` custom role on ESS and Serverless
PUT kbn://api/security/role/testrole
{
  "elasticsearch": {
    "cluster": [
      "manage"
    ],
    "indices": [
      {
        "names": [
          "logs-*",
          ".lists-*",
          ".items-*",
          ".alerts-security.alerts-*",
          ".siem-signals*"
        ],
        "privileges": [
          "read",
          "write",
          "view_index_metadata",
          "manage"
        ],
        "field_security": {
          "grant": [
            "*"
          ],
          "except": []
        },
        "allow_restricted_indices": false
      }
    ],
    "run_as": []
  },
  "kibana": [
    {
      "base": [],
      "feature": {
        "siem": [ // this can be siem | siemV2 | siemV3 | siemV4
          "all", // read | minimal_read | all | minimal_all, or without this
          "endpoint_exceptions_read", // only on serverless, _read or _all, or without this
          "global_artifact_management_all" // coming from siem|siemV2 this is added automatically, but siemV3|siemV4 this is needed for write access
        ],
        "dev_tools": [
          "all"
        ]
      },
      "spaces": [
        "*"
      ]
    }
  ]
}

// Reading the custom role as how it is stored
GET kbn://api/security/role/testrole

// Reading the custom role with replacing the deprecated features
GET kbn://api/security/role/testrole?replaceDeprecatedPrivileges=true

// Creating a user on ESS
POST kbn://internal/security/users/testuser
{
  "password": "changeme",
  "username": "testuser",
  "full_name": "",
  "email": "",
  "roles": [
    "testrole"
  ]
}

Note

Coming from siem or siemV2 security:ALL will include global_artifact_management_all as well. See #219566
Coming from siem will add new features next to siemV4: securitySolutionTimeline and securitySolutionNotes. See #201780

What not to test?

What should be seen is that the role migration works well. What won't be seen is that setting Endpoint Exception sub-privilege has the expected effect, as there are some authorization bugs on UI side. These bugs will being fixed while this PR is under review, in a follow-up PR. Issue: https://github.com/elastic/security-team/issues/13921

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

Release notes

Endpoint exceptions sub-privilege is added to ESS. From now on, Endpoint Exception access needs to be explicitly set both on ESS and Serverless for user roles.

Doc issue

@gergoabraham gergoabraham self-assigned this Aug 29, 2025
Copy link
Copy Markdown
Contributor

@logeekal logeekal left a comment

Choose a reason for hiding this comment

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

PR looks LGTM from investigations perspective. Thanks for detailed PR description. It helped in better understanding and testing.

Copy link
Copy Markdown
Contributor

@vgomez-el vgomez-el left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Focused my review on serverless.security.yml. Based on the description for siemv4 this makes sense.

@dasansol92
Copy link
Copy Markdown
Contributor

@elasticmachine merge upstream

@dasansol92
Copy link
Copy Markdown
Contributor

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Sep 26, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #112 / alerting api integration security and spaces enabled - Group 2 Connectors webhook action OAuth2 client credentials should refresh the token once the previous one has expired

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
securitySolution 10.8MB 10.8MB -34.0B
Unknown metric groups

References to deprecated APIs

id before after diff
@kbn/test-suites-xpack-security 33 29 -4

History

cc @gergoabraham

@tomsonpl tomsonpl merged commit 590de2d into elastic:main Sep 26, 2025
13 checks passed
@gergoabraham gergoabraham deleted the siem-v4 branch October 10, 2025 09:08
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
gergoabraham added a commit that referenced this pull request Oct 30, 2025
## Summary

Update `security` roles used in local serverless instance and in tests:
- switch from `siemV3` to `siemV4`
- apply the migration from the following Kibana PR:
  - #233433
  - rules:
    - security ALL -> endpoint exceptions ALL
    - security READ -> endpoint exceptions READ
- **BUGFIX**: t1/t2 analyst roles lose their endpoint exceptions READ
access, as intended

PR in `elasticsearch-controller`:
- elastic/elasticsearch-controller#1223
sbelastic pushed a commit to sbelastic/kibana that referenced this pull request Oct 30, 2025
## Summary

Update `security` roles used in local serverless instance and in tests:
- switch from `siemV3` to `siemV4`
- apply the migration from the following Kibana PR:
  - elastic#233433
  - rules:
    - security ALL -> endpoint exceptions ALL
    - security READ -> endpoint exceptions READ
- **BUGFIX**: t1/t2 analyst roles lose their endpoint exceptions READ
access, as intended

PR in `elasticsearch-controller`:
- elastic/elasticsearch-controller#1223
ana-davydova pushed a commit to ana-davydova/kibana that referenced this pull request Nov 3, 2025
## Summary

Update `security` roles used in local serverless instance and in tests:
- switch from `siemV3` to `siemV4`
- apply the migration from the following Kibana PR:
  - elastic#233433
  - rules:
    - security ALL -> endpoint exceptions ALL
    - security READ -> endpoint exceptions READ
- **BUGFIX**: t1/t2 analyst roles lose their endpoint exceptions READ
access, as intended

PR in `elasticsearch-controller`:
- elastic/elasticsearch-controller#1223
albertoblaz pushed a commit to albertoblaz/kibana that referenced this pull request Nov 4, 2025
## Summary

Update `security` roles used in local serverless instance and in tests:
- switch from `siemV3` to `siemV4`
- apply the migration from the following Kibana PR:
  - elastic#233433
  - rules:
    - security ALL -> endpoint exceptions ALL
    - security READ -> endpoint exceptions READ
- **BUGFIX**: t1/t2 analyst roles lose their endpoint exceptions READ
access, as intended

PR in `elasticsearch-controller`:
- elastic/elasticsearch-controller#1223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting ci:cloud-deploy Create or update a Cloud deployment ci:cloud-persist-deployment Persist cloud deployment indefinitely ci:project-deploy-security Create a Security Serverless Project ci:project-persist-deployment Persist project deployment indefinitely release_note:feature Makes this part of the condensed release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution Team:Fleet Team label for Observability Data Collection Fleet team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.