Skip to content

[Observability serverless] turn on custom roles by default#227878

Merged
pheyos merged 17 commits intoelastic:mainfrom
dominiqueclarke:feature/observability-custom-roles-on-by-default
Jul 18, 2025
Merged

[Observability serverless] turn on custom roles by default#227878
pheyos merged 17 commits intoelastic:mainfrom
dominiqueclarke:feature/observability-custom-roles-on-by-default

Conversation

@dominiqueclarke
Copy link
Copy Markdown
Contributor

@dominiqueclarke dominiqueclarke commented Jul 14, 2025

Summary

Relates to #219861
Relates to https://github.com/elastic/observability-dev/issues/4539

Turns on Custom roles by default in serverless by turning on the feature flag

Original implementation found here.

Moves tests from the feature flag specific files to the standard files.

@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label Jul 14, 2025
@dominiqueclarke dominiqueclarke force-pushed the feature/observability-custom-roles-on-by-default branch from cebc101 to 5970f48 Compare July 14, 2025 16:43
@dominiqueclarke dominiqueclarke changed the title observability serverless - turn on custom roles by default [Observability serverless] turn on custom roles by default Jul 14, 2025
@dominiqueclarke dominiqueclarke marked this pull request as ready for review July 14, 2025 16:45
@dominiqueclarke dominiqueclarke requested review from a team as code owners July 14, 2025 16:45
@dominiqueclarke dominiqueclarke requested review from a team as code owners July 14, 2025 16:53
@dominiqueclarke dominiqueclarke requested a review from a team as a code owner July 15, 2025 14:00
Copy link
Copy Markdown
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

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

I noticed that we still have some tests that are specifically skipped for OBLT that can be unskipped now that we're enabling custom roles. Can we audit the code for instances like this and evaluate?

// custom roles are not enabled for observability projects
this.tags(['skipSvlOblt']);


# Disable role management (custom roles)
xpack.security.roleManagementEnabled: false
xpack.security.roleManagementEnabled: true
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.

Nit: as this defaults to true, I think we can just remove it, along with the comment.

Copy link
Copy Markdown
Contributor

@mgiota mgiota left a comment

Choose a reason for hiding this comment

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

Code review, LGTM!

...(options.serverlessProject !== 'oblt'
? ['xpack.security.authc.native_roles.enabled=true']
: []),
'xpack.security.authc.native_roles.enabled=true',
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.

Need to set the ES flag for all project types

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.

I updated this file to remove the skipSvlOblt tags that were preciously in place because custom roles was not yet supported on OBLT.

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.

I removed the roles tests here, which are now run for OBLT from the common config/index.

...(options.serverlessProject !== 'oblt'
? ['xpack.security.authc.native_roles.enabled=true']
: []),
'xpack.security.authc.native_roles.enabled=true',
Copy link
Copy Markdown
Contributor

@jeramysoucy jeramysoucy Jul 16, 2025

Choose a reason for hiding this comment

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

Need to set the ES flag to enable native roles for all project types now.

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.

I removed the skipSvlOblt tags that were here to handle when custom roles was not yet supported.

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.

I removed the skipSvlOblt tags that were here to handle when custom roles was not yet supported.

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jul 16, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🤖 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!)

@jeramysoucy jeramysoucy requested a review from a team as a code owner July 17, 2025 07:40
Copy link
Copy Markdown
Member

@csr csr left a comment

Choose a reason for hiding this comment

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

LGTM, left a few comments.

const platformSecurityUtils = getService('platformSecurityUtils');

describe('Roles', function () {
// custom roles are not enabled for observability projects
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jeramysoucy is the comment at the top still relevant?

// Note: this suite is currently only called from the feature flags test config:
// x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts
// This can be moved into the common config groups once custom roles are enabled
// permanently in serverless.

// loadTestFile(require.resolve('./rules/es_query_consumer'));
loadTestFile(require.resolve('./rules/custom_threshold_consumer'));
loadTestFile(require.resolve('./rules/es_query_consumer'));
loadTestFile(require.resolve('./role_management'));
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.

The suite is skipped for MKI. Do we need to unskip it to be sure custom roles are working on MKI?

@dmlemeshko custom_role_access was added as an example, should it stay and be unkipped now that custom role management is enabled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed here.

…thub.com:dominiqueclarke/kibana into feature/observability-custom-roles-on-by-default
Copy link
Copy Markdown
Contributor

@awahab07 awahab07 left a comment

Choose a reason for hiding this comment

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

obs-ux-logs changes LGTM

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jul 17, 2025

💚 Build Succeeded

  • Buildkite Build
  • Commit: 7f8f6da
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-227878-7f8f6dad4c73

Metrics [docs]

Page load bundle

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

id before after diff
serverlessObservability 14.5KB 14.5KB +2.0B

History

@pheyos pheyos merged commit 9149e15 into elastic:main Jul 18, 2025
12 checks passed
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
…27878)

## Summary

Relates to elastic#219861
Relates to elastic/observability-dev#4539

Turns on Custom roles by default in serverless by turning on the feature
flag

Original implementation found
[here](elastic#219861).

Moves tests from the feature flag specific files to the standard files.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: “jeramysoucy” <jeramy.soucy@elastic.co>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…27878)

## Summary

Relates to elastic#219861
Relates to elastic/observability-dev#4539

Turns on Custom roles by default in serverless by turning on the feature
flag

Original implementation found
[here](elastic#219861).

Moves tests from the feature flag specific files to the standard files.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: “jeramysoucy” <jeramy.soucy@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:obs-ux-management PRs authored by the obs ux management team backport:skip This PR does not require backporting ci:project-deploy-observability Create an Observability project release_note:enhancement v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants