Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecote committed Oct 15, 2021
1 parent 56cb517 commit 65f3b1b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
3 changes: 1 addition & 2 deletions docs/user/alerting/alerting-setup.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ If you are using an *on-premises* Elastic Stack deployment:

If you are using an *on-premises* Elastic Stack deployment with <<using-kibana-with-security, *security*>>:

* You must enable Transport Layer Security (TLS) for communication <<configuring-tls-kib-es, between {es} and {kib}>>. {kib} alerting uses <<api-keys, API keys>> to secure background rule checks and actions, and API keys require {ref}/configuring-tls.html#tls-http[TLS on the HTTP interface]. A proxy will not suffice.
* If you have enabled TLS and are still unable to access Alerting, ensure that you have not {ref}/security-settings.html#api-key-service-settings[explicitly disabled API keys].
* If you are unable to access Alerting, ensure that you have not {ref}/security-settings.html#api-key-service-settings[explicitly disabled API keys].

The Alerting framework uses queries that require the `search.allow_expensive_queries` setting to be `true`. See the scripts {ref}/query-dsl-script-query.html#_allow_expensive_queries_4[documentation].

Expand Down
2 changes: 2 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ export class DocLinksService {
clusterPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-cluster`,
elasticsearchSettings: `${ELASTICSEARCH_DOCS}security-settings.html`,
elasticsearchEnableSecurity: `${ELASTICSEARCH_DOCS}configuring-stack-security.html`,
elasticsearchEnableApiKeys: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`,
indicesPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-indices`,
kibanaTLS: `${ELASTICSEARCH_DOCS}security-basic-setup.html#encrypt-internode-communication`,
kibanaPrivileges: `${KIBANA_DOCS}kibana-privileges.html`,
Expand Down Expand Up @@ -713,6 +714,7 @@ export interface DocLinksStart {
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
elasticsearchEnableApiKeys: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ export const HealthCheck: React.FunctionComponent<Props> = ({
) : !healthCheck.isAlertsAvailable ? (
<AlertsError docLinks={docLinks} className={className} />
) : !healthCheck.isSufficientlySecure && !healthCheck.hasPermanentEncryptionKey ? (
<TlsAndEncryptionError docLinks={docLinks} className={className} />
<ApiKeysAndEncryptionError docLinks={docLinks} className={className} />
) : !healthCheck.hasPermanentEncryptionKey ? (
<EncryptionError docLinks={docLinks} className={className} />
) : (
<TlsError docLinks={docLinks} className={className} />
<ApiKeysDisabledError docLinks={docLinks} className={className} />
);
}
)
Expand Down Expand Up @@ -143,7 +143,7 @@ const EncryptionError = ({ docLinks, className }: PromptErrorProps) => (
/>
);

const TlsError = ({ docLinks, className }: PromptErrorProps) => (
const ApiKeysDisabledError = ({ docLinks, className }: PromptErrorProps) => (
<EuiEmptyPrompt
iconType="watchesApp"
data-test-subj="actionNeededEmptyPrompt"
Expand All @@ -152,22 +152,28 @@ const TlsError = ({ docLinks, className }: PromptErrorProps) => (
title={
<h2>
<FormattedMessage
id="xpack.triggersActionsUI.components.healthCheck.tlsErrorTitle"
defaultMessage="You must enable Transport Layer Security and API keys"
id="xpack.triggersActionsUI.components.healthCheck.apiKeysDisabledErrorTitle"
defaultMessage="You must enable API keys"
/>
</h2>
}
body={
<div className={`${className}__body`}>
<p role="banner">
{i18n.translate('xpack.triggersActionsUI.components.healthCheck.tlsError', {
defaultMessage:
'Alerting relies on API keys, which require TLS between Elasticsearch and Kibana. ',
{i18n.translate('xpack.triggersActionsUI.components.healthCheck.apiKeysDisabledError', {
defaultMessage: 'Alerting relies on API keys. ',
})}
<EuiLink href={docLinks.links.security.kibanaTLS} external target="_blank">
{i18n.translate('xpack.triggersActionsUI.components.healthCheck.tlsErrorAction', {
defaultMessage: 'Learn how to enable TLS.',
})}
<EuiLink
href={docLinks.links.security.elasticsearchEnableApiKeys}
external
target="_blank"
>
{i18n.translate(
'xpack.triggersActionsUI.components.healthCheck.apiKeysDisabledErrorAction',
{
defaultMessage: 'Learn how to enable API keys.',
}
)}
</EuiLink>
</p>
</div>
Expand Down Expand Up @@ -206,7 +212,7 @@ const AlertsError = ({ docLinks, className }: PromptErrorProps) => (
/>
);

const TlsAndEncryptionError = ({ docLinks, className }: PromptErrorProps) => (
const ApiKeysAndEncryptionError = ({ docLinks, className }: PromptErrorProps) => (
<EuiEmptyPrompt
iconType="watchesApp"
data-test-subj="actionNeededEmptyPrompt"
Expand All @@ -215,21 +221,23 @@ const TlsAndEncryptionError = ({ docLinks, className }: PromptErrorProps) => (
title={
<h2>
<FormattedMessage
id="xpack.triggersActionsUI.components.healthCheck.tlsAndEncryptionErrorTitle"
id="xpack.triggersActionsUI.components.healthCheck.apiKeysAndEncryptionErrorTitle"
defaultMessage="Additional setup required"
/>
</h2>
}
body={
<div className={`${className}__body`}>
<p role="banner">
{i18n.translate('xpack.triggersActionsUI.components.healthCheck.tlsAndEncryptionError', {
defaultMessage:
'You must enable Transport Layer Security between Kibana and Elasticsearch and configure an encryption key in your kibana.yml file. ',
})}
{i18n.translate(
'xpack.triggersActionsUI.components.healthCheck.apiKeysAndEncryptionError',
{
defaultMessage: 'You must enable API keys and configure an encryption key. ',
}
)}
<EuiLink href={docLinks.links.alerting.setupPrerequisites} external target="_blank">
{i18n.translate(
'xpack.triggersActionsUI.components.healthCheck.tlsAndEncryptionErrorAction',
'xpack.triggersActionsUI.components.healthCheck.apiKeysAndEncryptionErrorAction',
{
defaultMessage: 'Learn how.',
}
Expand Down

0 comments on commit 65f3b1b

Please sign in to comment.