diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index 73f6344e191e34..709763dd6a03fc 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -1,12 +1,13 @@ [[advanced-options]] == Advanced Settings -*Advanced Settings* control the behavior of {kib}. For example, you can change the format used to display dates, -specify the default data view, and set the precision for displayed decimal values. +*Advanced Settings* control the behavior of {kib}. You can change the settings that apply to spaces, or to all of {kib}. For example, you can change the format used to display dates, +specify the default data view, and apply your own branding. -. Open the main menu, then click *Stack Management > Advanced Settings*. -. Scroll or search for the setting. -. Make your change, then click *Save changes*. +WARNING: Changing a setting can affect {kib} performance and cause problems +that are difficult to diagnose. Setting a property value to a blank field +reverts to the default behavior, which might not be compatible with other +configuration settings. Deleting a custom setting permanently removes it from {kib}. [float] === Required permissions @@ -25,12 +26,14 @@ For more information on granting access to {kib}, refer to < Advanced Settings*. +. Click *Space Settings*. +. Scroll or search for the setting. +. Make your change, then click *Save changes*. [float] [[kibana-general-settings]] @@ -554,3 +557,41 @@ only production-ready visualizations are available to users. [[telemetry-enabled-advanced-setting]]`telemetry:enabled`:: When enabled, helps improve the Elastic Stack by providing usage statistics for basic features. + +[float] +[[kibana-global-settings-reference]] +=== Change the global settings + +Change the settings that apply only to {kib} spaces. + +. Open the main menu, then click *Stack Management > Advanced Settings*. +. Click *Global Settings*. +. Scroll or search for the setting. +. Make your change, then click *Save changes*. + +[float] +[[kibana-custom-branding-settings]] +==== Custom branding + +[horizontal] +[[custom-logo]]`xpackCustomBranding:logo`:: +A custom image that appears in the header of all {kib} pages. Images must have a transparent background, and 128 x 128 pixels or smaller. + +[[organization-name]]`xpackCustomBranding:customizedLogo`:: +The custom text that appears in the header of all {kib} pages. Images must have a transparent background, and 200 x 84 pixels or smaller. + +[[page-title]]`xpackCustomBranding:pageTitle`:: +The custom text that appears on {kib} browser tabs. + +[[favicon-svg]]`xpackCustomBranding:faviconSVG`:: +The URL of a custom SVG image that appears on {kib} browser tabs. Images must be 16 x 16 pixels. + +[[favicon-png]]`xpackCustomBranding:faviconPNG`:: +The URL of a custom PNG image that appears on {kib} browser tabs. + +[float] +[[kibana-usage-data-settings]] +==== Usage Data + +[[provide-usage-data]]`telemetry:enabled`:: +When enabled, helps manage and improve Elastic products and services by providing usage statistics. \ No newline at end of file diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_flyout.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_flyout.tsx index 176381f8b92de7..ceb0348b4e8997 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_flyout.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_flyout.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { FC, useState, useEffect, useCallback, useRef } from 'react'; +import React, { FC, useState, useEffect, useCallback, useRef, useMemo } from 'react'; import type { SavedSearch } from '@kbn/discover-plugin/public'; import type { DataView, DataViewField } from '@kbn/data-views-plugin/public'; import { i18n } from '@kbn/i18n'; @@ -60,12 +60,15 @@ export const LogCategorizationFlyout: FC = ({ uiSettings, } = useAiopsAppContext(); const { euiTheme } = useEuiTheme(); + const { filters, query } = useMemo(() => getState(), [getState]); const mounted = useRef(false); const { runCategorizeRequest, cancelRequest, randomSampler } = useCategorizeRequest(); - const [aiopsListState, setAiopsListState] = usePageUrlState( + const [aiopsListState] = usePageUrlState( 'AIOPS_INDEX_VIEWER', - getDefaultAiOpsListState() + getDefaultAiOpsListState({ + searchQuery: createMergedEsQuery(query, filters, dataView, uiSettings), + }) ); const [selectedCategory, setSelectedCategory] = useState(null); const [selectedSavedSearch /* , setSelectedSavedSearch*/] = useState(savedSearch); @@ -109,16 +112,6 @@ export const LogCategorizationFlyout: FC = ({ true ); - useEffect(() => { - const { filters, query } = getState(); - - setAiopsListState({ - ...aiopsListState, - searchQuery: createMergedEsQuery(query, filters, dataView, uiSettings), - }); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - const loadCategories = useCallback(async () => { const { title: index, timeFieldName: timeField } = dataView; diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/custom_assets_extension.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/custom_assets_extension.tsx index ea79f8aab978dc..0536c69a947017 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/custom_assets_extension.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/custom_assets_extension.tsx @@ -8,6 +8,10 @@ import React from 'react'; import { type CustomAssetsAccordionProps, CustomAssetsAccordion } from '@kbn/fleet-plugin/public'; import { i18n } from '@kbn/i18n'; +import { useParams } from 'react-router-dom'; +import { EuiSpacer } from '@elastic/eui'; +import { CloudSecurityPolicyTemplate } from '../../../common/types'; +import { VULN_MGMT_POLICY_TEMPLATE } from '../../../common/constants'; import { useKibana } from '../../common/hooks/use_kibana'; import { benchmarksNavigation, cloudPosturePages } from '../../common/navigation/constants'; @@ -15,6 +19,21 @@ const SECURITY_APP_NAME = 'securitySolutionUI'; export const CspCustomAssetsExtension = () => { const { application } = useKibana().services; + const integration = useParams<{ integration: CloudSecurityPolicyTemplate | undefined }>() + .integration; + + const viewsCNVM: CustomAssetsAccordionProps['views'] = [ + { + name: cloudPosturePages.findings.name, + url: application.getUrlForApp(SECURITY_APP_NAME, { + path: cloudPosturePages.findings.path + '/vulnerabilities', + }), + description: i18n.translate( + 'xpack.csp.createPackagePolicy.customAssetsTab.vulnerabilityFindingsViewLabel', + { defaultMessage: 'View Vulnerability Findings ' } + ), + }, + ]; const views: CustomAssetsAccordionProps['views'] = [ { @@ -27,7 +46,9 @@ export const CspCustomAssetsExtension = () => { }, { name: cloudPosturePages.findings.name, - url: application.getUrlForApp(SECURITY_APP_NAME, { path: cloudPosturePages.findings.path }), + url: application.getUrlForApp(SECURITY_APP_NAME, { + path: cloudPosturePages.findings.path, + }), description: i18n.translate( 'xpack.csp.createPackagePolicy.customAssetsTab.findingsViewLabel', { defaultMessage: 'View CSP Findings ' } @@ -42,6 +63,34 @@ export const CspCustomAssetsExtension = () => { }, ]; + if (!integration) { + return ( + <> + + + + + ); + } + + if (integration === VULN_MGMT_POLICY_TEMPLATE) { + return ; + } + return ; }; // eslint-disable-next-line import/no-default-export diff --git a/x-pack/plugins/fleet/public/components/custom_assets_accordion.tsx b/x-pack/plugins/fleet/public/components/custom_assets_accordion.tsx index 7c8ac417e066d4..d3448f852bf76e 100644 --- a/x-pack/plugins/fleet/public/components/custom_assets_accordion.tsx +++ b/x-pack/plugins/fleet/public/components/custom_assets_accordion.tsx @@ -31,11 +31,13 @@ export interface CustomAssetsAccordionProps { description: string; }>; initialIsOpen?: boolean; + title?: string; } export const CustomAssetsAccordion: FunctionComponent = ({ views, initialIsOpen = false, + title, }) => { const { application } = useStartServices(); @@ -46,7 +48,7 @@ export const CustomAssetsAccordion: FunctionComponent -

{AssetTitleMap.view}

+

{title ?? AssetTitleMap.view}

diff --git a/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.test.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.test.ts index ff642003c1dc90..7e99ded206b2c2 100644 --- a/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.test.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.test.ts @@ -144,6 +144,28 @@ describe('ruleType Params validate()', () => { ); }); + it('uses default value "count" if aggType is undefined', async () => { + params.aggType = undefined; + expect(onValidate()).not.toThrow(); + }); + + it('fails for invalid groupBy', async () => { + params.groupBy = 42; + expect(onValidate()).toThrowErrorMatchingInlineSnapshot( + `"[groupBy]: expected value of type [string] but got [number]"` + ); + + params.groupBy = '-not-a-valid-groupBy-'; + expect(onValidate()).toThrowErrorMatchingInlineSnapshot( + `"[groupBy]: invalid groupBy: \\"-not-a-valid-groupBy-\\""` + ); + }); + + it('uses default value "all" if groupBy is undefined', async () => { + params.groupBy = undefined; + expect(onValidate()).not.toThrow(); + }); + it('fails for invalid aggField', async () => { params.aggField = 42; expect(onValidate()).toThrowErrorMatchingInlineSnapshot( diff --git a/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.ts index 6348437ba7198a..b9380eeafe3048 100644 --- a/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type_params.ts @@ -41,11 +41,11 @@ const EsQueryRuleParamsSchemaProperties = { threshold: schema.arrayOf(schema.number(), { minSize: 1, maxSize: 2 }), thresholdComparator: getComparatorSchemaType(validateComparator), // aggregation type - aggType: schema.string({ validate: validateAggType }), + aggType: schema.string({ validate: validateAggType, defaultValue: 'count' }), // aggregation field aggField: schema.maybe(schema.string({ minLength: 1 })), // how to group - groupBy: schema.string({ validate: validateGroupBy }), + groupBy: schema.string({ validate: validateGroupBy, defaultValue: 'all' }), // field to group on (for groupBy: top) termField: schema.maybe(schema.string({ minLength: 1 })), // limit on number of groups returned diff --git a/x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.test.ts b/x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.test.ts index 6ffed5accf9cd5..0289223f525c89 100644 --- a/x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.test.ts +++ b/x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.test.ts @@ -109,6 +109,28 @@ export function runTests(schema: ObjectType, defaultTypeParams: Record { + params.aggType = undefined; + expect(onValidate()).not.toThrow(); + }); + + it('fails for invalid groupBy', async () => { + params.groupBy = 42; + expect(onValidate()).toThrowErrorMatchingInlineSnapshot( + `"[groupBy]: expected value of type [string] but got [number]"` + ); + + params.groupBy = '-not-a-valid-groupBy-'; + expect(onValidate()).toThrowErrorMatchingInlineSnapshot( + `"[groupBy]: invalid groupBy: \\"-not-a-valid-groupBy-\\""` + ); + }); + + it('uses default value "all" if groupBy is undefined', async () => { + params.groupBy = undefined; + expect(onValidate()).not.toThrow(); + }); + it('fails for invalid aggField', async () => { params.aggField = 42; expect(onValidate()).toThrowErrorMatchingInlineSnapshot( diff --git a/x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts b/x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts index 6fe6e391723794..c9ba7dc013d86e 100644 --- a/x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts +++ b/x-pack/plugins/triggers_actions_ui/server/data/lib/core_query_types.ts @@ -22,11 +22,11 @@ export const CoreQueryParamsSchemaProperties = { // field in index used for date/time timeField: schema.string({ minLength: 1 }), // aggregation type - aggType: schema.string({ validate: validateAggType }), + aggType: schema.string({ validate: validateAggType, defaultValue: 'count' }), // aggregation field aggField: schema.maybe(schema.string({ minLength: 1 })), // how to group - groupBy: schema.string({ validate: validateGroupBy }), + groupBy: schema.string({ validate: validateGroupBy, defaultValue: 'all' }), // field to group on (for groupBy: top) termField: schema.maybe(schema.string({ minLength: 1 })), // filter field diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/builtin_alert_types/es_query/rule.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/builtin_alert_types/es_query/rule.ts index 6a2314bec3a0b0..f422be7be19d79 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/builtin_alert_types/es_query/rule.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/builtin_alert_types/es_query/rule.ts @@ -979,6 +979,34 @@ export default function ruleTests({ getService }: FtrProviderContext) { }); }); + describe('aggType and groupBy', () => { + it('sets aggType: "count" and groupBy: "all" when they are undefined', async () => { + endDate = new Date().toISOString(); + + await createEsDocumentsInGroups(ES_GROUPS_TO_WRITE, endDate); + + await createRule({ + name: 'always fire', + esQuery: `{\n \"query\":{\n \"match_all\" : {}\n }\n}`, + size: 100, + thresholdComparator: '>', + threshold: [0], + aggType: undefined, + groupBy: undefined, + }); + + const docs = await waitForDocs(2); + + expect(docs[0]._source.hits.length).greaterThan(0); + const messagePattern = + /rule 'always fire' is active:\n\n- Value: \d+\n- Conditions Met: Number of matching documents is greater than 0 over 20s\n- Timestamp: \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/; + expect(docs[0]._source.params.message).to.match(messagePattern); + + expect(docs[1]._source.hits.length).to.be(0); + expect(docs[1]._source.params.message).to.match(/rule 'always fire' is recovered/); + }); + }); + async function waitForDocs(count: number): Promise { return await esTestIndexToolOutput.waitForDocs( ES_TEST_INDEX_SOURCE, @@ -1080,8 +1108,8 @@ export default function ruleTests({ getService }: FtrProviderContext) { thresholdComparator: params.thresholdComparator, threshold: params.threshold, searchType: params.searchType, - aggType: params.aggType ?? 'count', - groupBy: params.groupBy ?? 'all', + aggType: params.aggType, + groupBy: params.groupBy, aggField: params.aggField, termField: params.termField, termSize: params.termSize, diff --git a/x-pack/test/functional/apps/infra/home_page.ts b/x-pack/test/functional/apps/infra/home_page.ts index 2ff875212c0f2c..ae38c3dda3d8e5 100644 --- a/x-pack/test/functional/apps/infra/home_page.ts +++ b/x-pack/test/functional/apps/infra/home_page.ts @@ -193,7 +193,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); }); - describe('alerts flyouts', () => { + // FLAKY: https://github.com/elastic/kibana/issues/157711 + describe.skip('alerts flyouts', () => { before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'); await pageObjects.common.navigateToApp('infraOps'); diff --git a/x-pack/test/functional/apps/infra/hosts_view.ts b/x-pack/test/functional/apps/infra/hosts_view.ts index 25c7b14203b81e..c75ebfcf811c8c 100644 --- a/x-pack/test/functional/apps/infra/hosts_view.ts +++ b/x-pack/test/functional/apps/infra/hosts_view.ts @@ -180,7 +180,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(pageUrl).to.contain(HOSTS_VIEW_PATH); }); - describe('#Landing page', () => { + // FLAKY: https://github.com/elastic/kibana/issues/157718 + describe.skip('#Landing page', () => { beforeEach(() => { setHostViewEnabled(false); }); diff --git a/x-pack/test/functional/apps/infra/metrics_explorer.ts b/x-pack/test/functional/apps/infra/metrics_explorer.ts index 6159666d658aef..94ff40d13b6793 100644 --- a/x-pack/test/functional/apps/infra/metrics_explorer.ts +++ b/x-pack/test/functional/apps/infra/metrics_explorer.ts @@ -100,7 +100,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); }); - describe('Saved Views', () => { + // FLAKY: https://github.com/elastic/kibana/issues/157738 + describe.skip('Saved Views', () => { before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'); await pageObjects.infraHome.goToMetricExplorer(); diff --git a/x-pack/test/functional/apps/security/security.ts b/x-pack/test/functional/apps/security/security.ts index 11acd71ffc22d8..5f93739bfe7bb2 100644 --- a/x-pack/test/functional/apps/security/security.ts +++ b/x-pack/test/functional/apps/security/security.ts @@ -16,7 +16,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); const spaces = getService('spaces'); - describe('Security', function () { + // FLAKY: https://github.com/elastic/kibana/issues/157722 + describe.skip('Security', function () { this.tags('includeFirefox'); describe('Login Page', () => { before(async () => { diff --git a/x-pack/test/functional/apps/watcher/watcher_test.js b/x-pack/test/functional/apps/watcher/watcher_test.js index 16e639845fc9c0..eeba4a93025d42 100644 --- a/x-pack/test/functional/apps/watcher/watcher_test.js +++ b/x-pack/test/functional/apps/watcher/watcher_test.js @@ -20,7 +20,8 @@ export default function ({ getService, getPageObjects }) { const esSupertest = getService('esSupertest'); const PageObjects = getPageObjects(['security', 'common', 'header', 'settings', 'watcher']); - describe('watcher_test', function () { + // FLAKY: https://github.com/elastic/kibana/issues/157723 + describe.skip('watcher_test', function () { before('initialize tests', async () => { // There may be system watches if monitoring was previously enabled // These cannot be deleted via the UI, so we need to delete via the API