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

[8.15] [Security Solution] Fix prebuilt rule duplication logic to copy related integrations and required fields from the original rule (#191065) #191493

Merged
merged 2 commits into from
Aug 27, 2024

Commits on Aug 27, 2024

  1. [Security Solution] Fix prebuilt rule duplication logic to copy relat…

    …ed integrations and required fields from the original rule (elastic#191065)
    
    **Fixes: elastic#190628
    **Related to:** elastic#173595,
    elastic#173594
    
    ## Summary
    
    As stated in the bug ticket, when duplicating a prebuilt rule, the
    "Related Integrations" and "Required Fields" values should be inherited
    from the original rule, as it was specified in the Acceptance Criteria
    for elastic#173595 and
    elastic#173594.
    
    This PR:
    
    - Removes the logic that resets these fields to empty arrays for
    duplicated prebuilt rules - we needed this logic in the past because
    these fields were not editable in the UI, but we don't need it anymore.
    - Updates the corresponding unit tests.
    
    ## Screenshots
    
    These screenshots were taken after introducing the fixes.
    
    **Original prebuilt rule:**
    
    <img width="1463" alt="Screenshot_2024-08-23_at_13_25_07"
    src="https://github.com/user-attachments/assets/ad8673f5-aba3-40c8-ae91-bbd7d334b119">
    
    **Duplicated prebuilt rule:**
    
    <img width="1469" alt="Screenshot_2024-08-23_at_13_25_43"
    src="https://github.com/user-attachments/assets/03761a2b-6f53-4bab-bf4c-a71c6860802b">
    
    ### Checklist
    
    - [ ]
    [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
    was added for features that require explanation or tutorials
    - [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
    
    (cherry picked from commit b144c05)
    
    # Conflicts:
    #	x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.test.ts
    #	x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.ts
    banderror committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    3a0dd99 View commit details
    Browse the repository at this point in the history
  2. Fix test

    banderror committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    4035cbc View commit details
    Browse the repository at this point in the history