Skip to content

[🐛 Bug]: Incident is_visible #5376

@diegovb-sys

Description

@diegovb-sys

Describe the bug
The threshold property to create an Incident from a correlation has a particularly implementation. When the threshold is > 1 the Incident is created with this first alert and put on hold until the upcoming alerts come in. This behavior makes feasible, for instance, to launch the "On Create" WF with the second alert instead the first (for a threshold = 2).

The principal issue is that the alert could be hidden because of this.
On the one hand, it's clear that in the Incidents, the incident won't be stay there, because is a germ-incident, not an incident itself.

On the other hand, if we filter the Feed by incident.id==null, the alert (which cause that germ-incident) won't be there, due to the alert has a real Incident in the data base.

In order to solve this problem, the solution would be having a filter like (incident.id==null || incident.is_visible == false). Nevertheless, the incident.is_visible is "wrapping" with this patter matching:

    FieldMappingConfiguration(
        map_from_pattern="alert.*",
        map_to=["JSON(alertenrichment.enrichments).*", "JSON(alert.event).*"],
    ),

in keep/api/core/incidents.py

To Reproduce
Steps to reproduce the behavior:

  1. Create a correlation with threshold > 1.
  2. Send 1 alert that matches with the previous correlation.
  3. Filter by incident.id == null in Feed
  4. Try to filter by incident.is_visible == false

Expected behavior
The expected behavior is having a consistence in the Feed when the preset tries to show only the alerts without incidents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions