Skip to content

Commit aabb759

Browse files
Merge branch '7.x' into backport/7.x/pr-72624
2 parents 3335005 + e3ed72d commit aabb759

File tree

9 files changed

+18
-86
lines changed

9 files changed

+18
-86
lines changed

docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registeronpostauth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ registerOnPostAuth: (handler: OnPostAuthHandler) => void;
1414

1515
## Remarks
1616

17-
The auth state is available at stage via http.auth.get(..) Can register any number of registerOnPreRouting, which are called in sequence (from the first registered to the last). See [OnPostAuthHandler](./kibana-plugin-core-server.onpostauthhandler.md)<!-- -->.
17+
The auth state is available at stage via http.auth.get(..) Can register any number of registerOnPostAuth, which are called in sequence (from the first registered to the last). See [OnPostAuthHandler](./kibana-plugin-core-server.onpostauthhandler.md)<!-- -->.
1818

docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registeronpreauth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ registerOnPreAuth: (handler: OnPreAuthHandler) => void;
1414

1515
## Remarks
1616

17-
Can register any number of registerOnPostAuth, which are called in sequence (from the first registered to the last). See [OnPreRoutingHandler](./kibana-plugin-core-server.onpreroutinghandler.md)<!-- -->.
17+
Can register any number of registerOnPreAuth, which are called in sequence (from the first registered to the last). See [OnPreAuthHandler](./kibana-plugin-core-server.onpreauthhandler.md)<!-- -->.
1818

docs/development/core/server/kibana-plugin-core-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
122122
| [OnPreAuthToolkit](./kibana-plugin-core-server.onpreauthtoolkit.md) | A tool set defining an outcome of OnPreAuth interceptor for incoming request. |
123123
| [OnPreResponseExtensions](./kibana-plugin-core-server.onpreresponseextensions.md) | Additional data to extend a response. |
124124
| [OnPreResponseInfo](./kibana-plugin-core-server.onpreresponseinfo.md) | Response status code. |
125-
| [OnPreResponseToolkit](./kibana-plugin-core-server.onpreresponsetoolkit.md) | A tool set defining an outcome of OnPreRouting interceptor for incoming request. |
125+
| [OnPreResponseToolkit](./kibana-plugin-core-server.onpreresponsetoolkit.md) | A tool set defining an outcome of OnPreResponse interceptor for incoming request. |
126126
| [OnPreRoutingToolkit](./kibana-plugin-core-server.onpreroutingtoolkit.md) | A tool set defining an outcome of OnPreRouting interceptor for incoming request. |
127127
| [OpsMetrics](./kibana-plugin-core-server.opsmetrics.md) | Regroups metrics gathered by all the collectors. This contains metrics about the os/runtime, the kibana process and the http server. |
128128
| [OpsOsMetrics](./kibana-plugin-core-server.opsosmetrics.md) | OS related metrics |

docs/development/core/server/kibana-plugin-core-server.onpreresponsetoolkit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## OnPreResponseToolkit interface
66

7-
A tool set defining an outcome of OnPreRouting interceptor for incoming request.
7+
A tool set defining an outcome of OnPreResponse interceptor for incoming request.
88

99
<b>Signature:</b>
1010

-33.3 KB
Loading

src/core/server/elasticsearch/client/types.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
* under the License.
1818
*/
1919

20-
import type { Client } from '@elastic/elasticsearch';
20+
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
2121
import type {
2222
ApiResponse,
2323
TransportRequestOptions,
2424
TransportRequestParams,
25+
TransportRequestPromise,
2526
} from '@elastic/elasticsearch/lib/Transport';
2627

2728
/**
@@ -30,13 +31,13 @@ import type {
3031
* @public
3132
*/
3233
export type ElasticsearchClient = Omit<
33-
Client,
34-
'connectionPool' | 'transport' | 'serializer' | 'extend' | 'helpers' | 'child' | 'close'
34+
KibanaClient,
35+
'connectionPool' | 'transport' | 'serializer' | 'extend' | 'child' | 'close'
3536
> & {
3637
transport: {
3738
request(
3839
params: TransportRequestParams,
3940
options?: TransportRequestOptions
40-
): Promise<ApiResponse>;
41+
): TransportRequestPromise<ApiResponse>;
4142
};
4243
};

src/core/server/server.api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { CatTasksParams } from 'elasticsearch';
2222
import { CatThreadPoolParams } from 'elasticsearch';
2323
import { ClearScrollParams } from 'elasticsearch';
2424
import { Client } from 'elasticsearch';
25-
import { Client as Client_2 } from '@elastic/elasticsearch';
2625
import { ClientOptions } from '@elastic/elasticsearch';
2726
import { ClusterAllocationExplainParams } from 'elasticsearch';
2827
import { ClusterGetSettingsParams } from 'elasticsearch';
@@ -93,6 +92,7 @@ import { IngestDeletePipelineParams } from 'elasticsearch';
9392
import { IngestGetPipelineParams } from 'elasticsearch';
9493
import { IngestPutPipelineParams } from 'elasticsearch';
9594
import { IngestSimulateParams } from 'elasticsearch';
95+
import { KibanaClient } from '@elastic/elasticsearch/api/kibana';
9696
import { KibanaConfigType } from 'src/core/server/kibana_config';
9797
import { MGetParams } from 'elasticsearch';
9898
import { MGetResponse } from 'elasticsearch';
@@ -143,6 +143,7 @@ import { TasksListParams } from 'elasticsearch';
143143
import { TermvectorsParams } from 'elasticsearch';
144144
import { TransportRequestOptions } from '@elastic/elasticsearch/lib/Transport';
145145
import { TransportRequestParams } from '@elastic/elasticsearch/lib/Transport';
146+
import { TransportRequestPromise } from '@elastic/elasticsearch/lib/Transport';
146147
import { Type } from '@kbn/config-schema';
147148
import { TypeOf } from '@kbn/config-schema';
148149
import { UpdateDocumentByQueryParams } from 'elasticsearch';

src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ kibana_vars=(
174174
xpack.infra.sources.default.fields.timestamp
175175
xpack.infra.sources.default.logAlias
176176
xpack.infra.sources.default.metricAlias
177+
xpack.ingestManager.fleet.tlsCheckDisabled
178+
xpack.ingestManager.registryUrl
177179
xpack.license_management.enabled
178180
xpack.ml.enabled
179181
xpack.reporting.capture.browser.autoDownload

x-pack/plugins/monitoring/public/alerts/lib/security_toasts.tsx

Lines changed: 5 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import React from 'react';
88
import { i18n } from '@kbn/i18n';
99
import { FormattedMessage } from '@kbn/i18n/react';
10-
import { EuiSpacer, EuiLink, EuiCode, EuiText } from '@elastic/eui';
10+
import { EuiSpacer, EuiLink } from '@elastic/eui';
1111
import { Legacy } from '../../legacy_shims';
1212
import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public';
1313

@@ -30,11 +30,10 @@ const showTlsAndEncryptionError = () => {
3030
<div>
3131
<p>
3232
{i18n.translate('xpack.monitoring.healthCheck.tlsAndEncryptionError', {
33-
defaultMessage: `You must enable Transport Layer Security between Kibana and Elasticsearch
34-
and configure an encryption key in your kibana.yml file to use the Alerting feature.`,
33+
defaultMessage: `Stack monitoring alerts require Transport Layer Security between Kibana and Elasticsearch, and an encryption key in your kibana.yml file.`,
3534
})}
3635
</p>
37-
<EuiSpacer />
36+
<EuiSpacer size="xs" />
3837
<EuiLink
3938
href={`${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/alert-action-settings-kb.html#general-alert-action-settings`}
4039
external
@@ -49,76 +48,9 @@ const showTlsAndEncryptionError = () => {
4948
});
5049
};
5150

52-
const showEncryptionError = () => {
53-
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = Legacy.shims.docLinks;
54-
55-
Legacy.shims.toastNotifications.addWarning(
56-
{
57-
title: toMountPoint(
58-
<FormattedMessage
59-
id="xpack.monitoring.healthCheck.encryptionErrorTitle"
60-
defaultMessage="You must set an encryption key"
61-
/>
62-
),
63-
text: toMountPoint(
64-
<div role="banner">
65-
{i18n.translate('xpack.monitoring.healthCheck.encryptionErrorBeforeKey', {
66-
defaultMessage: 'To create an alert, set a value for ',
67-
})}
68-
<EuiText size="xs">
69-
<EuiCode>{'xpack.encryptedSavedObjects.encryptionKey'}</EuiCode>
70-
</EuiText>
71-
{i18n.translate('xpack.monitoring.healthCheck.encryptionErrorAfterKey', {
72-
defaultMessage: ' in your kibana.yml file. ',
73-
})}
74-
<EuiLink
75-
href={`${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/alert-action-settings-kb.html#general-alert-action-settings`}
76-
external
77-
target="_blank"
78-
>
79-
{i18n.translate('xpack.monitoring.healthCheck.encryptionErrorAction', {
80-
defaultMessage: 'Learn how.',
81-
})}
82-
</EuiLink>
83-
</div>
84-
),
85-
},
86-
{}
87-
);
88-
};
89-
90-
const showTlsError = () => {
91-
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = Legacy.shims.docLinks;
92-
93-
Legacy.shims.toastNotifications.addWarning({
94-
title: toMountPoint(
95-
<FormattedMessage
96-
id="xpack.monitoring.healthCheck.tlsErrorTitle"
97-
defaultMessage="You must enable Transport Layer Security"
98-
/>
99-
),
100-
text: toMountPoint(
101-
<div role="banner">
102-
{i18n.translate('xpack.monitoring.healthCheck.tlsError', {
103-
defaultMessage:
104-
'Alerting relies on API keys, which require TLS between Elasticsearch and Kibana. ',
105-
})}
106-
<EuiLink
107-
href={`${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/configuring-tls.html`}
108-
external
109-
target="_blank"
110-
>
111-
{i18n.translate('xpack.monitoring.healthCheck.tlsErrorAction', {
112-
defaultMessage: 'Learn how to enable TLS.',
113-
})}
114-
</EuiLink>
115-
</div>
116-
),
117-
});
118-
};
119-
12051
export const showSecurityToast = (alertingHealth: AlertingFrameworkHealth) => {
12152
const { isSufficientlySecure, hasPermanentEncryptionKey } = alertingHealth;
53+
12254
if (
12355
Array.isArray(alertingHealth) ||
12456
(!alertingHealth.hasOwnProperty('isSufficientlySecure') &&
@@ -127,11 +59,7 @@ export const showSecurityToast = (alertingHealth: AlertingFrameworkHealth) => {
12759
return;
12860
}
12961

130-
if (!isSufficientlySecure && !hasPermanentEncryptionKey) {
62+
if (!isSufficientlySecure || !hasPermanentEncryptionKey) {
13163
showTlsAndEncryptionError();
132-
} else if (!isSufficientlySecure) {
133-
showTlsError();
134-
} else if (!hasPermanentEncryptionKey) {
135-
showEncryptionError();
13664
}
13765
};

0 commit comments

Comments
 (0)