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

[Security Solution] Error when upgrading a rule that has an action referencing a deleted connector #198771

Open
Tracked by #179907
banderror opened this issue Nov 4, 2024 · 3 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area Feature:Rule Actions Security Solution Detection Rule Actions area impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. needs product sdh-linked Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.

Comments

@banderror
Copy link
Contributor

banderror commented Nov 4, 2024

Epics: https://github.com/elastic/security-team/issues/1974 (internal), #179907
Related to: #178221, #198845
Location: Rule Management page, Rule Updates table

Summary

If a prebuilt rule has a rule action that refers to an action connector that has been deleted, then when you try to upgrade it, the upgrade will fail with the following message:

Image

POST /internal/detection_engine/prebuilt_rules/upgrade/_perform

{"mode":"SPECIFIC_RULES","rules":[{"rule_id":"035a6f21-4092-471d-9cda-9e379f459b1e","version":3,"revision":1}],"pick_version":"TARGET"}
{
    "summary": {
        "total": 1,
        "skipped": 0,
        "succeeded": 0,
        "failed": 1
    },
    "results": {
        "updated": [],
        "skipped": []
    },
    "errors": [
        {
            "message": "Failed to load action e3a6324b-c9a6-4716-b726-cd71b0cfdc82 (404): Saved object [action/e3a6324b-c9a6-4716-b726-cd71b0cfdc82] not found",
            "rules": [
                {
                    "rule_id": "035a6f21-4092-471d-9cda-9e379f459b1e",
                    "name": "Potential Memory Seeking Activity"
                }
            ]
        }
    ]
}

Steps to reproduce

  • Create a new connector, e.g. a test webhook connector
  • Edit some prebuilt rule that currently has updates to it (Rule Updates tab on the Rules page)
  • Add a webhook action to it referencing the newly added connector
  • Save the rule
  • Try to upgrade it (Rule Updates tab on the Rules page -> Update rule)

Behavior

Current behavior:

  • Upgrade fails
  • No clear explanation is shown to the user why it fails
  • The toast looks like the upgrade succeeded (green color, checkmark)

Expected behavior:

  • Option 1:
    • Upgrade fails
    • We communicate visually that it's an error
    • We explain to the user why it failed and what actions they need to do to resolve the issue
    • Keep in mind that when upgrading multiple rules there can be a partial upgrade failure - some may succeed, some may fail
  • Option 2:
    • Upgrade succeeds
    • We keep the actions that refer to deleted connectors, in the rules being upgraded (Alerting Framework might not allow to do that)
    • We show a warning that explains that user might want to remove those actions manually, otherwise they will be failing on rule execution
  • Option 3:
    • Upgrade succeeds
    • We remove the actions that refer to deleted connectors, from the rules being upgraded
    • We show a warning that explains to the user what was done and what rules were affected
  • Option 4:
    • We prevent this error from happening by updating rules on connector deletion on the Framework side (might not be possible or preferable to implement due to RBAC considerations)

Needs product input on how to handle it and which option to choose. Should be consistent with #178221.

Workaround

  1. Select all the problematic rules on the Installed Rules page
  2. Apply the Add Rule Actions bulk action to them, choosing Overwrite all selected rules actions in the flyout
  3. After completing this step, all rules should become upgradeable
@banderror banderror added bug Fixes for quality problems that affect the customer experience Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team labels Nov 4, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area Feature:Rule Actions Security Solution Detection Rule Actions area impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. needs product sdh-linked Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.
Projects
None yet
Development

No branches or pull requests

2 participants