-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Monitoring] Fix the messaging around needing TLS enabled #72310
Merged
chrisronline
merged 6 commits into
elastic:master
from
chrisronline:monitoring/fixed_copy
Jul 21, 2020
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2f47951
Fix the copy
chrisronline 7c61bfa
Merge remote-tracking branch 'elastic/master' into monitoring/fixed_copy
chrisronline 9135ccb
Fix type issues
chrisronline f5f8762
PR feedback
chrisronline ac423ab
Merge remote-tracking branch 'elastic/master' into monitoring/fixed_copy
chrisronline 5c2fe23
Add missing code
chrisronline File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,7 +7,7 @@ | |||||||||
import React from 'react'; | ||||||||||
import { i18n } from '@kbn/i18n'; | ||||||||||
import { FormattedMessage } from '@kbn/i18n/react'; | ||||||||||
import { EuiSpacer, EuiLink, EuiCode, EuiText } from '@elastic/eui'; | ||||||||||
import { EuiSpacer, EuiLink } from '@elastic/eui'; | ||||||||||
import { Legacy } from '../../legacy_shims'; | ||||||||||
import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public'; | ||||||||||
|
||||||||||
|
@@ -30,11 +30,10 @@ const showTlsAndEncryptionError = () => { | |||||||||
<div> | ||||||||||
<p> | ||||||||||
{i18n.translate('xpack.monitoring.healthCheck.tlsAndEncryptionError', { | ||||||||||
defaultMessage: `You must enable Transport Layer Security between Kibana and Elasticsearch | ||||||||||
and configure an encryption key in your kibana.yml file to use the Alerting feature.`, | ||||||||||
defaultMessage: `Stack monitoring alerts require Transport Layer Security between Kibana and Elasticsearch and an encryption key in your kibana.yml file.`, | ||||||||||
})} | ||||||||||
</p> | ||||||||||
<EuiSpacer /> | ||||||||||
<EuiSpacer size="xs" /> | ||||||||||
<EuiLink | ||||||||||
href={`${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/alert-action-settings-kb.html#general-alert-action-settings`} | ||||||||||
external | ||||||||||
|
@@ -49,76 +48,7 @@ const showTlsAndEncryptionError = () => { | |||||||||
}); | ||||||||||
}; | ||||||||||
|
||||||||||
const showEncryptionError = () => { | ||||||||||
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = Legacy.shims.docLinks; | ||||||||||
|
||||||||||
Legacy.shims.toastNotifications.addWarning( | ||||||||||
{ | ||||||||||
title: toMountPoint( | ||||||||||
<FormattedMessage | ||||||||||
id="xpack.monitoring.healthCheck.encryptionErrorTitle" | ||||||||||
defaultMessage="You must set an encryption key" | ||||||||||
/> | ||||||||||
), | ||||||||||
text: toMountPoint( | ||||||||||
<div role="banner"> | ||||||||||
{i18n.translate('xpack.monitoring.healthCheck.encryptionErrorBeforeKey', { | ||||||||||
defaultMessage: 'To create an alert, set a value for ', | ||||||||||
})} | ||||||||||
<EuiText size="xs"> | ||||||||||
<EuiCode>{'xpack.encryptedSavedObjects.encryptionKey'}</EuiCode> | ||||||||||
</EuiText> | ||||||||||
{i18n.translate('xpack.monitoring.healthCheck.encryptionErrorAfterKey', { | ||||||||||
defaultMessage: ' in your kibana.yml file. ', | ||||||||||
})} | ||||||||||
<EuiLink | ||||||||||
href={`${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/alert-action-settings-kb.html#general-alert-action-settings`} | ||||||||||
external | ||||||||||
target="_blank" | ||||||||||
> | ||||||||||
{i18n.translate('xpack.monitoring.healthCheck.encryptionErrorAction', { | ||||||||||
defaultMessage: 'Learn how.', | ||||||||||
})} | ||||||||||
</EuiLink> | ||||||||||
</div> | ||||||||||
), | ||||||||||
}, | ||||||||||
{} | ||||||||||
); | ||||||||||
}; | ||||||||||
|
||||||||||
const showTlsError = () => { | ||||||||||
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = Legacy.shims.docLinks; | ||||||||||
|
||||||||||
Legacy.shims.toastNotifications.addWarning({ | ||||||||||
title: toMountPoint( | ||||||||||
<FormattedMessage | ||||||||||
id="xpack.monitoring.healthCheck.tlsErrorTitle" | ||||||||||
defaultMessage="You must enable Transport Layer Security" | ||||||||||
/> | ||||||||||
), | ||||||||||
text: toMountPoint( | ||||||||||
<div role="banner"> | ||||||||||
{i18n.translate('xpack.monitoring.healthCheck.tlsError', { | ||||||||||
defaultMessage: | ||||||||||
'Alerting relies on API keys, which require TLS between Elasticsearch and Kibana. ', | ||||||||||
})} | ||||||||||
<EuiLink | ||||||||||
href={`${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/configuring-tls.html`} | ||||||||||
external | ||||||||||
target="_blank" | ||||||||||
> | ||||||||||
{i18n.translate('xpack.monitoring.healthCheck.tlsErrorAction', { | ||||||||||
defaultMessage: 'Learn how to enable TLS.', | ||||||||||
})} | ||||||||||
</EuiLink> | ||||||||||
</div> | ||||||||||
), | ||||||||||
}); | ||||||||||
}; | ||||||||||
|
||||||||||
export const showSecurityToast = (alertingHealth: AlertingFrameworkHealth) => { | ||||||||||
const { isSufficientlySecure, hasPermanentEncryptionKey } = alertingHealth; | ||||||||||
if ( | ||||||||||
Array.isArray(alertingHealth) || | ||||||||||
(!alertingHealth.hasOwnProperty('isSufficientlySecure') && | ||||||||||
|
@@ -127,11 +57,5 @@ export const showSecurityToast = (alertingHealth: AlertingFrameworkHealth) => { | |||||||||
return; | ||||||||||
} | ||||||||||
|
||||||||||
if (!isSufficientlySecure && !hasPermanentEncryptionKey) { | ||||||||||
showTlsAndEncryptionError(); | ||||||||||
} else if (!isSufficientlySecure) { | ||||||||||
showTlsError(); | ||||||||||
} else if (!hasPermanentEncryptionKey) { | ||||||||||
showEncryptionError(); | ||||||||||
} | ||||||||||
showTlsAndEncryptionError(); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should still check for these cases:
Suggested change
|
||||||||||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.