Skip to content

[Ai4DSoc][Serverless] Update search_ai_lake tier specific roles#229919

Merged
ashokaditya merged 18 commits intoelastic:mainfrom
ashokaditya:task/pre-defined-roles-ai4dsoc
Aug 8, 2025
Merged

[Ai4DSoc][Serverless] Update search_ai_lake tier specific roles#229919
ashokaditya merged 18 commits intoelastic:mainfrom
ashokaditya:task/pre-defined-roles-ai4dsoc

Conversation

@ashokaditya
Copy link
Copy Markdown
Member

@ashokaditya ashokaditya commented Jul 30, 2025

Summary

Adds changes to allow switching search_ai_lake pre-defined roles selection based on security project tier

Note: The changes in this PR is to minimise changes to all the files that use the serverless roles from src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/<projectType>. Ideally we should introduce the ability to pick roles based on project type and project tier.

clip for roles with search_ai_lake_tier
ai4soc-role-logins

Testing
On a CLI:

  1. Within your local serverless.security.dev.yml (make a copy of serverless.security.yml) file ensure that only the search_ai_lake tier is active
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' }
  ]
  1. Run serverless ES with productType=search_ai_lake
yarn es serverless --kill --license trial -E xpack.security.authc.api_key.enabled=true --projectType security --productType search_ai_lake --kibanaUrl=http://0.0.0.0:5601
  1. On another cli window run Kibana with
yarn serverless-security --no-base-path
  1. On a browser, navigate to http://0.0.0.0:5601/ and verify that the Test User login method is selected and a dropdown with two roles (specific to search_ai_lake) is seen.

  2. Repeat the test at step 1. with other product tiers active, and verify that the usual set of roles are loaded.

xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'security', product_tier: 'complete' },
    { product_line: 'endpoint', product_tier: 'complete' },
  ]

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@ashokaditya ashokaditya self-assigned this Jul 30, 2025
@ashokaditya ashokaditya added v9.2.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Defend Workflows “EDR Workflows” sub-team of Security Solution OLM Sprint labels Jul 30, 2025
@ashokaditya ashokaditya force-pushed the task/pre-defined-roles-ai4dsoc branch from 4091b2c to a6bda9d Compare July 30, 2025 14:42
@ashokaditya ashokaditya marked this pull request as ready for review July 31, 2025 07:02
@ashokaditya ashokaditya requested review from a team as code owners July 31, 2025 07:02
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@ashokaditya ashokaditya marked this pull request as draft July 31, 2025 07:12
@ashokaditya ashokaditya force-pushed the task/pre-defined-roles-ai4dsoc branch 3 times, most recently from 2311854 to fe5e42b Compare August 4, 2025 12:40
Copy link
Copy Markdown
Contributor

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/security/search_ai_lake.roles.yml LGTM

@ashokaditya ashokaditya force-pushed the task/pre-defined-roles-ai4dsoc branch 2 times, most recently from 884fa54 to e0afc94 Compare August 5, 2025 10:17
);
}

if (options.productTier) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

productTier is optional with this change to minimise the changes needed in all the files that use src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/security/roles.yml for security serverless tests.

@@ -1,6 +1,5 @@
# -----
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

With the introduction of ability to load product tier specific roles, ideally the role files within src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/ for each project should take into account product tiers.

In the furture we should address this in Kibana by renaming/moving role files such as:

src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/security/essentials.roles.yml

or

src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/security/essentials/roles.yml

@ashokaditya ashokaditya force-pushed the task/pre-defined-roles-ai4dsoc branch from e0afc94 to 545703d Compare August 5, 2025 10:49
@ashokaditya ashokaditya marked this pull request as ready for review August 5, 2025 11:05
@ashokaditya ashokaditya requested a review from a team as a code owner August 5, 2025 11:05
@ashokaditya ashokaditya requested review from azasypkin and jbudz August 5, 2025 11:05
@SiddharthMantri SiddharthMantri self-requested a review August 5, 2025 12:16
@ashokaditya ashokaditya requested a review from parkiino August 6, 2025 12:22
Copy link
Copy Markdown
Contributor

