Skip to content
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

[Cloud Posture] Dashboard initial FTR #155163

Merged
merged 22 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ import {
import { FormattedDate, FormattedTime } from '@kbn/i18n-react';
import moment from 'moment';
import { i18n } from '@kbn/i18n';
import { DASHBOARD_COMPLIANCE_SCORE_CHART } from '../test_subjects';
import { statusColors } from '../../../common/constants';
import { RULE_FAILED, RULE_PASSED } from '../../../../common/constants';
import { CompactFormattedNumber } from '../../../components/compact_formatted_number';
import type { Evaluation, PostureTrend, Stats } from '../../../../common/types';
import { useKibana } from '../../../common/hooks/use_kibana';

interface CloudPostureScoreChartProps {
interface ComplianceScoreChartProps {
compact?: boolean;
trend: PostureTrend[];
data: Stats;
Expand All @@ -48,7 +49,7 @@ const getPostureScorePercentage = (postureScore: number): string => `${Math.roun
const PercentageInfo = ({
compact,
postureScore,
}: CloudPostureScoreChartProps['data'] & { compact?: CloudPostureScoreChartProps['compact'] }) => {
}: ComplianceScoreChartProps['data'] & { compact?: ComplianceScoreChartProps['compact'] }) => {
const { euiTheme } = useEuiTheme();
const percentage = getPostureScorePercentage(postureScore);

Expand All @@ -59,6 +60,7 @@ const PercentageInfo = ({
paddingLeft: compact ? euiTheme.size.s : euiTheme.size.xs,
marginBottom: compact ? euiTheme.size.s : 'none',
}}
data-test-subj={DASHBOARD_COMPLIANCE_SCORE_CHART.COMPLIANCE_SCORE}
>
<h3>{percentage}</h3>
</EuiTitle>
Expand Down Expand Up @@ -140,12 +142,12 @@ const CounterLink = ({
);
};

export const CloudPostureScoreChart = ({
export const ComplianceScoreChart = ({
data,
trend,
onEvalCounterClick,
compact,
}: CloudPostureScoreChartProps) => {
}: ComplianceScoreChartProps) => {
const { euiTheme } = useEuiTheme();

return (
Expand Down Expand Up @@ -173,7 +175,7 @@ export const CloudPostureScoreChart = ({
color={statusColors.passed}
onClick={() => onEvalCounterClick(RULE_PASSED)}
tooltipContent={i18n.translate(
'xpack.csp.cloudPostureScoreChart.counterLink.passedFindingsTooltip',
'xpack.csp.complianceScoreChart.counterLink.passedFindingsTooltip',
{ defaultMessage: 'Passed findings' }
)}
/>
Expand All @@ -184,7 +186,7 @@ export const CloudPostureScoreChart = ({
color={statusColors.failed}
onClick={() => onEvalCounterClick(RULE_FAILED)}
tooltipContent={i18n.translate(
'xpack.csp.cloudPostureScoreChart.counterLink.failedFindingsTooltip',
'xpack.csp.complianceScoreChart.counterLink.failedFindingsTooltip',
{ defaultMessage: 'Failed findings' }
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
KUBERNETES_DASHBOARD_CONTAINER,
KUBERNETES_DASHBOARD_TAB,
CLOUD_DASHBOARD_TAB,
CLOUD_POSTURE_DASHBOARD_PAGE_HEADER,
} from './test_subjects';
import { useCspmStatsApi, useKspmStatsApi } from '../../common/api/use_stats_api';
import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api';
Expand Down Expand Up @@ -332,6 +333,7 @@ export const ComplianceDashboard = () => {
return (
<CloudPosturePage>
<EuiPageHeader
data-test-subj={CLOUD_POSTURE_DASHBOARD_PAGE_HEADER}
bottomBorder
pageTitle={
<CloudPosturePageTitle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiTitle, useEuiTheme } from '@elas
import { FormattedMessage } from '@kbn/i18n-react';
import { css } from '@emotion/react';
import { i18n } from '@kbn/i18n';
import { CloudPostureScoreChart } from '../compliance_charts/cloud_posture_score_chart';
import type {
Cluster,
ComplianceDashboardData,
Expand All @@ -33,6 +32,7 @@ import {
DASHBOARD_TABLE_COLUMN_SCORE_TEST_ID,
DASHBOARD_TABLE_HEADER_SCORE_TEST_ID,
} from '../test_subjects';
import { ComplianceScoreChart } from '../compliance_charts/compliance_score_chart';

const CLUSTER_DEFAULT_SORT_ORDER = 'asc';

Expand Down Expand Up @@ -175,7 +175,7 @@ export const BenchmarksSection = ({
`}
data-test-subj={DASHBOARD_TABLE_COLUMN_SCORE_TEST_ID}
>
<CloudPostureScoreChart
<ComplianceScoreChart
compact
id={`${cluster.meta.assetIdentifierId}_score_chart`}
data={cluster.stats}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { EuiFlexGroup, EuiFlexItem, EuiFlexItemProps } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { css } from '@emotion/react';
import { statusColors } from '../../../common/constants';
import { DASHBOARD_COUNTER_CARDS } from '../test_subjects';
import { DASHBOARD_COUNTER_CARDS, DASHBOARD_SUMMARY_CONTAINER } from '../test_subjects';
import { CspCounterCard, CspCounterCardProps } from '../../../components/csp_counter_card';
import { CompactFormattedNumber } from '../../../components/compact_formatted_number';
import { ChartPanel } from '../../../components/chart_panel';
import { CloudPostureScoreChart } from '../compliance_charts/cloud_posture_score_chart';
import { ComplianceScoreChart } from '../compliance_charts/compliance_score_chart';
import type {
ComplianceDashboardData,
Evaluation,
Expand Down Expand Up @@ -139,6 +139,7 @@ export const SummarySection = ({
// height for compliance by cis section with max rows
height: 310px;
`}
data-test-subj={DASHBOARD_SUMMARY_CONTAINER}
>
<EuiFlexItem grow={dashboardColumnsGrow.first}>
<EuiFlexGroup direction="column">
Expand All @@ -151,7 +152,7 @@ export const SummarySection = ({
</EuiFlexItem>
<EuiFlexItem grow={dashboardColumnsGrow.second}>
<ChartPanel title={chartTitle}>
<CloudPostureScoreChart
<ComplianceScoreChart
id="cloud_posture_score_chart"
data={complianceData.stats}
trend={complianceData.trend}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@

export const MISSING_FINDINGS_NO_DATA_CONFIG = 'missing-findings-no-data-config';
export const DASHBOARD_CONTAINER = 'dashboard-container';
export const DASHBOARD_SUMMARY_CONTAINER = 'dashboard-summary-section';
export const KUBERNETES_DASHBOARD_CONTAINER = 'kubernetes-dashboard-container';
export const CLOUD_DASHBOARD_CONTAINER = 'cloud-dashboard-container';
export const CLOUD_POSTURE_DASHBOARD_PAGE_HEADER = 'cloud-posture-dashboard-page-header';

export const DASHBOARD_COUNTER_CARDS = {
CLUSTERS_EVALUATED: 'dashboard-counter-card-clusters-evaluated',
RESOURCES_EVALUATED: 'dashboard-counter-card-resources-evaluated',
Expand All @@ -18,3 +21,7 @@ export const DASHBOARD_TABLE_HEADER_SCORE_TEST_ID = 'csp:dashboard-sections-tabl
export const DASHBOARD_TABLE_COLUMN_SCORE_TEST_ID = 'csp:dashboard-sections-table-column-score';
export const KUBERNETES_DASHBOARD_TAB = 'kubernetes-dashboard-tab';
export const CLOUD_DASHBOARD_TAB = 'cloud-dashboard-tab';

export const DASHBOARD_COMPLIANCE_SCORE_CHART = {
COMPLIANCE_SCORE: 'dashboard-summary-section-compliance-score',
};
14 changes: 6 additions & 8 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -10639,8 +10639,6 @@
"xpack.csp.cloudPosturePage.packageNotInstalledRenderer.addKspmIntegrationButtonTitle": "Ajouter une intégration KSPM",
"xpack.csp.cloudPosturePage.packageNotInstalledRenderer.learnMoreTitle": "En savoir plus sur le niveau de sécurité du cloud",
"xpack.csp.cloudPosturePage.packageNotInstalledRenderer.promptTitle": "Détectez les erreurs de configuration de sécurité dans vos ressources cloud !",
"xpack.csp.cloudPostureScoreChart.counterLink.failedFindingsTooltip": "Échec des résultats",
"xpack.csp.cloudPostureScoreChart.counterLink.passedFindingsTooltip": "Réussite des résultats",
"xpack.csp.createPackagePolicy.customAssetsTab.dashboardViewLabel": "Afficher le tableau de bord CSP",
"xpack.csp.createPackagePolicy.customAssetsTab.findingsViewLabel": "Afficher les résultats CSP ",
"xpack.csp.createPackagePolicy.customAssetsTab.rulesViewLabel": "Afficher les règles CSP ",
Expand Down Expand Up @@ -26596,9 +26594,6 @@
"xpack.reporting.diagnostic.browserMissingFonts": "Le navigateur n'a pas réussi à localiser de police par défaut. Consultez {url} pour corriger ce problème.",
"xpack.reporting.diagnostic.noUsableSandbox": "Impossible d'utiliser la sandbox Chromium. Vous pouvez la désactiver à vos risques et périls avec \"xpack.screenshotting.browser.chromium.disableSandbox\". Veuillez consulter {url}",
"xpack.reporting.exportTypes.common.failedToDecryptReportJobDataErrorMessage": "Impossible de déchiffrer les données de la tâche de reporting. Veuillez vous assurer que {encryptionKey} est défini et générez à nouveau ce rapport. {err}",
"generateCsv.esErrorMessage": "Réponse {statusCode} reçue d'Elasticsearch : {message}",
"generateCsv.incorrectRowCount": "Une erreur a été rencontrée avec le nombre de lignes CSV générées à partir de la recherche : {expected} prévues, {received} reçues.",
"generateCsv.unknownErrorMessage": "Une erreur inconnue est survenue : {message}",
"xpack.reporting.jobResponse.errorHandler.notAuthorized": "Désolé, vous n'êtes pas autorisé à afficher ou supprimer les rapports {jobtype}",
"xpack.reporting.jobsQuery.deleteError": "Impossible de supprimer le rapport : {error}",
"xpack.reporting.jobStatusDetail.attemptXofY": "Tentative {attempts} sur {max_attempts}.",
Expand Down Expand Up @@ -26655,9 +26650,6 @@
"xpack.reporting.diagnostic.screenshotFailureMessage": "Impossible d'effectuer une capture d'écran de votre installation Kibana.",
"xpack.reporting.errorHandler.unknownError": "Erreur inconnue",
"xpack.reporting.exportTypes.common.missingJobHeadersErrorMessage": "Les en-têtes de tâche sont manquants",
"generateCsv.authenticationExpired.partialResultsMessage": "Ce rapport contient des résultats CSV partiels, car le token d'authentification a expiré. Exportez une quantité moindre de données ou augmentez le délai d'expiration du token d'authentification.",
"generateCsv.csvUnableToClosePit": "Impossible de fermer le point temporel utilisé pour la recherche. Vérifiez les logs de serveur Kibana.",
"generateCsv.escapedFormulaValues": "Le CSV peut contenir des formules dont les valeurs sont précédées d'un caractère d'échappement",
"xpack.reporting.jobCreatedBy.unknownUserPlaceholderText": "Inconnu",
"xpack.reporting.jobResponse.errorHandler.unknownError": "Erreur inconnue",
"xpack.reporting.jobStatusDetail.deprecatedText": "Il s'agit d'un type d'exportation déclassé. L'automatisation de ce rapport devra être à nouveau créée pour une question de compatibilité avec les futures versions de Kibana.",
Expand Down Expand Up @@ -26794,6 +26786,12 @@
"xpack.reporting.uiSettings.validate.customLogo.badFile": "Désolé, ce fichier ne convient pas. Veuillez essayer un autre fichier image.",
"xpack.reporting.uiSettings.validate.customLogo.tooLarge": "Désolé, ce fichier est trop volumineux. Le fichier image doit être inférieur à 200 kilo-octets.",
"xpack.reporting.userAccessError.learnMoreLink": "En savoir plus",
"generateCsv.esErrorMessage": "Réponse {statusCode} reçue d'Elasticsearch : {message}",
"generateCsv.incorrectRowCount": "Une erreur a été rencontrée avec le nombre de lignes CSV générées à partir de la recherche : {expected} prévues, {received} reçues.",
"generateCsv.unknownErrorMessage": "Une erreur inconnue est survenue : {message}",
"generateCsv.authenticationExpired.partialResultsMessage": "Ce rapport contient des résultats CSV partiels, car le token d'authentification a expiré. Exportez une quantité moindre de données ou augmentez le délai d'expiration du token d'authentification.",
"generateCsv.csvUnableToClosePit": "Impossible de fermer le point temporel utilisé pour la recherche. Vérifiez les logs de serveur Kibana.",
"generateCsv.escapedFormulaValues": "Le CSV peut contenir des formules dont les valeurs sont précédées d'un caractère d'échappement",
"xpack.rollupJobs.create.errors.dateHistogramIntervalInvalidCalendarIntervalSuggestion": "1{unit}",
"xpack.rollupJobs.create.errors.idSameAsCloned": "Le nom doit être différent du nom cloné : \"{clonedId}\".",
"xpack.rollupJobs.create.errors.indexPatternIllegalCharacters": "Supprimez les caractères {characterList} de votre modèle d'indexation.",
Expand Down
14 changes: 6 additions & 8 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -10639,8 +10639,6 @@
"xpack.csp.cloudPosturePage.packageNotInstalledRenderer.addKspmIntegrationButtonTitle": "KSPM統合の追加",
"xpack.csp.cloudPosturePage.packageNotInstalledRenderer.learnMoreTitle": "クラウドセキュリティ態勢の詳細をご覧ください",
"xpack.csp.cloudPosturePage.packageNotInstalledRenderer.promptTitle": "クラウドリソースでセキュリティの誤った構成を検出します。",
"xpack.csp.cloudPostureScoreChart.counterLink.failedFindingsTooltip": "失敗した調査結果",
"xpack.csp.cloudPostureScoreChart.counterLink.passedFindingsTooltip": "合格した調査結果",
"xpack.csp.createPackagePolicy.customAssetsTab.dashboardViewLabel": "CSPダッシュボードを表示",
"xpack.csp.createPackagePolicy.customAssetsTab.findingsViewLabel": "CSP調査結果を表示 ",
"xpack.csp.createPackagePolicy.customAssetsTab.rulesViewLabel": "CSPルールを表示 ",
Expand Down Expand Up @@ -26577,9 +26575,6 @@
"xpack.reporting.diagnostic.browserMissingFonts": "ブラウザーはデフォルトフォントを検索できませんでした。この問題を修正するには、{url}を参照してください。",
"xpack.reporting.diagnostic.noUsableSandbox": "Chromiumサンドボックスを使用できません。これは「xpack.screenshotting.browser.chromium.disableSandbox」で無効にすることができます。この作業はご自身の責任で行ってください。{url}を参照してください",
"xpack.reporting.exportTypes.common.failedToDecryptReportJobDataErrorMessage": "レポートジョブデータの解読に失敗しました。{encryptionKey} が設定されていることを確認してこのレポートを再生成してください。{err}",
"generateCsv.esErrorMessage": "Elasticsearchから{statusCode}応答を受け取りました:{message}",
"generateCsv.incorrectRowCount": "検索から生成されたCSVの行数でエラーが発生しました。正しい行数:{expected}、実際の行数:{received}。",
"generateCsv.unknownErrorMessage": "不明なエラーが発生しました:{message}",
"xpack.reporting.jobResponse.errorHandler.notAuthorized": "{jobtype}レポートを表示または削除する権限がありません",
"xpack.reporting.jobsQuery.deleteError": "レポートを削除できません:{error}",
"xpack.reporting.jobStatusDetail.attemptXofY": "{max_attempts}回中{attempts}回試行します。",
Expand Down Expand Up @@ -26636,9 +26631,6 @@
"xpack.reporting.diagnostic.screenshotFailureMessage": "Kibanaインストールのスクリーンショットを作成できませんでした。",
"xpack.reporting.errorHandler.unknownError": "不明なエラー",
"xpack.reporting.exportTypes.common.missingJobHeadersErrorMessage": "ジョブヘッダーがありません",
"generateCsv.authenticationExpired.partialResultsMessage": "認証トークが有効期限切れのため、このレポートには一部のCSVの結果が含まれています。少ない量のデータをエクスポートするか、認証トークンのタイムアウトを大きくします。",
"generateCsv.csvUnableToClosePit": "検索に使用したPoint-In-Timeを閉じることができません。Kibanaサーバーログを確認してください。",
"generateCsv.escapedFormulaValues": "CSVには、値がエスケープされた式が含まれる場合があります",
"xpack.reporting.jobCreatedBy.unknownUserPlaceholderText": "不明",
"xpack.reporting.jobResponse.errorHandler.unknownError": "不明なエラー",
"xpack.reporting.jobStatusDetail.deprecatedText": "これは廃止予定のエクスポートタイプです。将来のバージョンのKibanaとの互換性のためには、このレポートの自動化を再作成する必要があります。",
Expand Down Expand Up @@ -26775,6 +26767,12 @@
"xpack.reporting.uiSettings.validate.customLogo.badFile": "このファイルは動作しません。別の画像ファイルを試してください。",
"xpack.reporting.uiSettings.validate.customLogo.tooLarge": "このファイルは大きすぎます。画像ファイルは200キロバイト未満でなければなりません。",
"xpack.reporting.userAccessError.learnMoreLink": "詳細",
"generateCsv.esErrorMessage": "Elasticsearchから{statusCode}応答を受け取りました:{message}",
"generateCsv.incorrectRowCount": "検索から生成されたCSVの行数でエラーが発生しました。正しい行数:{expected}、実際の行数:{received}。",
"generateCsv.unknownErrorMessage": "不明なエラーが発生しました:{message}",
"generateCsv.authenticationExpired.partialResultsMessage": "認証トークが有効期限切れのため、このレポートには一部のCSVの結果が含まれています。少ない量のデータをエクスポートするか、認証トークンのタイムアウトを大きくします。",
"generateCsv.csvUnableToClosePit": "検索に使用したPoint-In-Timeを閉じることができません。Kibanaサーバーログを確認してください。",
"generateCsv.escapedFormulaValues": "CSVには、値がエスケープされた式が含まれる場合があります",
"xpack.rollupJobs.create.errors.dateHistogramIntervalInvalidCalendarIntervalSuggestion": "1{unit}",
"xpack.rollupJobs.create.errors.idSameAsCloned": "名前はクローン名「{clonedId}」と同じにできません。",
"xpack.rollupJobs.create.errors.indexPatternIllegalCharacters": "インデックスパターンから {characterList} を削除してください。",
Expand Down
Loading