diff --git a/docs/CHANGELOG.asciidoc b/docs/CHANGELOG.asciidoc index 1b45c8700d9a3..85c5bcfbf1127 100644 --- a/docs/CHANGELOG.asciidoc +++ b/docs/CHANGELOG.asciidoc @@ -93,37 +93,36 @@ The 8.16.0 release includes the following known issues. [discrete] [[known-199902]] -.Stack Monitoring shows "Unable to load page error" +.Stack Monitoring shows "Unable to load page" error [%collapsible] ==== *Details* + -The Stack Monitoring pages Overview, Nodes, Logs can stop working with the error "Unable to load page error". The Stack trace mentions `TypeError: Cannot read properties of undefined (reading 'logsLocator')`. +The Overview, Nodes, and Logs pages in Stack Monitoring show an "Unable to load page" error. The Stack trace mentions `TypeError: Cannot read properties of undefined (reading 'logsLocator')`. *Workaround* + -Disabling the `Set feature visibility > Logs` feature at Kibana Space settings level will prevent the error to occur. Please note the `Logs` feature will not be available on such space. +Disabling the `Set feature visibility > Logs` feature at the Kibana Space settings level will prevent the error from occurring. Please note the `Logs` feature will not be available on those spaces. -It's also possible to `Observability > Logs` feature privilege to `None` on the role level - this will hide the `Logs` feature for individual users and prevent the error for these users as well. +It's also possible to set the `Observability > Logs` feature privilege to `None` at the role level. This will hide the `Logs` feature from individual users and prevent the error for these users as well. For more information, refer to {kibana-issue}199902[#199902]. ==== [discrete] [[known-199891-199892]] -.Onboarding, tutorial of APM and OpenTelemetry and some "Beats Only" integrations will show the error "Unable to load page error" +.Onboarding, tutorial of APM and OpenTelemetry and some "Beats Only" integrations shows "Unable to load page" error [%collapsible] ==== *Details* + -Tutorials linked from the {kib} home page show an error "Unable to load page error". The Stack trace mentions `The above error occurred in tutorial_TutorialUi`. +Tutorials linked from the {kib} home page show an "Unable to load page" error. The Stack trace mentions `The above error occurred in tutorial_TutorialUi`. *Workaround* + -The APM / OpenTelemetry tutorials represented a shortcut to get important parameters to use in the configuration files quickly. -It is still possible to obtain the same parameters following the documentation tutorials of APM. +The APM / OpenTelemetry tutorials represented a shortcut to quickly add important parameters to the configuration files. +It is still possible to obtain the same parameters following the tutorials in the APM documentation. More information can be found in the {observability-guide}/apm-collect-application-data.html[APM documentation] and the {observability-guide}/get-started-with-fleet-apm-server.html[Fleet documentation]. For information about how to create APM API keys, please check the {observability-guide}/apm-api-key.html#apm-create-an-api-key[API key documentation]. - For more information, refer to {kibana-issue}199891[#199891] and {kibana-issue}199892[#199892]. ==== diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index a4c1e30c8cf05..d30ac3c4552e2 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -21335,7 +21335,7 @@ ] } }, - "/api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath*}": { + "/api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath}": { "get": { "operationId": "get-fleet-epm-packages-pkgname-pkgversion-filepath", "parameters": [ diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index a0bd0c4cc4340..4b56e3581c66f 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -21335,7 +21335,7 @@ ] } }, - "/api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath*}": { + "/api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath}": { "get": { "operationId": "get-fleet-epm-packages-pkgname-pkgversion-filepath", "parameters": [ diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 4f54e401b14c2..55dd5277d1d93 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -19323,7 +19323,7 @@ paths: tags: - Elastic Package Manager (EPM) x-beta: true - /api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath*}: + /api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath}: get: operationId: get-fleet-epm-packages-pkgname-pkgversion-filepath parameters: diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index cb7d39cae0cab..b2c3ae00be9d0 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -22127,7 +22127,7 @@ paths: summary: Update package settings tags: - Elastic Package Manager (EPM) - /api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath*}: + /api/fleet/epm/packages/{pkgName}/{pkgVersion}/{filePath}: get: operationId: get-fleet-epm-packages-pkgname-pkgversion-filepath parameters: diff --git a/oas_docs/package-lock.json b/oas_docs/package-lock.json index 6527a6ee6a5dd..70fff86254f65 100644 --- a/oas_docs/package-lock.json +++ b/oas_docs/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@redocly/cli": "^1.25.7", + "@redocly/cli": "^1.25.11", "bump-cli": "^2.8.4" } }, @@ -518,6 +518,7 @@ "version": "1.25.11", "resolved": "https://registry.npmjs.org/@redocly/cli/-/cli-1.25.11.tgz", "integrity": "sha512-dttBsmLnnbTlJCTa+s7Sy+qtXDq692n7Ru3nUUIHp9XdCbhXIHWhpc8uAl+GmR4MGbVe8ohATl3J+zX3aFy82A==", + "license": "MIT", "dependencies": { "@redocly/openapi-core": "1.25.11", "abort-controller": "^3.0.0", diff --git a/oas_docs/package.json b/oas_docs/package.json index d007a9881acad..3f6cae5c044b3 100644 --- a/oas_docs/package.json +++ b/oas_docs/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "bump-cli": "^2.8.4", - "@redocly/cli": "^1.25.7" + "@redocly/cli": "^1.25.11" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/package.json b/package.json index e107bf2619f12..c2d4a28c60fa6 100644 --- a/package.json +++ b/package.json @@ -1023,7 +1023,7 @@ "@langchain/langgraph": "0.2.19", "@langchain/openai": "^0.3.11", "@langtrase/trace-attributes": "^3.0.8", - "@launchdarkly/node-server-sdk": "^9.7.0", + "@launchdarkly/node-server-sdk": "^9.7.1", "@launchdarkly/openfeature-node-server": "^1.0.0", "@loaders.gl/core": "^3.4.7", "@loaders.gl/json": "^3.4.7", @@ -1634,7 +1634,7 @@ "@types/resolve": "^1.20.1", "@types/scheduler": "^0.23.0", "@types/seedrandom": ">=2.0.0 <4.0.0", - "@types/selenium-webdriver": "^4.1.26", + "@types/selenium-webdriver": "^4.1.27", "@types/semver": "^7.5.8", "@types/set-value": "^2.0.0", "@types/sinon": "^7.0.13", @@ -1681,7 +1681,7 @@ "buildkite-test-collector": "^1.7.0", "callsites": "^3.1.0", "chance": "1.0.18", - "chromedriver": "^130.0.1", + "chromedriver": "^130.0.4", "clarify": "^2.2.0", "clean-webpack-plugin": "^3.0.0", "cli-progress": "^3.12.0", @@ -1732,7 +1732,7 @@ "file-loader": "^4.2.0", "find-cypress-specs": "^1.41.4", "form-data": "^4.0.0", - "geckodriver": "^4.5.1", + "geckodriver": "^5.0.0", "gulp-brotli": "^3.0.0", "gulp-postcss": "^9.0.1", "gulp-terser": "^2.1.0", @@ -1807,7 +1807,7 @@ "rxjs-marbles": "^7.0.1", "sass-embedded": "^1.78.0", "sass-loader": "^10.5.1", - "selenium-webdriver": "^4.25.0", + "selenium-webdriver": "^4.26.0", "sharp": "0.32.6", "simple-git": "^3.16.0", "sinon": "^7.4.2", diff --git a/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap b/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap index 1c1f5bed02a0e..ccf5fad20a71a 100644 --- a/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap +++ b/packages/kbn-router-to-openapispec/src/__snapshots__/generate_oas.test.ts.snap @@ -228,7 +228,7 @@ OK response oas-test-version-2", "x-discontinued": "route discontinued version or date", }, }, - "/foo/{id}/{path*}": Object { + "/foo/{id}/{path}": Object { "delete": Object { "description": "route description", "operationId": "delete-foo-id-path", @@ -570,7 +570,7 @@ OK response oas-test-version-2", ], }, }, - "/no-xsrf/{id}/{path*}": Object { + "/no-xsrf/{id}/{path}": Object { "post": Object { "deprecated": true, "operationId": "post-no-xsrf-id-path-2", diff --git a/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts b/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts index f4ba66f992134..dedba5036d7ef 100644 --- a/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts +++ b/packages/kbn-router-to-openapispec/src/generate_oas.test.fixture.ts @@ -151,7 +151,7 @@ export const sharedOas = { tags: ['versioned'], }, }, - '/foo/{id}/{path*}': { + '/foo/{id}/{path}': { get: { description: 'route description', operationId: 'get-foo-id-path', diff --git a/packages/kbn-router-to-openapispec/src/generate_oas.test.ts b/packages/kbn-router-to-openapispec/src/generate_oas.test.ts index 25b786ac7c2c7..76a4f560006b3 100644 --- a/packages/kbn-router-to-openapispec/src/generate_oas.test.ts +++ b/packages/kbn-router-to-openapispec/src/generate_oas.test.ts @@ -314,9 +314,9 @@ describe('generateOpenApiDocument', () => { } ); // router paths - expect(result.paths['/1-1/{id}/{path*}']!.get!.tags).toEqual(['1', '2']); - expect(result.paths['/1-2/{id}/{path*}']!.get!.tags).toEqual(['1']); - expect(result.paths['/2-1/{id}/{path*}']!.get!.tags).toEqual([]); + expect(result.paths['/1-1/{id}/{path}']!.get!.tags).toEqual(['1', '2']); + expect(result.paths['/1-2/{id}/{path}']!.get!.tags).toEqual(['1']); + expect(result.paths['/2-1/{id}/{path}']!.get!.tags).toEqual([]); // versioned router paths expect(result.paths['/v1-1']!.get!.tags).toEqual(['v1']); expect(result.paths['/v1-2']!.get!.tags).toEqual(['v2', 'v3']); @@ -392,17 +392,17 @@ describe('generateOpenApiDocument', () => { ); // router paths - expect(result.paths['/1-1/{id}/{path*}']!.get).toMatchObject({ + expect(result.paths['/1-1/{id}/{path}']!.get).toMatchObject({ 'x-state': 'Technical Preview', }); - expect(result.paths['/1-2/{id}/{path*}']!.get).toMatchObject({ + expect(result.paths['/1-2/{id}/{path}']!.get).toMatchObject({ 'x-state': 'Beta', }); - expect(result.paths['/1-3/{id}/{path*}']!.get).not.toMatchObject({ + expect(result.paths['/1-3/{id}/{path}']!.get).not.toMatchObject({ 'x-state': expect.any(String), }); - expect(result.paths['/2-1/{id}/{path*}']!.get).not.toMatchObject({ + expect(result.paths['/2-1/{id}/{path}']!.get).not.toMatchObject({ 'x-state': expect.any(String), }); diff --git a/packages/kbn-router-to-openapispec/src/util.test.ts b/packages/kbn-router-to-openapispec/src/util.test.ts index f9692e57e1f50..e3011aa1a5a73 100644 --- a/packages/kbn-router-to-openapispec/src/util.test.ts +++ b/packages/kbn-router-to-openapispec/src/util.test.ts @@ -17,8 +17,9 @@ import { getPathParameters, createOpIdGenerator, GetOpId, + assignToPaths, + extractTags, } from './util'; -import { assignToPaths, extractTags } from './util'; describe('extractTags', () => { test.each([ @@ -115,9 +116,11 @@ describe('assignToPaths', () => { const paths = {}; assignToPaths(paths, '/foo', {}); assignToPaths(paths, '/bar/{id?}', {}); + assignToPaths(paths, '/bar/file/{path*}', {}); expect(paths).toEqual({ '/foo': {}, '/bar/{id}': {}, + '/bar/file/{path}': {}, }); }); }); @@ -320,7 +323,7 @@ describe('createOpIdGenerator', () => { { input: { method: 'get', - path: '/api/my/resource/{path*}', + path: '/api/my/resource/{path}', }, output: 'get-my-resource-path', }, diff --git a/packages/kbn-router-to-openapispec/src/util.ts b/packages/kbn-router-to-openapispec/src/util.ts index a5718fa92120f..1088259e73d05 100644 --- a/packages/kbn-router-to-openapispec/src/util.ts +++ b/packages/kbn-router-to-openapispec/src/util.ts @@ -132,7 +132,7 @@ export const assignToPaths = ( path: string, pathObject: OpenAPIV3.PathItemObject ): void => { - const pathName = path.replace('?', ''); + const pathName = path.replace(/[\?\*]/, ''); paths[pathName] = { ...paths[pathName], ...pathObject }; }; diff --git a/x-pack/plugins/aiops/public/embeddables/change_point_chart/embeddable_chart_component_wrapper.tsx b/x-pack/plugins/aiops/public/embeddables/change_point_chart/embeddable_chart_component_wrapper.tsx index 15159d7adb60c..c96f8376a2ad9 100644 --- a/x-pack/plugins/aiops/public/embeddables/change_point_chart/embeddable_chart_component_wrapper.tsx +++ b/x-pack/plugins/aiops/public/embeddables/change_point_chart/embeddable_chart_component_wrapper.tsx @@ -72,8 +72,8 @@ export const ChartGridEmbeddableWrapper: FC = ({ mergedQuery.bool.filter.push({ range: { [dataView.timeFieldName!]: { - from: searchBounds.min?.valueOf(), - to: searchBounds.max?.valueOf(), + gte: searchBounds.min?.valueOf(), + lte: searchBounds.max?.valueOf(), format: 'epoch_millis', }, }, diff --git a/x-pack/plugins/embeddable_enhanced/public/plugin.ts b/x-pack/plugins/embeddable_enhanced/public/plugin.ts index f05982af78947..a76f33f095951 100644 --- a/x-pack/plugins/embeddable_enhanced/public/plugin.ts +++ b/x-pack/plugins/embeddable_enhanced/public/plugin.ts @@ -148,8 +148,8 @@ export class EmbeddableEnhancedPlugin ); const api: DynamicActionStorageApi = { dynamicActionsState$, - setDynamicActions: (newState) => { - dynamicActionsState$.next(newState); + setDynamicActions: (enhancements) => { + dynamicActionsState$.next(getDynamicActionsState(enhancements)); }, }; const storage = new DynamicActionStorage(uuid, getTitle, api); diff --git a/x-pack/plugins/inference/server/routes/chat_complete.ts b/x-pack/plugins/inference/server/routes/chat_complete.ts index 582d4ceb97d45..e4e078e58c15a 100644 --- a/x-pack/plugins/inference/server/routes/chat_complete.ts +++ b/x-pack/plugins/inference/server/routes/chat_complete.ts @@ -119,6 +119,12 @@ export function registerChatCompleteRoute({ router.post( { path: '/internal/inference/chat_complete', + security: { + authz: { + enabled: false, + reason: 'This route is opted out from authorization', + }, + }, validate: { body: chatCompleteBodySchema, }, diff --git a/x-pack/plugins/inference/server/routes/connectors.ts b/x-pack/plugins/inference/server/routes/connectors.ts index a03a393f133b1..240e11a37f20e 100644 --- a/x-pack/plugins/inference/server/routes/connectors.ts +++ b/x-pack/plugins/inference/server/routes/connectors.ts @@ -23,6 +23,12 @@ export function registerConnectorsRoute({ router.get( { path: '/internal/inference/connectors', + security: { + authz: { + enabled: false, + reason: 'This route is opted out from authorization', + }, + }, validate: {}, }, async (_context, request, response) => { diff --git a/x-pack/plugins/kubernetes_security/server/routes/aggregate.ts b/x-pack/plugins/kubernetes_security/server/routes/aggregate.ts index f83ddc818cbb4..4ddb828b68976 100644 --- a/x-pack/plugins/kubernetes_security/server/routes/aggregate.ts +++ b/x-pack/plugins/kubernetes_security/server/routes/aggregate.ts @@ -38,6 +38,11 @@ export const registerAggregateRoute = (router: IRouter, logger: Logger) => { .addVersion( { version: '1', + security: { + authz: { + requiredPrivileges: ['securitySolution'], + }, + }, validate: { request: { query: schema.object({ diff --git a/x-pack/plugins/kubernetes_security/server/routes/count.ts b/x-pack/plugins/kubernetes_security/server/routes/count.ts index 0922adeb0cf45..b73452e8e45fc 100644 --- a/x-pack/plugins/kubernetes_security/server/routes/count.ts +++ b/x-pack/plugins/kubernetes_security/server/routes/count.ts @@ -28,6 +28,11 @@ export const registerCountRoute = (router: IRouter, logger: Logger) => { .addVersion( { version: '1', + security: { + authz: { + requiredPrivileges: ['securitySolution'], + }, + }, validate: { request: { query: schema.object({ diff --git a/x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts b/x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts index 83f5b70efe051..b4a0271b63edc 100644 --- a/x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts +++ b/x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts @@ -35,6 +35,11 @@ export const registerMultiTermsAggregateRoute = (router: IRouter, logger: Logger .addVersion( { version: '1', + security: { + authz: { + requiredPrivileges: ['securitySolution'], + }, + }, validate: { request: { query: schema.object({ diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/config.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/config.ts index 4df8891bd06fc..2f36d27889c14 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/config.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/config.ts @@ -9,7 +9,6 @@ import { schema, type TypeOf } from '@kbn/config-schema'; export const config = schema.object({ enabled: schema.boolean({ defaultValue: true }), - modelId: schema.maybe(schema.string()), // TODO: Remove scope: schema.maybe(schema.oneOf([schema.literal('observability'), schema.literal('search')])), enableKnowledgeBase: schema.boolean({ defaultValue: true }), }); diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/plugin.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/plugin.ts index 98a6232563054..b2b5736fd1d6f 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/plugin.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/plugin.ts @@ -116,11 +116,6 @@ export class ObservabilityAIAssistantPlugin // Using once to make sure the same model ID is used during service init and Knowledge base setup const getSearchConnectorModelId = once(async () => { - // TODO: Remove this once the modelId is removed from the config - const configModelId = this.config.modelId; - if (configModelId) { - return configModelId; - } const defaultModelId = '.elser_model_2'; const [_, pluginsStart] = await core.getStartServices(); // Wait for the license to be available so the ML plugin's guards pass once we ask for ELSER stats diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/inference_endpoint.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/inference_endpoint.ts index 1d09311dbd6ea..e89028652d9ac 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/inference_endpoint.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/inference_endpoint.ts @@ -10,7 +10,7 @@ import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Logger } from '@kbn/logging'; import moment from 'moment'; -export const AI_ASSISTANT_KB_INFERENCE_ID = 'ai_assistant_kb_inference'; +export const AI_ASSISTANT_KB_INFERENCE_ID = 'obs_ai_assistant_kb_inference'; export async function createInferenceEndpoint({ esClient, diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts index 833e0203e3817..f106dc46c0708 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts @@ -28,7 +28,6 @@ import { export interface MonitorConfigUpdate { normalizedMonitor: SyntheticsMonitor; monitorWithRevision: SyntheticsMonitorWithSecretsAttributes; - previousMonitor: SavedObject; decryptedPreviousMonitor: SavedObject; } @@ -40,14 +39,14 @@ const updateConfigSavedObjects = async ({ monitorsToUpdate: MonitorConfigUpdate[]; }) => { return await routeContext.savedObjectsClient.bulkUpdate( - monitorsToUpdate.map(({ previousMonitor, monitorWithRevision }) => ({ + monitorsToUpdate.map(({ monitorWithRevision, decryptedPreviousMonitor }) => ({ type: syntheticsMonitorType, - id: previousMonitor.id, + id: decryptedPreviousMonitor.id, attributes: { ...monitorWithRevision, - [ConfigKey.CONFIG_ID]: previousMonitor.id, + [ConfigKey.CONFIG_ID]: decryptedPreviousMonitor.id, [ConfigKey.MONITOR_QUERY_ID]: - monitorWithRevision[ConfigKey.CUSTOM_HEARTBEAT_ID] || previousMonitor.id, + monitorWithRevision[ConfigKey.CUSTOM_HEARTBEAT_ID] || decryptedPreviousMonitor.id, }, })) ); @@ -67,15 +66,14 @@ async function syncUpdatedMonitors({ const { syntheticsMonitorClient } = routeContext; return await syntheticsMonitorClient.editMonitors( - monitorsToUpdate.map(({ normalizedMonitor, previousMonitor, decryptedPreviousMonitor }) => ({ + monitorsToUpdate.map(({ normalizedMonitor, decryptedPreviousMonitor }) => ({ monitor: { ...(normalizedMonitor as MonitorFields), - [ConfigKey.CONFIG_ID]: previousMonitor.id, + [ConfigKey.CONFIG_ID]: decryptedPreviousMonitor.id, [ConfigKey.MONITOR_QUERY_ID]: - normalizedMonitor[ConfigKey.CUSTOM_HEARTBEAT_ID] || previousMonitor.id, + normalizedMonitor[ConfigKey.CUSTOM_HEARTBEAT_ID] || decryptedPreviousMonitor.id, }, - id: previousMonitor.id, - previousMonitor, + id: decryptedPreviousMonitor.id, decryptedPreviousMonitor, })), privateLocations, @@ -104,9 +102,9 @@ export const syncEditedMonitorBulk = async ({ const { failedPolicyUpdates, publicSyncErrors } = editSyncResponse; - monitorsToUpdate.forEach(({ normalizedMonitor, previousMonitor }) => { + monitorsToUpdate.forEach(({ normalizedMonitor, decryptedPreviousMonitor }) => { const editedMonitorSavedObject = editedMonitorSavedObjects?.saved_objects.find( - (obj) => obj.id === previousMonitor.id + (obj) => obj.id === decryptedPreviousMonitor.id ); sendTelemetryEvents( @@ -114,7 +112,7 @@ export const syncEditedMonitorBulk = async ({ server.telemetry, formatTelemetryUpdateEvent( editedMonitorSavedObject as SavedObjectsUpdateResponse, - previousMonitor, + decryptedPreviousMonitor.updated_at, server.stackVersion, Boolean((normalizedMonitor as MonitorFields)[ConfigKey.SOURCE_INLINE]), publicSyncErrors @@ -150,9 +148,9 @@ export const rollbackCompletely = async ({ const { savedObjectsClient, server } = routeContext; try { await savedObjectsClient.bulkUpdate( - monitorsToUpdate.map(({ previousMonitor, decryptedPreviousMonitor }) => ({ + monitorsToUpdate.map(({ decryptedPreviousMonitor }) => ({ type: syntheticsMonitorType, - id: previousMonitor.id, + id: decryptedPreviousMonitor.id, attributes: decryptedPreviousMonitor.attributes, })) ); @@ -167,7 +165,6 @@ export const rollbackFailedUpdates = async ({ monitorsToUpdate, }: { monitorsToUpdate: Array<{ - previousMonitor: SavedObject; decryptedPreviousMonitor: SavedObject; }>; routeContext: RouteContext; @@ -194,12 +191,12 @@ export const rollbackFailedUpdates = async ({ }); const monitorsToRevert = monitorsToUpdate - .filter(({ previousMonitor }) => { - return failedConfigs[previousMonitor.id]; + .filter(({ decryptedPreviousMonitor }) => { + return failedConfigs[decryptedPreviousMonitor.id]; }) - .map(({ previousMonitor, decryptedPreviousMonitor }) => ({ + .map(({ decryptedPreviousMonitor }) => ({ type: syntheticsMonitorType, - id: previousMonitor.id, + id: decryptedPreviousMonitor.id, attributes: decryptedPreviousMonitor.attributes, })); diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/edit_monitor.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/edit_monitor.ts index d9261847db1ab..d460b71037950 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/edit_monitor.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/edit_monitor.ts @@ -272,7 +272,7 @@ export const syncEditedMonitor = async ({ server.telemetry, formatTelemetryUpdateEvent( editedMonitorSavedObject as SavedObjectsUpdateResponse, - decryptedPreviousMonitor, + decryptedPreviousMonitor.updated_at, server.stackVersion, Boolean((normalizedMonitor as MonitorFields)[ConfigKey.SOURCE_INLINE]), publicSyncErrors diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor_project.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor_project.ts index b0b4eee392d56..ac55807f9412f 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor_project.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor_project.ts @@ -32,7 +32,7 @@ export const getSyntheticsProjectMonitorsRoute: SyntheticsRestApiRouteFactory = } = routeContext; const { projectName } = request.params; - const { per_page: perPage = 500, search_after: searchAfter } = request.query; + const { per_page: perPage = 1000, search_after: searchAfter } = request.query; const decodedProjectName = decodeURI(projectName); const decodedSearchAfter = searchAfter ? decodeURI(searchAfter) : undefined; diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts index 299ab62f09028..761472bb7fa8c 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts @@ -152,7 +152,7 @@ describe('monitor upgrade telemetry helpers', () => { it('handles formatting update events', () => { const actual = formatTelemetryUpdateEvent( createTestConfig({}, '2011-10-05T16:48:00.000Z'), - testConfig, + testConfig.updated_at, stackVersion, false, errors diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts index f008d00a18536..f000108620f45 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts @@ -109,23 +109,22 @@ export function formatTelemetryEvent({ export function formatTelemetryUpdateEvent( currentMonitor: SavedObjectsUpdateResponse, - previousMonitor: SavedObject, + previousMonitorUpdatedAt: string | undefined, stackVersion: string, isInlineScript: boolean, errors?: ServiceLocationErrors | null ) { let durationSinceLastUpdated: number = 0; - if (currentMonitor.updated_at && previousMonitor.updated_at) { + if (currentMonitor.updated_at && previousMonitorUpdatedAt) { durationSinceLastUpdated = - new Date(currentMonitor.updated_at).getTime() - - new Date(previousMonitor.updated_at).getTime(); + new Date(currentMonitor.updated_at).getTime() - new Date(previousMonitorUpdatedAt).getTime(); } return formatTelemetryEvent({ stackVersion, monitor: currentMonitor as SavedObject, durationSinceLastUpdated, - lastUpdatedAt: previousMonitor.updated_at, + lastUpdatedAt: previousMonitorUpdatedAt, isInlineScript, errors, }); diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts index 6069076e375a2..1fe5d30048418 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts @@ -45,6 +45,17 @@ import { normalizeProjectMonitor } from './normalizers'; type FailedError = Array<{ id?: string; reason: string; details: string; payload?: object }>; +export interface ExistingMonitor { + [ConfigKey.JOURNEY_ID]: string; + [ConfigKey.CONFIG_ID]: string; + [ConfigKey.REVISION]: number; + [ConfigKey.MONITOR_TYPE]: string; +} + +export interface PreviousMonitorForUpdate extends ExistingMonitor { + updated_at?: string; +} + export const CANNOT_UPDATE_MONITOR_TO_DIFFERENT_TYPE = i18n.translate( 'xpack.synthetics.service.projectMonitors.cannotUpdateMonitorToDifferentType', { @@ -128,14 +139,13 @@ export class ProjectMonitorFormatter { const normalizedNewMonitors: SyntheticsMonitor[] = []; const normalizedUpdateMonitors: Array<{ - previousMonitor: SavedObjectsFindResult; + previousMonitor: PreviousMonitorForUpdate; monitor: SyntheticsMonitor; }> = []; for (const monitor of this.monitors) { const previousMonitor = existingMonitors.find( - (monitorObj) => - (monitorObj.attributes as SyntheticsMonitor)[ConfigKey.JOURNEY_ID] === monitor.id + (monitorObj) => monitorObj[ConfigKey.JOURNEY_ID] === monitor.id ); const normM = await this.validateProjectMonitor({ @@ -146,7 +156,7 @@ export class ProjectMonitorFormatter { if (normM) { if ( previousMonitor && - previousMonitor.attributes[ConfigKey.MONITOR_TYPE] !== normM[ConfigKey.MONITOR_TYPE] + previousMonitor[ConfigKey.MONITOR_TYPE] !== normM[ConfigKey.MONITOR_TYPE] ) { this.failedMonitors.push({ reason: CANNOT_UPDATE_MONITOR_TO_DIFFERENT_TYPE, @@ -157,7 +167,7 @@ export class ProjectMonitorFormatter { 'Monitor {monitorId} of type {previousType} cannot be updated to type {currentType}. Please delete the monitor first and try again.', values: { currentType: monitor.type, - previousType: previousMonitor.attributes[ConfigKey.MONITOR_TYPE], + previousType: previousMonitor[ConfigKey.MONITOR_TYPE], monitorId: monitor.id, }, } @@ -246,19 +256,33 @@ export class ProjectMonitorFormatter { } }; - public getProjectMonitorsForProject = async () => { - const finder = this.savedObjectsClient.createPointInTimeFinder({ + public getProjectMonitorsForProject = async (): Promise => { + const journeyIds = this.monitors.map((monitor) => monitor.id); + const journeyFilter = getSavedObjectKqlFilter({ + field: ConfigKey.JOURNEY_ID, + values: journeyIds, + }); + const finder = this.savedObjectsClient.createPointInTimeFinder({ type: syntheticsMonitorType, perPage: 5000, - filter: this.projectFilter, + filter: `${this.projectFilter} AND ${journeyFilter}`, + fields: [ + ConfigKey.JOURNEY_ID, + ConfigKey.CONFIG_ID, + ConfigKey.REVISION, + ConfigKey.MONITOR_TYPE, + ], }); - const hits: Array> = []; + const hits: PreviousMonitorForUpdate[] = []; for await (const result of finder.find()) { hits.push( - ...(result.saved_objects as Array< - SavedObjectsFindResult - >) + ...result.saved_objects.map((monitor) => { + return { + ...monitor.attributes, + updated_at: monitor.updated_at, + }; + }) ); } @@ -333,10 +357,8 @@ export class ProjectMonitorFormatter { } }; - private getDecryptedMonitors = async ( - monitors: Array> - ) => { - const configIds = monitors.map((monitor) => monitor.attributes[ConfigKey.CONFIG_ID]); + private getDecryptedMonitors = async (monitors: PreviousMonitorForUpdate[]) => { + const configIds = monitors.map((monitor) => monitor[ConfigKey.CONFIG_ID]); const monitorFilter = getSavedObjectKqlFilter({ field: ConfigKey.CONFIG_ID, values: configIds, @@ -344,7 +366,7 @@ export class ProjectMonitorFormatter { const finder = await this.encryptedSavedObjectsClient.createPointInTimeFinderDecryptedAsInternalUser( { - search: monitorFilter, + filter: monitorFilter, type: syntheticsMonitorType, perPage: 500, namespaces: [this.spaceId], @@ -365,7 +387,7 @@ export class ProjectMonitorFormatter { private updateMonitorsBulk = async ( monitors: Array<{ monitor: SyntheticsMonitor; - previousMonitor: SavedObjectsFindResult; + previousMonitor: PreviousMonitorForUpdate; }> ): Promise< | { @@ -390,10 +412,11 @@ export class ProjectMonitorFormatter { const monitorsToUpdate: MonitorConfigUpdate[] = []; decryptedPreviousMonitors.forEach((decryptedPreviousMonitor) => { - const monitor = monitors.find((m) => m.previousMonitor.id === decryptedPreviousMonitor.id); + const monitor = monitors.find( + (m) => m.previousMonitor[ConfigKey.CONFIG_ID] === decryptedPreviousMonitor.id + ); if (monitor) { const normalizedMonitor = monitor?.monitor; - const previousMonitor = monitor?.previousMonitor; const { attributes: { [ConfigKey.REVISION]: _, ...normalizedPrevMonitorAttr }, } = normalizeSecrets(decryptedPreviousMonitor); @@ -401,11 +424,10 @@ export class ProjectMonitorFormatter { const monitorWithRevision = formatSecrets({ ...normalizedPrevMonitorAttr, ...normalizedMonitor, - revision: (previousMonitor.attributes[ConfigKey.REVISION] || 0) + 1, + revision: (decryptedPreviousMonitor.attributes[ConfigKey.REVISION] || 0) + 1, }); monitorsToUpdate.push({ normalizedMonitor, - previousMonitor, monitorWithRevision, decryptedPreviousMonitor, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.test.ts index 49592aff28f95..abf90c3f4dfc4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.test.ts @@ -453,4 +453,36 @@ describe('applyRulePatch', () => { }) ).rejects.toThrowError('new_terms_fields: Expected array, received string'); }); + + test('should retain existing required_fields when not present in rule patch body', async () => { + const rulePatch = { + name: 'new name', + } as PatchRuleRequestBody; + const existingRule = { + ...getRulesSchemaMock(), + required_fields: [ + { + name: 'event.action', + type: 'keyword', + ecs: true, + }, + ], + }; + const patchedRule = await applyRulePatch({ + rulePatch, + existingRule, + prebuiltRuleAssetClient, + }); + expect(patchedRule).toEqual( + expect.objectContaining({ + required_fields: [ + { + name: 'event.action', + type: 'keyword', + ecs: true, + }, + ], + }) + ); + }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.ts index becc68f3d0075..9f5b167322491 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.ts @@ -92,7 +92,9 @@ export const applyRulePatch = async ({ meta: rulePatch.meta ?? existingRule.meta, max_signals: rulePatch.max_signals ?? existingRule.max_signals, related_integrations: rulePatch.related_integrations ?? existingRule.related_integrations, - required_fields: addEcsToRequiredFields(rulePatch.required_fields), + required_fields: rulePatch.required_fields + ? addEcsToRequiredFields(rulePatch.required_fields) + : existingRule.required_fields, risk_score: rulePatch.risk_score ?? existingRule.risk_score, risk_score_mapping: rulePatch.risk_score_mapping ?? existingRule.risk_score_mapping, rule_name_override: rulePatch.rule_name_override ?? existingRule.rule_name_override, diff --git a/x-pack/plugins/session_view/server/routes/alert_status_route.ts b/x-pack/plugins/session_view/server/routes/alert_status_route.ts index e0b95f9705e9d..64192198b5e46 100644 --- a/x-pack/plugins/session_view/server/routes/alert_status_route.ts +++ b/x-pack/plugins/session_view/server/routes/alert_status_route.ts @@ -31,6 +31,11 @@ export const registerAlertStatusRoute = ( .addVersion( { version: '1', + security: { + authz: { + requiredPrivileges: ['securitySolution'], + }, + }, validate: { request: { query: schema.object({ diff --git a/x-pack/plugins/session_view/server/routes/alerts_route.ts b/x-pack/plugins/session_view/server/routes/alerts_route.ts index c6b7fd8db7896..c875236989efe 100644 --- a/x-pack/plugins/session_view/server/routes/alerts_route.ts +++ b/x-pack/plugins/session_view/server/routes/alerts_route.ts @@ -36,6 +36,11 @@ export const registerAlertsRoute = ( .addVersion( { version: '1', + security: { + authz: { + requiredPrivileges: ['securitySolution'], + }, + }, validate: { request: { query: schema.object({ diff --git a/x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts b/x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts index 50f36ac47f5a4..7d54654c89cdc 100644 --- a/x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts +++ b/x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts @@ -22,6 +22,12 @@ export const registerGetTotalIOBytesRoute = (router: IRouter, logger: Logger) => .addVersion( { version: '1', + security: { + authz: { + enabled: false, + reason: `This route delegates authorization to Elasticsearch and it's not tied to a Kibana privilege.`, + }, + }, validate: { request: { query: schema.object({ diff --git a/x-pack/plugins/session_view/server/routes/io_events_route.ts b/x-pack/plugins/session_view/server/routes/io_events_route.ts index 9810f9da5aa77..3e73517a978c3 100644 --- a/x-pack/plugins/session_view/server/routes/io_events_route.ts +++ b/x-pack/plugins/session_view/server/routes/io_events_route.ts @@ -29,6 +29,12 @@ export const registerIOEventsRoute = (router: IRouter, logger: Logger) => { .addVersion( { version: '1', + security: { + authz: { + enabled: false, + reason: `This route delegates authorization to Elasticsearch and it's not tied to a Kibana privilege.`, + }, + }, validate: { request: { query: schema.object({ diff --git a/x-pack/plugins/session_view/server/routes/process_events_route.ts b/x-pack/plugins/session_view/server/routes/process_events_route.ts index bc6b24fc36bc5..b30b3b6ddcc51 100644 --- a/x-pack/plugins/session_view/server/routes/process_events_route.ts +++ b/x-pack/plugins/session_view/server/routes/process_events_route.ts @@ -43,6 +43,12 @@ export const registerProcessEventsRoute = ( .addVersion( { version: '1', + security: { + authz: { + enabled: false, + reason: `This route delegates authorization to Elasticsearch and it's not tied to a Kibana privilege.`, + }, + }, validate: { request: { query: schema.object({ diff --git a/x-pack/test/api_integration/apis/synthetics/get_monitor_project.ts b/x-pack/test/api_integration/apis/synthetics/get_monitor_project.ts index 53089d2bec2d3..dd3fcbef3088d 100644 --- a/x-pack/test/api_integration/apis/synthetics/get_monitor_project.ts +++ b/x-pack/test/api_integration/apis/synthetics/get_monitor_project.ts @@ -95,6 +95,9 @@ export default function ({ getService }: FtrProviderContext) { const firstPageResponse = await supertest .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .query({ + per_page: 500, + }) .set('kbn-xsrf', 'true') .send() .expect(200); @@ -185,6 +188,9 @@ export default function ({ getService }: FtrProviderContext) { const firstPageResponse = await supertest .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .query({ + per_page: 500, + }) .set('kbn-xsrf', 'true') .send() .expect(200); @@ -279,6 +285,9 @@ export default function ({ getService }: FtrProviderContext) { const firstPageResponse = await supertest .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .query({ + per_page: 500, + }) .set('kbn-xsrf', 'true') .send() .expect(200); @@ -372,6 +381,9 @@ export default function ({ getService }: FtrProviderContext) { .expect(200); const firstPageResponse = await supertest .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .query({ + per_page: 500, + }) .set('kbn-xsrf', 'true') .send() .expect(200); @@ -481,6 +493,9 @@ export default function ({ getService }: FtrProviderContext) { encodeURI(projectName) ) ) + .query({ + per_page: 500, + }) .set('kbn-xsrf', 'true') .send() .expect(200); diff --git a/x-pack/test/observability_ai_assistant_api_integration/configs/index.ts b/x-pack/test/observability_ai_assistant_api_integration/configs/index.ts index 4a39c31b0a3a7..75f7bb628b4be 100644 --- a/x-pack/test/observability_ai_assistant_api_integration/configs/index.ts +++ b/x-pack/test/observability_ai_assistant_api_integration/configs/index.ts @@ -8,7 +8,6 @@ import { mapValues } from 'lodash'; import path from 'path'; import { createTestConfig, CreateTestConfig } from '../common/config'; -import { SUPPORTED_TRAINED_MODELS } from '../../functional/services/ml/api'; export const observabilityAIAssistantDebugLogger = { name: 'plugins.observabilityAIAssistant', @@ -31,7 +30,6 @@ export const observabilityAIAssistantFtrConfigs = { __dirname, '../../../../test/analytics/plugins/analytics_ftr_helpers' ), - 'xpack.observabilityAIAssistant.modelId': SUPPORTED_TRAINED_MODELS.TINY_ELSER.name, // TODO: Remove }, }, }; diff --git a/x-pack/test/observability_ai_assistant_api_integration/tests/knowledge_base/knowledge_base_setup.spec.ts b/x-pack/test/observability_ai_assistant_api_integration/tests/knowledge_base/knowledge_base_setup.spec.ts index b8cacaaa58351..7903f4b53966a 100644 --- a/x-pack/test/observability_ai_assistant_api_integration/tests/knowledge_base/knowledge_base_setup.spec.ts +++ b/x-pack/test/observability_ai_assistant_api_integration/tests/knowledge_base/knowledge_base_setup.spec.ts @@ -34,7 +34,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { .expect(200); expect(res.body.service_settings.model_id).to.be('pt_tiny_elser'); - expect(res.body.inference_id).to.be('ai_assistant_kb_inference'); + expect(res.body.inference_id).to.be('obs_ai_assistant_kb_inference'); await deleteKnowledgeBaseModel(ml); await deleteInferenceEndpoint({ es }); diff --git a/x-pack/test/observability_ai_assistant_api_integration/tests/knowledge_base/knowledge_base_status.spec.ts b/x-pack/test/observability_ai_assistant_api_integration/tests/knowledge_base/knowledge_base_status.spec.ts index 76ad2d06e344a..8c10a6128d302 100644 --- a/x-pack/test/observability_ai_assistant_api_integration/tests/knowledge_base/knowledge_base_status.spec.ts +++ b/x-pack/test/observability_ai_assistant_api_integration/tests/knowledge_base/knowledge_base_status.spec.ts @@ -77,7 +77,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(res.body.ready).to.be(false); expect(res.body.enabled).to.be(true); expect(res.body.errorMessage).to.include.string( - 'Inference endpoint not found [ai_assistant_kb_inference]' + 'Inference endpoint not found [obs_ai_assistant_kb_inference]' ); }); }); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/basic_license_essentials_tier/patch_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/basic_license_essentials_tier/patch_rules.ts index be8e76f058b14..86dde0735424e 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/basic_license_essentials_tier/patch_rules.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_patch/basic_license_essentials_tier/patch_rules.ts @@ -285,6 +285,33 @@ export default ({ getService }: FtrProviderContext) => { ); }); }); + + it('should not change required_fields when not present in patch body', async () => { + await securitySolutionApi.createRule({ + body: getCustomQueryRuleParams({ + rule_id: 'rule-1', + required_fields: [ + { + name: 'event.action', + type: 'keyword', + }, + ], + }), + }); + + // patch a simple rule's name + const { body: patchedRule } = await securitySolutionApi + .patchRule({ body: { rule_id: 'rule-1', name: 'some other name' } }) + .expect(200); + + expect(patchedRule.required_fields).toEqual([ + { + name: 'event.action', + type: 'keyword', + ecs: true, + }, + ]); + }); }); }); }; diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/config.ts b/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/config.ts index 14078f228c7c8..01e470d2a7d88 100644 --- a/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/config.ts +++ b/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/config.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { SUPPORTED_TRAINED_MODELS } from '@kbn/test-suites-xpack/functional/services/ml/api'; import { createTestConfig } from '../../../config.base'; import { ObservabilityAIAssistantServices } from './common/ftr_provider_context'; import { services as inheritedServices } from '../../../services'; @@ -28,7 +27,4 @@ export default createTestConfig({ // include settings from project controller // https://github.com/elastic/project-controller/blob/main/internal/project/observability/config/elasticsearch.yml esServerArgs: ['xpack.ml.dfa.enabled=false'], - kbnServerArgs: [ - `--xpack.observabilityAIAssistant.modelId=${SUPPORTED_TRAINED_MODELS.TINY_ELSER.name}`, // TODO: Remove - ], }); diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/knowledge_base/knowledge_base_setup.spec.ts b/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/knowledge_base/knowledge_base_setup.spec.ts index a792b01b0e2cb..eeef06464c9d6 100644 --- a/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/knowledge_base/knowledge_base_setup.spec.ts +++ b/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/knowledge_base/knowledge_base_setup.spec.ts @@ -56,7 +56,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { .expect(200); expect(res.body.service_settings.model_id).to.be('pt_tiny_elser'); - expect(res.body.inference_id).to.be('ai_assistant_kb_inference'); + expect(res.body.inference_id).to.be('obs_ai_assistant_kb_inference'); await deleteKnowledgeBaseModel(ml); await deleteInferenceEndpoint({ es }); diff --git a/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts b/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts index 39228137cf7d7..ba370871c07ff 100644 --- a/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts +++ b/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts @@ -26,7 +26,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await esDeleteAllIndices(['search-*', 'test-*']); }; - describe('Elasticsearch Start [Onboarding Empty State]', function () { + // Failing: See https://github.com/elastic/kibana/issues/200020 + describe.skip('Elasticsearch Start [Onboarding Empty State]', function () { describe('developer', function () { before(async () => { await pageObjects.svlCommonPage.loginWithRole('developer'); diff --git a/yarn.lock b/yarn.lock index 7928ba1c7287a..b46f4a8fd75e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1394,10 +1394,10 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.16.2.tgz#05dd7f06659759fda30f87b15534f1e42f1201bb" integrity sha512-KgqAWMH0emL6f3xH6nqyTryoBMqlJ627LBIe9PT1PRRQPz2FtHib3FIHJPukp1slzF3hJYZvdiVwgPnHbaSOOA== -"@bazel/runfiles@^5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@bazel/runfiles/-/runfiles-5.8.1.tgz#737d5b3dc9739767054820265cfe432a80564c82" - integrity sha512-NDdfpdQ6rZlylgv++iMn5FkObC/QlBQvipinGLSOguTYpRywmieOyJ29XHvUilspwTFSILWpoE9CqMGkHXug1g== +"@bazel/runfiles@^6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@bazel/runfiles/-/runfiles-6.3.1.tgz#3f8824b2d82853377799d42354b4df78ab0ace0b" + integrity sha512-1uLNT5NZsUVIGS4syuHwTzZ8HycMPyr6POA3FCE4GbMtc4rhoJk8aZKtNIRthJYfL+iioppi+rTfH3olMPr9nA== "@bazel/typescript@4.6.2": version "4.6.2" @@ -7451,25 +7451,25 @@ dependencies: ncp "^2.0.0" -"@launchdarkly/js-sdk-common@2.11.0": - version "2.11.0" - resolved "https://registry.yarnpkg.com/@launchdarkly/js-sdk-common/-/js-sdk-common-2.11.0.tgz#efc0c94ee4b11d72910c5bcdf9294154a27dbb1c" - integrity sha512-96Jg4QH347w2+rL4Bpykqw28+HHUAW4HapjIkIfM3giELK7BwXUp3BiAVxo2ax78e7A7KqvMzPJUx5r2EGpkMw== +"@launchdarkly/js-sdk-common@2.12.0": + version "2.12.0" + resolved "https://registry.yarnpkg.com/@launchdarkly/js-sdk-common/-/js-sdk-common-2.12.0.tgz#c22eb9fead687260d916a75f693c7d399f085b05" + integrity sha512-HIDxvgo1vksC9hsYy3517sgW0Ql+iW3fgwlq/CEigeBNmaa9/J1Pxo7LrKPzezEA0kaGedmt/DCzVVxVBmxSsQ== -"@launchdarkly/js-server-sdk-common@2.9.0": - version "2.9.0" - resolved "https://registry.yarnpkg.com/@launchdarkly/js-server-sdk-common/-/js-server-sdk-common-2.9.0.tgz#337d13d4bec596f6244b9723f7ec718ee087bfa5" - integrity sha512-hf/qkn+NvCkyoLl6fl+4Q737p4Jg3T+RnRqdkJDMxO+8aAI+vpXuD9bbhkgYA9XFHyQ9puhufRGzX1BX26b7Rg== +"@launchdarkly/js-server-sdk-common@2.9.1": + version "2.9.1" + resolved "https://registry.yarnpkg.com/@launchdarkly/js-server-sdk-common/-/js-server-sdk-common-2.9.1.tgz#a683d682897c20a6967f5454d932663e4da6fc5c" + integrity sha512-BGIjcfel1hURvX4hM4iVruWecWMntRzh1UuPtV0uOYnXLuETp5lfpqBB6KzFoERnEZoCyX6Tmo+tPFVwteIUGA== dependencies: - "@launchdarkly/js-sdk-common" "2.11.0" + "@launchdarkly/js-sdk-common" "2.12.0" semver "7.5.4" -"@launchdarkly/node-server-sdk@^9.7.0": - version "9.7.0" - resolved "https://registry.yarnpkg.com/@launchdarkly/node-server-sdk/-/node-server-sdk-9.7.0.tgz#87223c2d3ab5fc7186065a0974960c94f73573ad" - integrity sha512-ABOsjcjH9pFdyG1m5++lhP+ngxfx4GMcIfgTp0iSPncuh0dMxCCWSx831gbhxR9M+f2x4EnsQ9HEdwnmwktb9g== +"@launchdarkly/node-server-sdk@^9.7.1": + version "9.7.1" + resolved "https://registry.yarnpkg.com/@launchdarkly/node-server-sdk/-/node-server-sdk-9.7.1.tgz#bb228e5f8c4c7ca52579f909e4150b9a749b04a9" + integrity sha512-razZ/ine5hfHiS7ZNfM1r/G7GNDQ+wHV0pRN2A0Yk5spZTmT/ecu67e+aXu/KAfEQyL0V4ofEkXJpeGl7TYJ5Q== dependencies: - "@launchdarkly/js-server-sdk-common" "2.9.0" + "@launchdarkly/js-server-sdk-common" "2.9.1" https-proxy-agent "^5.0.1" launchdarkly-eventsource "2.0.3" @@ -11338,10 +11338,10 @@ resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.28.tgz#9ce8fa048c1e8c85cb71d7fe4d704e000226036f" integrity sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA== -"@types/selenium-webdriver@^4.1.26": - version "4.1.26" - resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.1.26.tgz#09c696a341cf8cfc1641cded11d14813350b6ca9" - integrity sha512-PUgqsyNffal0eAU0bzGlh37MJo558aporAPZoKqBeB/pF7zhKl1S3zqza0GpwFqgoigNxWhEIJzru75eeYco/w== +"@types/selenium-webdriver@^4.1.27": + version "4.1.27" + resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.1.27.tgz#e08000d649df6f099b4099432bd2fece9f50ea7b" + integrity sha512-ALqsj8D7Swb6MnBQuAQ58J3KC3yh6fLGtAmpBmnZX8j+0kmP7NaLt56CuzBw2W2bXPrvHFTgn8iekOQFUKXEQA== dependencies: "@types/node" "*" "@types/ws" "*" @@ -11771,10 +11771,10 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@wdio/logger@^9.0.0": - version "9.0.4" - resolved "https://registry.yarnpkg.com/@wdio/logger/-/logger-9.0.4.tgz#63e901b9f0f29fa1ded5af54006fbd4df2354c33" - integrity sha512-b6gcu0PTVb3fgK4kyAH/k5UUWN5FOUdAfhA4PAY/IZvxZTMFYMqnrZb0WRWWWqL6nu9pcrOVtCOdPBvj0cb+Nw== +"@wdio/logger@^9.1.3": + version "9.1.3" + resolved "https://registry.yarnpkg.com/@wdio/logger/-/logger-9.1.3.tgz#b64b3d2ac642498f3c97580e2f0971f13c1e8fbb" + integrity sha512-cumRMK/gE1uedBUw3WmWXOQ7HtB6DR8EyKQioUz2P0IJtRRpglMBdZV7Svr3b++WWawOuzZHMfbTkJQmaVt8Gw== dependencies: chalk "^5.1.2" loglevel "^1.6.0" @@ -12154,10 +12154,10 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== -"@zip.js/zip.js@^2.7.48": - version "2.7.51" - resolved "https://registry.yarnpkg.com/@zip.js/zip.js/-/zip.js-2.7.51.tgz#a434e285048b951a5788d3d2d59aa68f209e7141" - integrity sha512-RKHaebzZZgQkUuzb49/qweN69e8Np9AUZ9QygydDIrbG1njypSAKwkeqIVeuf2JVGBDyB7Z9HKvzPgYrSlv9gw== +"@zip.js/zip.js@^2.7.53": + version "2.7.53" + resolved "https://registry.yarnpkg.com/@zip.js/zip.js/-/zip.js-2.7.53.tgz#bf88e90d8eed562182c01339643bc405446b0578" + integrity sha512-G6Bl5wN9EXXVaTUIox71vIX5Z454zEBe+akKpV4m1tUboIctT5h7ID3QXCJd/Lfy2rSvmkTmZIucf1jGRR4f5A== a-sync-waterfall@^1.0.0: version "1.0.1" @@ -14222,10 +14222,10 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -chromedriver@^130.0.1: - version "130.0.1" - resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-130.0.1.tgz#24fd5b2c9c9df4ebfc5d28c94eca8658915fbe15" - integrity sha512-JH+OxDZ7gVv02r9oXwj4mQ8JCtj62g0fCD1LMUUYdB/4mPxn/E2ys+1IzXItoE7vXM9fGVc9R1akvXLqwwuSww== +chromedriver@^130.0.4: + version "130.0.4" + resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-130.0.4.tgz#55225ddfec428e306116507651f5a24fdb299bd6" + integrity sha512-lpR+PWXszij1k4Ig3t338Zvll9HtCTiwoLM7n4pCCswALHxzmgwaaIFBh3rt9+5wRk9D07oFblrazrBxwaYYAQ== dependencies: "@testim/chrome-version" "^1.1.4" axios "^1.7.4" @@ -18607,19 +18607,19 @@ gcp-metadata@^6.1.0: gaxios "^6.0.0" json-bigint "^1.0.0" -geckodriver@^4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/geckodriver/-/geckodriver-4.5.1.tgz#624fc01815c1aa498dd3f717f7bd4c6cca0c57b8" - integrity sha512-lGCRqPMuzbRNDWJOQcUqhNqPvNsIFu6yzXF8J/6K3WCYFd2r5ckbeF7h1cxsnjA7YLSEiWzERCt6/gjZ3tW0ug== +geckodriver@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/geckodriver/-/geckodriver-5.0.0.tgz#88437f3812075988bb05b5e19dc4aaa42d200577" + integrity sha512-vn7TtQ3b9VMJtVXsyWtQQl1fyBVFhQy7UvJF96kPuuJ0or5THH496AD3eUyaDD11+EqCxH9t6V+EP9soZQk4YQ== dependencies: - "@wdio/logger" "^9.0.0" - "@zip.js/zip.js" "^2.7.48" + "@wdio/logger" "^9.1.3" + "@zip.js/zip.js" "^2.7.53" decamelize "^6.0.0" http-proxy-agent "^7.0.2" https-proxy-agent "^7.0.5" node-fetch "^3.3.2" tar-fs "^3.0.6" - which "^4.0.0" + which "^5.0.0" gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: version "1.0.0-beta.2" @@ -28133,12 +28133,12 @@ select-hose@^2.0.0: resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= -selenium-webdriver@^4.25.0: - version "4.25.0" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.25.0.tgz#3562b49668817974bb1d13d25a50e8bc0264fcf3" - integrity sha512-zl9IX93caOT8wbcCpZzAkEtYa+hNgJ4C5GUN8uhpzggqRLvsg1asfKi0p1uNZC8buYVvsBZbx8S+9MjVAjs4oA== +selenium-webdriver@^4.26.0: + version "4.26.0" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.26.0.tgz#23163cdad20388214a4ad17c1f38262a0857c902" + integrity sha512-nA7jMRIPV17mJmAiTDBWN96Sy0Uxrz5CCLb7bLVV6PpL417SyBMPc2Zo/uoREc2EOHlzHwHwAlFtgmSngSY4WQ== dependencies: - "@bazel/runfiles" "^5.8.1" + "@bazel/runfiles" "^6.3.1" jszip "^3.10.1" tmp "^0.2.3" ws "^8.18.0" @@ -32178,10 +32178,10 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -which@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/which/-/which-4.0.0.tgz#cd60b5e74503a3fbcfbf6cd6b4138a8bae644c1a" - integrity sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg== +which@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/which/-/which-5.0.0.tgz#d93f2d93f79834d4363c7d0c23e00d07c466c8d6" + integrity sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ== dependencies: isexe "^3.1.1"