-
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
[Security Solution] Allow users to edit setup field for custom rules #178131
Conversation
...rity_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/schema.tsx
Outdated
Show resolved
Hide resolved
/ci |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
In export const duplicateRule = async ({ rule }: DuplicateRuleParams): Promise<InternalRuleCreate> => {
// Generate a new static ruleId
const ruleId = uuidv4();
// If it's a prebuilt rule, reset Related Integrations, Required Fields and Setup Guide.
// We do this because for now we don't allow the users to edit these fields for custom rules.
const isPrebuilt = rule.params.immutable;
const relatedIntegrations = isPrebuilt ? [] : rule.params.relatedIntegrations;
const requiredFields = isPrebuilt ? [] : rule.params.requiredFields;
const setup = isPrebuilt ? '' : rule.params.setup;
[...] We can get rid of that check for |
The types of the arguments of export const convertCreateAPIToInternalSchema = (
input: RuleCreateProps & {
related_integrations?: RelatedIntegrationArray;
required_fields?: RequiredFieldArray;
setup?: SetupGuide; /// <------- this can be removed since setup is now part of RuleCreateProps
},
immutable = false,
defaultEnabled = true
): InternalRuleCreate => { export const convertPatchAPIToInternalSchema = (
nextParams: PatchRuleRequestBody & {
related_integrations?: RelatedIntegrationArray;
required_fields?: RequiredFieldArray;
setup?: SetupGuide; /// <------- this can be removed since setup is now part of PatchRuleRequestBody
},
existingRule: SanitizedRule<RuleParams>
): InternalRuleUpdate => { |
...ty_solution/public/detection_engine/rule_creation_ui/components/description_step/helpers.tsx
Outdated
Show resolved
Hide resolved
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.
@jpdjere asked the hard questions, here, but beyond those this LGTM!
Looks good! Thanks @dplumlee! |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
Canvas Sharable Runtime
History
To update your PR or re-run it, just comment with: cc @dplumlee |
Crossposting #179680 (comment). Follow up PR needed for a schema update. cc @dplumlee |
…p guide field (#180638) ## Summary Adds extra tests to cover remaining areas not addressed in #178131 Adds cypress tests and adds `setup` field to utils to be used in import/export integration tests [Flaky test run (internal)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5776) ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Summary
Addresses #173626
Adds a markdown component in the create and edit rule forms so that users are able to add their own setup guides to custom rules. Also updates the
create
andupdate
rule schemas and route logic to handle these new cases through the API.Flaky test run (internal)
Screenshots
Checklist
Delete any items that are not applicable to this PR.
For maintainers