Skip to content

feat(security,serverless): enable UIAM mode by default#260546

Merged
azasypkin merged 3 commits intoelastic:mainfrom
azasypkin:issue-xxx-enable-uiam-by-default
Apr 7, 2026
Merged

feat(security,serverless): enable UIAM mode by default#260546
azasypkin merged 3 commits intoelastic:mainfrom
azasypkin:issue-xxx-enable-uiam-by-default

Conversation

@azasypkin
Copy link
Copy Markdown
Contributor

@azasypkin azasypkin commented Mar 31, 2026

Summary

Now that UIAM powers all our environments by default, it's time to enable UIAM mode by default for local dev and CI setups (all Serverless tets).

For a couple of months, I'm still keeping the --no-uiam flags for both Kibana and Elasticsearch as an escape hatch for developers in case things go awry. While the risk of such an event is low, local/CI UIAM involves two additional containers, so it's better to be safe.

@azasypkin azasypkin force-pushed the issue-xxx-enable-uiam-by-default branch 5 times, most recently from 6248c55 to 2ae720e Compare April 1, 2026 01:55
'--env',
`quarkus.log.category."co.elastic.cloud.uiam".level=${env.UIAM_APP_LOGGING_LEVEL}`,
'--env',
`quarkus.log.category."co.elastic.cloud.uiam.app.authentication.ClientCertificateExtractor".level=${env.UIAM_LOGGING_LEVEL}`,
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.

note: it's a way too noisy.

@azasypkin azasypkin force-pushed the issue-xxx-enable-uiam-by-default branch 4 times, most recently from ae068f9 to 4b76ad5 Compare April 1, 2026 15:00
@azasypkin azasypkin force-pushed the issue-xxx-enable-uiam-by-default branch from 4b76ad5 to 2f2bde2 Compare April 1, 2026 17:48
const customRolesFileName = process.env.ROLES_FILENAME_OVERRIDE;
const cloudUsersFilePath = resolve(REPO_ROOT, '.ftr', customRolesFileName ?? 'role_users.json');

const kbnServerOptions = getopts(config.get('kbnTestServer.serverArgs'), {
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.

note: Replicates what we do for Scout.

@@ -47,7 +47,7 @@ export default createTestConfig({
// useful for testing (also enabled in MKI QA)
'--coreApp.allowDynamicConfigOverrides=true',
`--xpack.securitySolutionServerless.cloudSecurityUsageReportingTaskInterval=5s`,
`--xpack.securitySolutionServerless.usageApi.url=http://localhost:8081`,
`--xpack.securitySolutionServerless.usageApi.url=http://localhost:8089`,
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.

note: 8081 conflicts with UIAM containers that occupy 8081, 8082, and 8443.

@@ -17,7 +18,7 @@ export const setupMockServer = () => {
};

const autoOpsHandler = http.post(
'/monitoring/serverless/v1/projects/fakeprojectid/metrics',
`/monitoring/serverless/v1/projects/${MOCK_IDP_UIAM_PROJECT_ID}/metrics`,
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.

note: we use project ID that follows the proper project ID format.

@@ -19,7 +19,7 @@ export default createTestConfig({
`--xpack.task_manager.unsafe.exclude_task_types=${JSON.stringify(['Fleet-Metrics-Task'])}`,
'--coreApp.allowDynamicConfigOverrides=true',
`--xpack.securitySolutionServerless.cloudSecurityUsageReportingTaskInterval=5s`,
`--xpack.securitySolutionServerless.usageApi.url=http://localhost:8081`,
`--xpack.securitySolutionServerless.usageApi.url=http://localhost:8089`,
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.

note: 8081 conflicts with UIAM containers that occupy 8081, 8082, and 8443.

@@ -25,7 +25,7 @@ export default createTestConfig({
// useful for testing (also enabled in MKI QA)
'--coreApp.allowDynamicConfigOverrides=true',
`--xpack.securitySolutionServerless.cloudSecurityUsageReportingTaskInterval=5s`,
`--xpack.securitySolutionServerless.usageApi.url=http://localhost:8081`,
`--xpack.securitySolutionServerless.usageApi.url=http://localhost:8089`,
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.

note: 8081 conflicts with UIAM containers that occupy 8081, 8082, and 8443.

@@ -51,7 +51,7 @@ export default function (providerContext: FtrProviderContext) {
let roleAuthc: RoleCredentials;
let internalRequestHeader: { 'x-elastic-internal-origin': string; 'kbn-xsrf': string };
before(async () => {
mockUsageApiServer = mockUsageApiApp.listen(8081); // Start the usage api mock server on port 8081
mockUsageApiServer = mockUsageApiApp.listen(8089); // Start the usage api mock server on port 8089
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.

note: 8081 conflicts with UIAM containers that occupy 8081, 8082, and 8443.

@azasypkin azasypkin marked this pull request as ready for review April 1, 2026 19:16
@azasypkin azasypkin requested review from a team as code owners April 1, 2026 19:16
Copy link
Copy Markdown
Contributor

@szwarckonrad szwarckonrad left a comment

Choose a reason for hiding this comment

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

DW changes LGTM!

@azasypkin azasypkin added ci:build-serverless-image release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Apr 1, 2026
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.

You can now switch from { tag: tags.serverless.observability.complete } to { tag: tags.serverless.all } if you want to.

? {
uiam: kbnServerOptions['xpack.security.uiam.enabled'] ?? false,
projectType: kbnServerOptions.serverless as ServerlessProjectType,
organizationId: kbnServerOptions['xpack.cloud.organization_id']!,
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.

question: how important to have OrgId defined in tests and should we consider default value?

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.

It is required by the UIAM session token, so it must be defined in ECS and is optional for non-Cloud users in ECH.

should we consider default value?

I'm setting it in the base config for both Serverless Scout and API integration tests, or do you think it should be defined elsewhere?

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.

All good, thank you 👍

Comment on lines +164 to +165
? 'ci:ZXMwMTo5MjIwJDo5MjIwJGtpYmFuYTo5MjIw'
: 'local-dev:ZG9ja2VyLmludGVybmFsOjkyMjAkaG9zdDo5MjIwJGtpYmFuYTo5MjIw'
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.

question: I'm not sure what package suits best, but could we move it to a single place and imports as const in kbn/scout and default FTR configs?

I recently decoupled few packages from kbn/test and we don't want Scout to depend on kbn/test, so if there is no good spot I'm ok with duplication.

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.

I'm not sure what package suits best, but could we move it to a single place and imports as const in kbn/scout and default FTR configs?

Yeah, it's a good idea, maybe I'll just move it to src/platform/packages/private/kbn-mock-idp-utils/src/constants.ts where we have the rest of the similar consts.

Copy link
Copy Markdown
Contributor

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

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

Scout/FTR config changes LGTM

Copy link
Copy Markdown
Contributor

@ersin-erdal ersin-erdal left a comment

Choose a reason for hiding this comment

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

ResponseOps changes LGTM

@azasypkin azasypkin removed the request for review from ashokaditya April 2, 2026 11:27
Copy link
Copy Markdown
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

code owner changes lgtm

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 7, 2026

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: bc28cb9
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-260546-bc28cb9c8537

Failed CI Steps

Test Failures

  • [job] [logs] affected Scout: [ platform / navigation ] plugin / local-serverless-security_complete - navigation - has security serverless side nav
  • [job] [logs] affected Scout: [ platform / navigation ] plugin / local-serverless-security_complete - navigation - opens panel on legacy management landing page

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/mock-idp-utils 61 62 +1
Unknown metric groups

API count

id before after diff
@kbn/mock-idp-utils 69 70 +1

History

Copy link
Copy Markdown
Contributor

@kc13greiner kc13greiner left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@azasypkin azasypkin merged commit 17ac072 into elastic:main Apr 7, 2026
18 checks passed
@azasypkin azasypkin deleted the issue-xxx-enable-uiam-by-default branch April 7, 2026 12:27
kelvtanv pushed a commit to kelvtanv/kibana that referenced this pull request Apr 7, 2026
## Summary

Now that UIAM powers all our environments by default, it's time to
enable UIAM mode by default for local dev and CI setups (all Serverless
tets).

For a couple of months, I'm still keeping the `--no-uiam` flags for both
Kibana and Elasticsearch as an escape hatch for developers in case
things go awry. While the risk of such an event is low, local/CI UIAM
involves two additional containers, so it's better to be safe.
tylersmalley added a commit that referenced this pull request Apr 7, 2026
azasypkin added a commit that referenced this pull request Apr 9, 2026
…entication (#261873)

## Summary

Switch Security Cypress tests to use UIAM authentication.

__Related:__ #260546
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:build-serverless-image release_note:skip Skip the PR/issue when compiling release notes v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.