-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution] Support roles in Serverless FTR tests #170131
Closed
maximpn
wants to merge
5
commits into
elastic:main
from
maximpn:support-roles-in-serverless-ftr-tests
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
249a951
allow usage of beforeAll in FTR configs
maximpn c4251b9
move privileges tests into the new folder
maximpn 72378ad
fix Serverless FTR role based tests in a temporal way
maximpn eb666a7
Merge branch 'main' into support-roles-in-serverless-ftr-tests
kibanamachine 6989d5e
Merge branch 'main' into support-roles-in-serverless-ftr-tests
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
x-pack/test/security_solution_api_integration/config/ess/setup_users.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { | ||
KNOWN_ESS_ROLE_DEFINITIONS, | ||
KNOWN_SERVERLESS_ROLE_DEFINITIONS, | ||
} from '@kbn/security-solution-plugin/common/test'; | ||
import { SecurityService } from '../../../../../test/common/services/security/security'; | ||
|
||
export async function setupUsers(securityService: SecurityService): Promise<void> { | ||
const KNOWN_ROLE_DEFINITIONS = [ | ||
...Object.values(KNOWN_SERVERLESS_ROLE_DEFINITIONS), | ||
...Object.values(KNOWN_ESS_ROLE_DEFINITIONS), | ||
]; | ||
|
||
for (const roleDefinition of KNOWN_ROLE_DEFINITIONS) { | ||
await securityService.role.create(roleDefinition.name, roleDefinition); | ||
|
||
await securityService.user.create(roleDefinition.name, { | ||
password: 'changeme', | ||
roles: [roleDefinition.name], | ||
full_name: roleDefinition.name, | ||
email: '[email protected]', | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...egration/test_suites/detections_response/default_license/privileges/configs/ess.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrConfigProviderContext } from '@kbn/test'; | ||
|
||
export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
const functionalConfig = await readConfigFile( | ||
require.resolve('../../../../../config/ess/config.base.trial') | ||
); | ||
|
||
return { | ||
...functionalConfig.getAll(), | ||
testFiles: [require.resolve('..')], | ||
junit: { | ||
reportName: 'Detection Engine ESS/ Privileges API Integration Tests', | ||
}, | ||
}; | ||
} |
15 changes: 15 additions & 0 deletions
15
...n/test_suites/detections_response/default_license/privileges/configs/serverless.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { createTestConfig } from '../../../../../config/serverless/config.base'; | ||
|
||
export default createTestConfig({ | ||
testFiles: [require.resolve('..')], | ||
junit: { | ||
reportName: 'Detection Engine Serverless/ Privileges API Integration Tests', | ||
}, | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we looked into any alternatives with the elasticsearch team? @afharo do you know who we can reach out to?
35 seconds per suite is going to add a not-insignificant amount of minutes to each build. I'm hoping we can find a quicker check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elastic/appex-qa is working close with Kibana security folks @azasypkin @jeramysoucy to enable roles testing. Our approach is to add a FTR service that will generate cookie for a specific user role, that will be used for browser authentication and kbnClient init. We expect it to work both with Kibana CI and MKI.
This PR is making quite many changes in FTR and doesn't match the concept we agreed on, I suggest @maximpn to join the sync meeting
FTR with Serverless Security Sync
this Thursday to discuss approach with all the folks involved.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmlemeshko, @maximpn is on PTO during this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I just asked in the general
#elasticssearch
Slack channel.@maximpn, did your test include these changes? I wonder if the need for the delay occurred before I managed to merge my PR.