diff --git a/x-pack/plugins/ingest_manager/common/types/models/output.ts b/x-pack/plugins/ingest_manager/common/types/models/output.ts index cedf5e81f3cb6..f4ded50d7d474 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/output.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/output.ts @@ -15,8 +15,8 @@ export interface NewOutput { hosts?: string[]; ca_sha256?: string; api_key?: string; - admin_username?: string; - admin_password?: string; + fleet_enroll_username?: string; + fleet_enroll_password?: string; config?: Record; } diff --git a/x-pack/plugins/ingest_manager/common/types/rest_spec/fleet_setup.ts b/x-pack/plugins/ingest_manager/common/types/rest_spec/fleet_setup.ts index 2eda4f187dafa..dc1d748a8743a 100644 --- a/x-pack/plugins/ingest_manager/common/types/rest_spec/fleet_setup.ts +++ b/x-pack/plugins/ingest_manager/common/types/rest_spec/fleet_setup.ts @@ -9,8 +9,8 @@ export interface GetFleetSetupRequest {} export interface CreateFleetSetupRequest { body: { - admin_username: string; - admin_password: string; + fleet_enroll_username: string; + fleet_enroll_password: string; }; } diff --git a/x-pack/plugins/ingest_manager/dev_docs/schema/saved_objects.mml b/x-pack/plugins/ingest_manager/dev_docs/schema/saved_objects.mml index bb6dbc1037201..373bd10ad6628 100644 --- a/x-pack/plugins/ingest_manager/dev_docs/schema/saved_objects.mml +++ b/x-pack/plugins/ingest_manager/dev_docs/schema/saved_objects.mml @@ -76,7 +76,7 @@ classDiagram ca_sha256 config // Encrypted - user to create API keys - admin_username - admin_password + fleet_enroll_username + fleet_enroll_password } diff --git a/x-pack/plugins/ingest_manager/server/saved_objects.ts b/x-pack/plugins/ingest_manager/server/saved_objects.ts index 31cf173c3e4f9..b1a9d14ed6e86 100644 --- a/x-pack/plugins/ingest_manager/server/saved_objects.ts +++ b/x-pack/plugins/ingest_manager/server/saved_objects.ts @@ -102,8 +102,8 @@ export const savedObjectMappings = { ca_sha256: { type: 'keyword' }, // FIXME_INGEST https://github.com/elastic/kibana/issues/56554 api_key: { type: 'keyword' }, - admin_username: { type: 'binary' }, - admin_password: { type: 'binary' }, + fleet_enroll_username: { type: 'binary' }, + fleet_enroll_password: { type: 'binary' }, config: { type: 'flattened' }, }, }, diff --git a/x-pack/plugins/ingest_manager/server/services/output.ts b/x-pack/plugins/ingest_manager/server/services/output.ts index 8503bbb56ee84..aebb8188db0cc 100644 --- a/x-pack/plugins/ingest_manager/server/services/output.ts +++ b/x-pack/plugins/ingest_manager/server/services/output.ts @@ -60,13 +60,13 @@ class OutputService { .getEncryptedSavedObjects() ?.getDecryptedAsInternalUser(OUTPUT_SAVED_OBJECT_TYPE, defaultOutputId); - if (!so || !so.attributes.admin_username || !so.attributes.admin_password) { + if (!so || !so.attributes.fleet_enroll_username || !so.attributes.fleet_enroll_password) { return null; } return { - username: so!.attributes.admin_username, - password: so!.attributes.admin_password, + username: so!.attributes.fleet_enroll_username, + password: so!.attributes.fleet_enroll_password, }; } diff --git a/x-pack/plugins/ingest_manager/server/services/setup.ts b/x-pack/plugins/ingest_manager/server/services/setup.ts index 340c63a06d34f..7311c46320f40 100644 --- a/x-pack/plugins/ingest_manager/server/services/setup.ts +++ b/x-pack/plugins/ingest_manager/server/services/setup.ts @@ -22,8 +22,8 @@ import { getPackageInfo } from './epm/packages'; import { datasourceService } from './datasource'; import { generateEnrollmentAPIKey } from './api_keys'; -const FLEET_ADMIN_USERNAME = 'fleet_enroll'; -const FLEET_ADMIN_ROLE = 'fleet_enroll'; +const FLEET_ENROLL_USERNAME = 'fleet_enroll'; +const FLEET_ENROLL_ROLE = 'fleet_enroll'; export async function setupIngestManager( soClient: SavedObjectsClientContract, @@ -73,7 +73,7 @@ export async function setupFleet( // This should be done directly in ES at some point await callCluster('transport.request', { method: 'PUT', - path: `/_security/role/${FLEET_ADMIN_ROLE}`, + path: `/_security/role/${FLEET_ENROLL_ROLE}`, body: { cluster: ['monitor', 'manage_api_key'], indices: [ @@ -88,17 +88,17 @@ export async function setupFleet( // Create fleet enroll user await callCluster('transport.request', { method: 'PUT', - path: `/_security/user/${FLEET_ADMIN_USERNAME}`, + path: `/_security/user/${FLEET_ENROLL_USERNAME}`, body: { password, - roles: [FLEET_ADMIN_ROLE], + roles: [FLEET_ENROLL_ROLE], }, }); // save fleet admin user await outputService.updateOutput(soClient, await outputService.getDefaultOutputId(soClient), { - admin_username: FLEET_ADMIN_USERNAME, - admin_password: password, + fleet_enroll_username: FLEET_ENROLL_USERNAME, + fleet_enroll_password: password, }); // Generate default enrollment key diff --git a/x-pack/plugins/ingest_manager/server/types/models/output.ts b/x-pack/plugins/ingest_manager/server/types/models/output.ts index 8c8f4c76af7fe..36b945db2cbce 100644 --- a/x-pack/plugins/ingest_manager/server/types/models/output.ts +++ b/x-pack/plugins/ingest_manager/server/types/models/output.ts @@ -15,8 +15,8 @@ const OutputBaseSchema = { type: schema.oneOf([schema.literal(OutputType.Elasticsearch)]), hosts: schema.maybe(schema.arrayOf(schema.string())), api_key: schema.maybe(schema.string()), - admin_username: schema.maybe(schema.string()), - admin_password: schema.maybe(schema.string()), + fleet_enroll_username: schema.maybe(schema.string()), + fleet_enroll_password: schema.maybe(schema.string()), config: schema.maybe(schema.recordOf(schema.string(), schema.any())), };