@gergoabraham gergoabraham left a comment

Choose a reason for hiding this comment

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

great! 🚀

}

export const serverlessProjectTypes = new Set<string>(['es', 'oblt', 'security', 'chat']);
export const ServerlessProductTiers = new Set<string>([
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nittest of all nits: should start with small letter

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nice catch. Fixed that in c8bfdaf

@ashokaditya ashokaditya enabled auto-merge (squash) August 7, 2025 17:23
@ashokaditya ashokaditya disabled auto-merge August 8, 2025 04:16
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Aug 8, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #116 / discover/group6 discover unsaved changes badge should not show a badge after loading a saved search, only after changes

Metrics [docs]

✅ unchanged

History

cc @ashokaditya

Copy link
Copy Markdown
Contributor

@charlie-pichette charlie-pichette left a comment

Choose a reason for hiding this comment

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

👍🏼

@ashokaditya ashokaditya merged commit 44c5c5f into elastic:main Aug 8, 2025
13 checks passed
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
…astic#229919)

## Summary

Adds changes to allow switching `search_ai_lake` pre-defined roles
selection based on security project tier

Note: The changes in this PR is to minimise changes to all the files
that use the serverless roles from
`src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/<projectType>`.
Ideally we should introduce the ability to pick roles based on project
type and project tier.

clip for roles with `search_ai_lake_tier`

![ai4soc-role-logins](https://github.com/user-attachments/assets/95e1dea0-afbd-49fa-a215-49d1bce17aa3)

**Testing**
On a CLI:

1. Within your local `serverless.security.dev.yml` (make a copy of
`serverless.security.yml`) file ensure that only the `search_ai_lake`
tier is active
```js
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' }
  ]
```

2. Run serverless ES with `productType=search_ai_lake`
```
yarn es serverless --kill --license trial -E xpack.security.authc.api_key.enabled=true --projectType security --productType search_ai_lake --kibanaUrl=http://0.0.0.0:5601
```

3. On another cli window run Kibana with
```
yarn serverless-security --no-base-path
```

4. On a browser, navigate to `http://0.0.0.0:5601/` and verify that the
Test User login method is selected and a dropdown with two roles
(specific to `search_ai_lake`) is seen.

5. Repeat the test at step 1. with other product tiers active, and
verify that the usual set of roles are loaded.
```
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'security', product_tier: 'complete' },
    { product_line: 'endpoint', product_tier: 'complete' },
  ]
```

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
qn895 pushed a commit to qn895/kibana that referenced this pull request Aug 26, 2025
…astic#229919)

## Summary

Adds changes to allow switching `search_ai_lake` pre-defined roles
selection based on security project tier

Note: The changes in this PR is to minimise changes to all the files
that use the serverless roles from
`src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/<projectType>`.
Ideally we should introduce the ability to pick roles based on project
type and project tier.

clip for roles with `search_ai_lake_tier`

![ai4soc-role-logins](https://github.com/user-attachments/assets/95e1dea0-afbd-49fa-a215-49d1bce17aa3)

**Testing**
On a CLI:

1. Within your local `serverless.security.dev.yml` (make a copy of
`serverless.security.yml`) file ensure that only the `search_ai_lake`
tier is active
```js
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' }
  ]
```

2. Run serverless ES with `productType=search_ai_lake`
```
yarn es serverless --kill --license trial -E xpack.security.authc.api_key.enabled=true --projectType security --productType search_ai_lake --kibanaUrl=http://0.0.0.0:5601
```

3. On another cli window run Kibana with
```
yarn serverless-security --no-base-path
```

4. On a browser, navigate to `http://0.0.0.0:5601/` and verify that the
Test User login method is selected and a dropdown with two roles
(specific to `search_ai_lake`) is seen.

5. Repeat the test at step 1. with other product tiers active, and
verify that the usual set of roles are loaded.
```
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'security', product_tier: 'complete' },
    { product_line: 'endpoint', product_tier: 'complete' },
  ]
```

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
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 OLM Sprint release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.19.1 v9.1.1 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.