diff --git a/x-pack/test_serverless/api_integration/test_suites/common/reporting/management.ts b/x-pack/test_serverless/api_integration/test_suites/common/reporting/management.ts index 3d4c0a31cf126..8610bb6aa1c2f 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/reporting/management.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/reporting/management.ts @@ -13,14 +13,16 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; // the archived data holds a report created by test_user const TEST_USERNAME = 'test_user'; const TEST_USER_PASSWORD = 'changeme'; -const REPORTING_USER_USERNAME = 'elastic_serverless'; -const REPORTING_USER_PASSWORD = 'changeme'; const API_HEADER: [string, string] = ['kbn-xsrf', 'reporting']; const INTERNAL_HEADER: [string, string] = [X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'Kibana']; export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); const supertest = getService('supertestWithoutAuth'); + const config = getService('config'); + + const REPORTING_USER_USERNAME = config.get('servers.kibana.username'); + const REPORTING_USER_PASSWORD = config.get('servers.kibana.password'); describe('Reporting Management', function () { // security_exception: action [indices:admin/create] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.reporting-2020.04.19], this action is granted by the index privileges [create_index,manage,all] diff --git a/x-pack/test_serverless/functional/services/svl_reporting.ts b/x-pack/test_serverless/functional/services/svl_reporting.ts index 70c7b9c04827e..0187ae7172be3 100644 --- a/x-pack/test_serverless/functional/services/svl_reporting.ts +++ b/x-pack/test_serverless/functional/services/svl_reporting.ts @@ -18,8 +18,6 @@ const INTERNAL_HEADER: [string, string] = [X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'K // const REPORTING_ROLE = 'reporting_user_role'; // const REPORTING_USER_PASSWORD = 'reporting_user-password'; // const REPORTING_USER_USERNAME = 'reporting_user'; -const REPORTING_USER_USERNAME = 'elastic_serverless'; -const REPORTING_USER_PASSWORD = 'changeme'; /** * Services to create roles and users for security testing @@ -30,6 +28,9 @@ export function SvlReportingServiceProvider({ getService }: FtrProviderContext) const retry = getService('retry'); const config = getService('config'); + const REPORTING_USER_USERNAME = config.get('servers.kibana.username'); + const REPORTING_USER_PASSWORD = config.get('servers.kibana.password'); + return { /** * Define a role that DOES grant privileges to create certain types of reports. diff --git a/x-pack/test_serverless/shared/services/svl_reporting.ts b/x-pack/test_serverless/shared/services/svl_reporting.ts index cde7567ab9a7f..4fc6da28f082e 100644 --- a/x-pack/test_serverless/shared/services/svl_reporting.ts +++ b/x-pack/test_serverless/shared/services/svl_reporting.ts @@ -15,9 +15,6 @@ import { FtrProviderContext } from '../../functional/ftr_provider_context'; const API_HEADER: [string, string] = ['kbn-xsrf', 'reporting']; const INTERNAL_HEADER: [string, string] = [X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'Kibana']; -const REPORTING_USER_USERNAME = 'elastic_serverless'; -const REPORTING_USER_PASSWORD = 'changeme'; - /** * Services to create roles and users for security testing */ @@ -27,6 +24,9 @@ export function SvlReportingServiceProvider({ getService }: FtrProviderContext) const retry = getService('retry'); const config = getService('config'); + const REPORTING_USER_USERNAME = config.get('servers.kibana.username'); + const REPORTING_USER_PASSWORD = config.get('servers.kibana.password'); + return { /** * Use the internal API to create any kind of report job