Commit 43982770 authored by Denys Mishunov's avatar Denys Mishunov

Merge branch 'threat-monitoring-empty-states' into 'master'

Threat monitoring empty states

See merge request gitlab-org/gitlab!26540
parents ae6e1b89 a5b628ac
...@@ -32,6 +32,14 @@ export default { ...@@ -32,6 +32,14 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
wafNoDataSvgPath: {
type: String,
required: true,
},
networkPolicyNoDataSvgPath: {
type: String,
required: true,
},
documentationPath: { documentationPath: {
type: String, type: String,
required: true, required: true,
...@@ -85,18 +93,16 @@ export default { ...@@ -85,18 +93,16 @@ export default {
settings to make sure you've set up the WAF correctly.`, settings to make sure you've set up the WAF correctly.`,
), ),
wafChartEmptyStateDescription: s__( wafChartEmptyStateDescription: s__(
`ThreatMonitoring|While it's rare to have no traffic coming to your `ThreatMonitoring|The firewall is not installed or has been disabled. To view
application, it can happen. In any event, we ask that you double check your this data, ensure you firewall is installed and enabled for your cluster.`,
settings to make sure you've set up the WAF correctly.`,
), ),
networkPolicyChartEmptyStateDescription: s__( networkPolicyChartEmptyStateDescription: s__(
`ThreatMonitoring|While it's rare to have no traffic coming to your `ThreatMonitoring|Container NetworkPolicies are not installed or has been disabled. To view
application, it can happen. In any event, we ask that you double check your this data, ensure you NetworkPolicies are installed and enabled for your cluster.`,
settings to make sure you've set up the Network Policies correctly.`,
), ),
emptyStateDescription: s__( emptyStateDescription: s__(
`ThreatMonitoring|Threat monitoring provides security monitoring and rules `ThreatMonitoring|To view this data, ensure you have configured an environment
to protect production applications.`, for this project and that at least one threat monitoring feature is enabled.`,
), ),
alertText: s__( alertText: s__(
`ThreatMonitoring|The graph below is an overview of traffic coming to your `ThreatMonitoring|The graph below is an overview of traffic coming to your
...@@ -105,7 +111,7 @@ export default { ...@@ -105,7 +111,7 @@ export default {
malicious traffic is trying to access your app. The docs link is also malicious traffic is trying to access your app. The docs link is also
accessible by clicking the "?" icon next to the title below.`, accessible by clicking the "?" icon next to the title below.`,
), ),
helpPopoverText: s__('ThreatMonitoring|At this time, threat monitoring only supports WAF data.'), helpPopoverText: s__('ThreatMonitoring|View documentation'),
}; };
</script> </script>
...@@ -113,11 +119,11 @@ export default { ...@@ -113,11 +119,11 @@ export default {
<gl-empty-state <gl-empty-state
v-if="!isSetUpMaybe" v-if="!isSetUpMaybe"
ref="emptyState" ref="emptyState"
:title="s__('ThreatMonitoring|Threat monitoring is not enabled')" :title="s__('ThreatMonitoring|No environments detected')"
:description="$options.emptyStateDescription" :description="$options.emptyStateDescription"
:svg-path="emptyStateSvgPath" :svg-path="emptyStateSvgPath"
:primary-button-link="documentationPath" :primary-button-link="documentationPath"
:primary-button-text="__('Learn More')" :primary-button-text="__('More information')"
/> />
<section v-else> <section v-else>
...@@ -158,9 +164,11 @@ export default { ...@@ -158,9 +164,11 @@ export default {
:anomalous-title="s__('ThreatMonitoring|Anomalous Requests')" :anomalous-title="s__('ThreatMonitoring|Anomalous Requests')"
:nominal-title="s__('ThreatMonitoring|Total Requests')" :nominal-title="s__('ThreatMonitoring|Total Requests')"
:y-legend="s__('ThreatMonitoring|Requests')" :y-legend="s__('ThreatMonitoring|Requests')"
:chart-empty-state-title="s__('ThreatMonitoring|Application firewall not detected')"
:chart-empty-state-text="$options.wafChartEmptyStateDescription" :chart-empty-state-text="$options.wafChartEmptyStateDescription"
:chart-empty-state-svg-path="chartEmptyStateSvgPath" :chart-empty-state-svg-path="wafNoDataSvgPath"
:documentation-path="documentationPath" :documentation-path="documentationPath"
documentation-anchor="web-application-firewall"
/> />
<template v-if="glFeatures.networkPolicyUi"> <template v-if="glFeatures.networkPolicyUi">
...@@ -174,9 +182,11 @@ export default { ...@@ -174,9 +182,11 @@ export default {
:anomalous-title="s__('ThreatMonitoring|Dropped Packets')" :anomalous-title="s__('ThreatMonitoring|Dropped Packets')"
:nominal-title="s__('ThreatMonitoring|Total Packets')" :nominal-title="s__('ThreatMonitoring|Total Packets')"
:y-legend="s__('ThreatMonitoring|Operations Per Second')" :y-legend="s__('ThreatMonitoring|Operations Per Second')"
:chart-empty-state-title="s__('ThreatMonitoring|Container NetworkPolicies not detected')"
:chart-empty-state-text="$options.networkPolicyChartEmptyStateDescription" :chart-empty-state-text="$options.networkPolicyChartEmptyStateDescription"
:chart-empty-state-svg-path="chartEmptyStateSvgPath" :chart-empty-state-svg-path="networkPolicyNoDataSvgPath"
:documentation-path="documentationPath" :documentation-path="documentationPath"
documentation-anchor="container-network-policy"
/> />
</template> </template>
</section> </section>
......
<script> <script>
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { GlEmptyState } from '@gitlab/ui'; import { GlEmptyState } from '@gitlab/ui';
import { setUrlFragment } from '~/lib/utils/url_utility';
import LoadingSkeleton from './loading_skeleton.vue'; import LoadingSkeleton from './loading_skeleton.vue';
import StatisticsSummary from './statistics_summary.vue'; import StatisticsSummary from './statistics_summary.vue';
import StatisticsHistory from './statistics_history.vue'; import StatisticsHistory from './statistics_history.vue';
...@@ -37,6 +38,10 @@ export default { ...@@ -37,6 +38,10 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
chartEmptyStateTitle: {
type: String,
required: true,
},
chartEmptyStateText: { chartEmptyStateText: {
type: String, type: String,
required: true, required: true,
...@@ -49,6 +54,10 @@ export default { ...@@ -49,6 +54,10 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
documentationAnchor: {
type: String,
required: true,
},
}, },
computed: { computed: {
...mapState({ ...mapState({
...@@ -83,6 +92,9 @@ export default { ...@@ -83,6 +92,9 @@ export default {
to: this.timeRange.to, to: this.timeRange.to,
}; };
}, },
documentationFullPath() {
return setUrlFragment(this.documentationPath, this.documentationAnchor);
},
}, },
}; };
</script> </script>
...@@ -102,11 +114,12 @@ export default { ...@@ -102,11 +114,12 @@ export default {
<gl-empty-state <gl-empty-state
v-else v-else
ref="chartEmptyState" ref="chartEmptyState"
:title="s__('ThreatMonitoring|No traffic to display')" :title="chartEmptyStateTitle"
:description="chartEmptyStateText" :description="chartEmptyStateText"
:svg-path="chartEmptyStateSvgPath" :svg-path="chartEmptyStateSvgPath"
:primary-button-link="documentationPath" :primary-button-link="documentationFullPath"
:primary-button-text="__('Learn More')" :primary-button-text="__('Learn More')"
compact
/> />
</div> </div>
</template> </template>
...@@ -11,6 +11,8 @@ export default () => { ...@@ -11,6 +11,8 @@ export default () => {
environmentsEndpoint, environmentsEndpoint,
chartEmptyStateSvgPath, chartEmptyStateSvgPath,
emptyStateSvgPath, emptyStateSvgPath,
wafNoDataSvgPath,
networkPolicyNoDataSvgPath,
documentationPath, documentationPath,
defaultEnvironmentId, defaultEnvironmentId,
showUserCallout, showUserCallout,
...@@ -33,6 +35,8 @@ export default () => { ...@@ -33,6 +35,8 @@ export default () => {
props: { props: {
chartEmptyStateSvgPath, chartEmptyStateSvgPath,
emptyStateSvgPath, emptyStateSvgPath,
wafNoDataSvgPath,
networkPolicyNoDataSvgPath,
documentationPath, documentationPath,
defaultEnvironmentId: parseInt(defaultEnvironmentId, 10), defaultEnvironmentId: parseInt(defaultEnvironmentId, 10),
showUserCallout: parseBoolean(showUserCallout), showUserCallout: parseBoolean(showUserCallout),
......
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
- default_environment_id = @project.default_environment&.id || -1 - default_environment_id = @project.default_environment&.id || -1
#js-threat-monitoring-app{ data: { documentation_path: help_page_path('user/clusters/applications', anchor: 'web-application-firewall-modsecurity'), #js-threat-monitoring-app{ data: { documentation_path: help_page_path('user/application_security/threat_monitoring/index'),
chart_empty_state_svg_path: image_path('illustrations/chart-empty-state.svg'), chart_empty_state_svg_path: image_path('illustrations/chart-empty-state.svg'),
empty_state_svg_path: image_path('illustrations/security-dashboard-empty-state.svg'), empty_state_svg_path: image_path('illustrations/monitoring/unable_to_connect.svg'),
waf_no_data_svg_path: image_path('illustrations/firewall-not-detected-sm.svg'),
network_policy_no_data_svg_path: image_path('illustrations/network-policies-not-detected-sm.svg'),
waf_statistics_endpoint: summary_project_security_waf_anomalies_path(@project, format: :json), waf_statistics_endpoint: summary_project_security_waf_anomalies_path(@project, format: :json),
network_policy_statistics_endpoint: summary_project_security_network_policies_path(@project, format: :json), network_policy_statistics_endpoint: summary_project_security_network_policies_path(@project, format: :json),
environments_endpoint: project_environments_path(@project), environments_endpoint: project_environments_path(@project),
......
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
exports[`ThreatMonitoringApp component given there is a default environment with data given the networkPolicyUi feature flag is enabled renders the network policy section 1`] = ` exports[`ThreatMonitoringApp component given there is a default environment with data given the networkPolicyUi feature flag is enabled renders the network policy section 1`] = `
<threat-monitoring-section-stub <threat-monitoring-section-stub
anomaloustitle="Dropped Packets" anomaloustitle="Dropped Packets"
chartemptystatesvgpath="/chart-svgs" chartemptystatesvgpath="/network-policy-no-data-svg"
chartemptystatetext="While it's rare to have no traffic coming to your application, it can happen. In any event, we ask that you double check your settings to make sure you've set up the Network Policies correctly." chartemptystatetext="Container NetworkPolicies are not installed or has been disabled. To view this data, ensure you NetworkPolicies are installed and enabled for your cluster."
chartemptystatetitle="Container NetworkPolicies not detected"
documentationanchor="container-network-policy"
documentationpath="/docs" documentationpath="/docs"
nominaltitle="Total Packets" nominaltitle="Total Packets"
storenamespace="threatMonitoringNetworkPolicy" storenamespace="threatMonitoringNetworkPolicy"
...@@ -17,8 +19,10 @@ exports[`ThreatMonitoringApp component given there is a default environment with ...@@ -17,8 +19,10 @@ exports[`ThreatMonitoringApp component given there is a default environment with
exports[`ThreatMonitoringApp component given there is a default environment with data renders the waf section 1`] = ` exports[`ThreatMonitoringApp component given there is a default environment with data renders the waf section 1`] = `
<threat-monitoring-section-stub <threat-monitoring-section-stub
anomaloustitle="Anomalous Requests" anomaloustitle="Anomalous Requests"
chartemptystatesvgpath="/chart-svgs" chartemptystatesvgpath="/waf-no-data-svg"
chartemptystatetext="While it's rare to have no traffic coming to your application, it can happen. In any event, we ask that you double check your settings to make sure you've set up the WAF correctly." chartemptystatetext="The firewall is not installed or has been disabled. To view this data, ensure you firewall is installed and enabled for your cluster."
chartemptystatetitle="Application firewall not detected"
documentationanchor="web-application-firewall"
documentationpath="/docs" documentationpath="/docs"
nominaltitle="Total Requests" nominaltitle="Total Requests"
storenamespace="threatMonitoringWaf" storenamespace="threatMonitoringWaf"
......
...@@ -8,10 +8,11 @@ exports[`ThreatMonitoringSection component given the statistics are loading show ...@@ -8,10 +8,11 @@ exports[`ThreatMonitoringSection component given the statistics are loading show
exports[`ThreatMonitoringSection component given there is a default environment with no data to display shows the chart empty state 1`] = ` exports[`ThreatMonitoringSection component given there is a default environment with no data to display shows the chart empty state 1`] = `
<gl-empty-state-stub <gl-empty-state-stub
compact="true"
description="Empty Text" description="Empty Text"
primarybuttonlink="documentation_path" primarybuttonlink="documentation_path#anchor"
primarybuttontext="Learn More" primarybuttontext="Learn More"
svgpath="svg_path" svgpath="svg_path"
title="No traffic to display" title="Empty Title"
/> />
`; `;
...@@ -11,6 +11,8 @@ const defaultEnvironmentId = 3; ...@@ -11,6 +11,8 @@ const defaultEnvironmentId = 3;
const documentationPath = '/docs'; const documentationPath = '/docs';
const chartEmptyStateSvgPath = '/chart-svgs'; const chartEmptyStateSvgPath = '/chart-svgs';
const emptyStateSvgPath = '/svgs'; const emptyStateSvgPath = '/svgs';
const wafNoDataSvgPath = '/waf-no-data-svg';
const networkPolicyNoDataSvgPath = '/network-policy-no-data-svg';
const environmentsEndpoint = `${TEST_HOST}/environments`; const environmentsEndpoint = `${TEST_HOST}/environments`;
const wafStatisticsEndpoint = `${TEST_HOST}/waf`; const wafStatisticsEndpoint = `${TEST_HOST}/waf`;
const networkPolicyStatisticsEndpoint = `${TEST_HOST}/network_policy`; const networkPolicyStatisticsEndpoint = `${TEST_HOST}/network_policy`;
...@@ -37,6 +39,8 @@ describe('ThreatMonitoringApp component', () => { ...@@ -37,6 +39,8 @@ describe('ThreatMonitoringApp component', () => {
defaultEnvironmentId, defaultEnvironmentId,
chartEmptyStateSvgPath, chartEmptyStateSvgPath,
emptyStateSvgPath, emptyStateSvgPath,
wafNoDataSvgPath,
networkPolicyNoDataSvgPath,
documentationPath, documentationPath,
showUserCallout: true, showUserCallout: true,
userCalloutId, userCalloutId,
......
...@@ -40,9 +40,11 @@ describe('ThreatMonitoringSection component', () => { ...@@ -40,9 +40,11 @@ describe('ThreatMonitoringSection component', () => {
nominalTitle: 'Total Requests', nominalTitle: 'Total Requests',
anomalousTitle: 'Anomalous Requests', anomalousTitle: 'Anomalous Requests',
yLegend: 'Requests', yLegend: 'Requests',
chartEmptyStateTitle: 'Empty Title',
chartEmptyStateText: 'Empty Text', chartEmptyStateText: 'Empty Text',
chartEmptyStateSvgPath: 'svg_path', chartEmptyStateSvgPath: 'svg_path',
documentationPath: 'documentation_path', documentationPath: 'documentation_path',
documentationAnchor: 'anchor',
...propsData, ...propsData,
}, },
store, store,
......
...@@ -20745,19 +20745,25 @@ msgstr "" ...@@ -20745,19 +20745,25 @@ msgstr ""
msgid "ThreatMonitoring|Anomalous Requests" msgid "ThreatMonitoring|Anomalous Requests"
msgstr "" msgstr ""
msgid "ThreatMonitoring|At this time, threat monitoring only supports WAF data." msgid "ThreatMonitoring|Application firewall not detected"
msgstr "" msgstr ""
msgid "ThreatMonitoring|Container Network Policy" msgid "ThreatMonitoring|Container Network Policy"
msgstr "" msgstr ""
msgid "ThreatMonitoring|Container NetworkPolicies are not installed or has been disabled. To view this data, ensure you NetworkPolicies are installed and enabled for your cluster."
msgstr ""
msgid "ThreatMonitoring|Container NetworkPolicies not detected"
msgstr ""
msgid "ThreatMonitoring|Dropped Packets" msgid "ThreatMonitoring|Dropped Packets"
msgstr "" msgstr ""
msgid "ThreatMonitoring|Environment" msgid "ThreatMonitoring|Environment"
msgstr "" msgstr ""
msgid "ThreatMonitoring|No traffic to display" msgid "ThreatMonitoring|No environments detected"
msgstr "" msgstr ""
msgid "ThreatMonitoring|Operations Per Second" msgid "ThreatMonitoring|Operations Per Second"
...@@ -20778,6 +20784,9 @@ msgstr "" ...@@ -20778,6 +20784,9 @@ msgstr ""
msgid "ThreatMonitoring|Something went wrong, unable to fetch statistics" msgid "ThreatMonitoring|Something went wrong, unable to fetch statistics"
msgstr "" msgstr ""
msgid "ThreatMonitoring|The firewall is not installed or has been disabled. To view this data, ensure you firewall is installed and enabled for your cluster."
msgstr ""
msgid "ThreatMonitoring|The graph below is an overview of traffic coming to your application as tracked by the Web Application Firewall (WAF). View the docs for instructions on how to access the WAF logs to see what type of malicious traffic is trying to access your app. The docs link is also accessible by clicking the \"?\" icon next to the title below." msgid "ThreatMonitoring|The graph below is an overview of traffic coming to your application as tracked by the Web Application Firewall (WAF). View the docs for instructions on how to access the WAF logs to see what type of malicious traffic is trying to access your app. The docs link is also accessible by clicking the \"?\" icon next to the title below."
msgstr "" msgstr ""
...@@ -20787,13 +20796,10 @@ msgstr "" ...@@ -20787,13 +20796,10 @@ msgstr ""
msgid "ThreatMonitoring|Threat Monitoring help page link" msgid "ThreatMonitoring|Threat Monitoring help page link"
msgstr "" msgstr ""
msgid "ThreatMonitoring|Threat monitoring is not enabled" msgid "ThreatMonitoring|Time"
msgstr ""
msgid "ThreatMonitoring|Threat monitoring provides security monitoring and rules to protect production applications."
msgstr "" msgstr ""
msgid "ThreatMonitoring|Time" msgid "ThreatMonitoring|To view this data, ensure you have configured an environment for this project and that at least one threat monitoring feature is enabled."
msgstr "" msgstr ""
msgid "ThreatMonitoring|Total Packets" msgid "ThreatMonitoring|Total Packets"
...@@ -20802,10 +20808,10 @@ msgstr "" ...@@ -20802,10 +20808,10 @@ msgstr ""
msgid "ThreatMonitoring|Total Requests" msgid "ThreatMonitoring|Total Requests"
msgstr "" msgstr ""
msgid "ThreatMonitoring|Web Application Firewall" msgid "ThreatMonitoring|View documentation"
msgstr "" msgstr ""
msgid "ThreatMonitoring|While it's rare to have no traffic coming to your application, it can happen. In any event, we ask that you double check your settings to make sure you've set up the Network Policies correctly." msgid "ThreatMonitoring|Web Application Firewall"
msgstr "" msgstr ""
msgid "ThreatMonitoring|While it's rare to have no traffic coming to your application, it can happen. In any event, we ask that you double check your settings to make sure you've set up the WAF correctly." msgid "ThreatMonitoring|While it's rare to have no traffic coming to your application, it can happen. In any event, we ask that you double check your settings to make sure you've set up the WAF correctly."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment