diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx index 1ecbde5b00d7b..6c139acbbdbff 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx @@ -436,11 +436,20 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { const onSubmit = useCallback(async () => { setNonBlockingRuleErrors([]); + const actionsStepFormValid = await actionsStepForm.validate(); + if (rule.immutable) { + // Since users cannot edit Define, About and Schedule tabs of the rule, we skip validation of those to avoid + // user confusion of seeing that those tabs have error and not being able to see or do anything about that. + // We will need to remove this condition once rule customization work is done. + if (actionsStepFormValid) { + await saveChanges(); + } + return; + } + const defineStepFormValid = await defineStepForm.validate(); const aboutStepFormValid = await aboutStepForm.validate(); const scheduleStepFormValid = await scheduleStepForm.validate(); - const actionsStepFormValid = await actionsStepForm.validate(); - if ( defineStepFormValid && aboutStepFormValid && @@ -465,6 +474,7 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { showSaveWithErrorsModal(); } }, [ + rule.immutable, defineStepForm, aboutStepForm, scheduleStepForm, diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/eql_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/eql_rule.cy.ts index a14218fcdda56..dea2e554e8e4f 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/eql_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/eql_rule.cy.ts @@ -231,7 +231,6 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => { const rule = getEqlRule(); it('validates missing data source', () => { - login(); visit(CREATE_RULE_URL); selectEqlRuleType(); getIndexPatternClearButton().click(); @@ -258,7 +257,6 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => { }); it('validates missing data fields', () => { - login(); visit(CREATE_RULE_URL); selectEqlRuleType(); @@ -282,7 +280,6 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => { }); it('validates syntax errors', () => { - login(); visit(CREATE_RULE_URL); selectEqlRuleType();