From aaf6e4fbf45113809d69c2eadb10492d35fd4fd9 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:35:39 +1100 Subject: [PATCH] [8.x] [Security Solution] Disables `author` and `license` fields in rule edit form for prebuilt rule types (#201887) (#203001) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Disables `author` and `license` fields in rule edit form for prebuilt rule types (#201887)](https://github.com/elastic/kibana/pull/201887) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Davis Plumlee <56367316+dplumlee@users.noreply.github.com> Co-authored-by: Elastic Machine --- .../components/step_about_rule/index.tsx | 73 ++++++++++++------- .../step_about_rule/translations.ts | 14 ++++ .../pages/rule_editing/index.tsx | 2 + 3 files changed, 64 insertions(+), 25 deletions(-) diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.tsx index ac5c91aa8a25a..2d2ef8c8930d6 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { EuiAccordion, EuiFlexItem, EuiSpacer, EuiFormRow } from '@elastic/eui'; +import { EuiAccordion, EuiFlexItem, EuiSpacer, EuiFormRow, EuiToolTip } from '@elastic/eui'; import type { FC } from 'react'; import React, { memo, useCallback, useEffect, useState, useMemo } from 'react'; import styled from 'styled-components'; @@ -13,6 +13,7 @@ import styled from 'styled-components'; import type { DataViewBase } from '@kbn/es-query'; import type { Severity, Type } from '@kbn/securitysolution-io-ts-alerting-types'; +import type { RuleSource } from '../../../../../common/api/detection_engine'; import { isThreatMatchRule, isEsqlRule } from '../../../../../common/detection_engine/utils'; import type { RuleStepProps, @@ -55,6 +56,7 @@ interface StepAboutRuleProps extends RuleStepProps { timestampOverride: string; form: FormHook; esqlQuery?: string | undefined; + ruleSource?: RuleSource; } interface StepAboutRuleReadOnlyProps { @@ -85,6 +87,7 @@ const StepAboutRuleComponent: FC = ({ isLoading, form, esqlQuery, + ruleSource, }) => { const { data } = useKibana().services; @@ -280,31 +283,51 @@ const StepAboutRuleComponent: FC = ({ }} /> - + + + - + + + = ({ rule }) => { form={aboutStepForm} esqlQuery={esqlQueryForAboutStep} key="aboutStep" + ruleSource={rule.rule_source} /> )} @@ -343,6 +344,7 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { [ isPrebuiltRulesCustomizationEnabled, rule?.immutable, + rule.rule_source, rule?.id, activeStep, loading,