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

use roles.yml from kbn/es for security solution tests #201228

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

dmlemeshko
Copy link
Member

@dmlemeshko dmlemeshko commented Nov 21, 2024

Summary

I recently discovered that some Cypress tests has its own realm default roles in x-pack/test_serverless/shared/lib/security/kibana_roles/project_controller_security_roles.yml and I think it might be easy to support a single roles file shared across multiple test configs/frameworks and track changes update from controller.

@dmlemeshko dmlemeshko added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 backport:version Backport to applied version labels v8.17.0 labels Nov 22, 2024
@dmlemeshko dmlemeshko marked this pull request as ready for review November 22, 2024 07:47
@dmlemeshko dmlemeshko requested a review from a team as a code owner November 22, 2024 07:47
Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

Hey @dmlemeshko ,
although our team initially created this module, we are no longer using it for Elastic Defend flows. Looking around at the files in the directory, looks like the following teams might be using it:

  • Security Solution Cloud Security Posture team
  • Security Solution cases team
  • Maybe OSQuery - @tomsonpl or @szwarckonrad maybe you can check?

@dmlemeshko dmlemeshko requested a review from tomsonpl December 3, 2024 17:25
@dmlemeshko
Copy link
Member Author

Hey @dmlemeshko , although our team initially created this module, we are no longer using it for Elastic Defend flows. Looking around at the files in the directory, looks like the following teams might be using it:

  • Security Solution Cloud Security Posture team
  • Security Solution cases team
  • Maybe OSQuery - @tomsonpl or @szwarckonrad maybe you can check?

Thank you, Paul.
No rush with PR, would be good to clarify first the consumers and if they don't mind keep the single source of truth.

Copy link
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.

Thank you for addressing this. I believe this change will not affect the current osquery Cypress tests, but to be safe, let’s run them before merging. Unless @tomsonpl sees any reason not to.

@tomsonpl
Copy link
Contributor

tomsonpl commented Dec 5, 2024

Good idea @szwarckonrad, let's wait for the test results and 🚢 🇮🇹 :)
Thanks @dmlemeshko for addressing this 🙇

Copy link
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.

Let's investigate failing osquery tests.

@dmlemeshko dmlemeshko requested a review from a team as a code owner December 6, 2024 14:52
Comment on lines +22 to +24
ADMIN = 'admin', // default Cloud role
SUPERUSER = 'system_indices_superuser', // this role is used to clean up the environment only and should
// not be used in any tests
Copy link
Member Author

@dmlemeshko dmlemeshko Dec 6, 2024

Choose a reason for hiding this comment

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

@tomsonpl @szwarckonrad This should fix the failures.

admin is Cloud default role, available both in serverless and ess deployments. It is a role that org owner got assigned and completely valid one to use in tests. But obviously the goal is to test features with minimal required role and admin is the last in the list.

system_indices_superuser is temporary solution while some Security solution teams didn't fix their tests, e.g. cloud security posture API tests depend on it. This role does not exist on MKI and tests using it might fail on MKI. We have a plan to remove it asap, but for now it has to stay to unblock testing in Kibana CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants