Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kbn-test] Disable TLS for svl Kibana #171434

Merged
merged 14 commits into from
Nov 23, 2023

Conversation

dmlemeshko
Copy link
Member

@dmlemeshko dmlemeshko commented Nov 16, 2023

Summary

This PR disables TLS mode for Kibana run in serverless.
Related to #170417 enabling serverless roles testing
Blocked by #171513

PR is created in cooperation with @azasypkin and intended to simplify the automated testing process for serverless:
starting Kibana with TLS enabled adds unnecessary complexity to the process of getting session cookie and overall Kibana APIs calling with Dev certificate in the tests.
The selected approach is to disable TLS for Kibana and simply rely on #171513 to configure mocked idp realm for Serverless ES with TLS enabled.

@dmlemeshko dmlemeshko changed the title [skip-ci] [kbn-test] Disable TLS for svl Kibana [kbn-test] Disable TLS for svl Kibana Nov 21, 2023
Comment on lines -174 to -183
// Serverless Specific
if (vars.serverless) {
log.info(`Serverless mode detected`);

vars.esTestCluster.serverArgs.push(
`xpack.security.authc.realms.saml.cloud-saml-kibana.sp.entity_id=http://host.docker.internal:${kibanaPort}`,
`xpack.security.authc.realms.saml.cloud-saml-kibana.sp.logout=http://host.docker.internal:${kibanaPort}/logout`,
`xpack.security.authc.realms.saml.cloud-saml-kibana.sp.acs=http://host.docker.internal:${kibanaPort}/api/security/saml/callback`
);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

It was the reason for Cypress tests to fail. Please avoid overriding SAML configuration for both Kibana & ES, we keep things up-to-date in x-pack/test_serverless/shared/config.base.ts

Copy link
Contributor

Choose a reason for hiding this comment

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

@dmlemeshko if serverless ES is running in docker and Kibana is running locally, then https://github.com/elastic/kibana/blob/main/x-pack/test_serverless/shared/config.base.ts#L78-L80
http://localhost:${servers.kibana.port} is not going to be reachable from ES docker container, because localhost will be referencing the container itself, not the host where Kibana is running

Copy link
Member

Choose a reason for hiding this comment

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

http://localhost:${servers.kibana.port} is not going to be reachable from ES docker container, because localhost will be referencing the container itself, not the host where Kibana is running

Just to confirm my understanding, why do you require Kibana to be accessible from the ES container? If you're referring to URLs in sp.{logout|acs}, then it doesn't matter — ES solely uses these URLs to generate a special URL for redirecting users during login or logout. Hence, the important part here is that the user's browser can access these URLs.

Comment on lines +32 to +37
SAMLResponse: await createSAMLResponse({
username,
roles: [],
kibanaUrl,
}),
});
Copy link
Member Author

Choose a reason for hiding this comment

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

Using @kbn/mock-idp-plugin to get SAML response

@dmlemeshko dmlemeshko marked this pull request as ready for review November 23, 2023 13:29
@dmlemeshko dmlemeshko self-assigned this Nov 23, 2023
@dmlemeshko dmlemeshko added v8.12.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Nov 23, 2023
Copy link
Member

@MadameSheema MadameSheema left a comment

Choose a reason for hiding this comment

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

Thanks!! 🙌

esServerlessOptions?: Pick<ServerlessOptions, 'image' | 'tag' | 'resources' | 'host'>;
esServerlessOptions?: Pick<
ServerlessOptions,
'image' | 'tag' | 'resources' | 'host' | 'kibanaUrl'
Copy link
Member Author

@dmlemeshko dmlemeshko Nov 23, 2023

Choose a reason for hiding this comment

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

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

Code LGTM

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #77 / Synthetics API Tests getSyntheticsMonitors get many monitors with page params

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @dmlemeshko

@dmlemeshko dmlemeshko merged commit 7556105 into elastic:main Nov 23, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants