Splunk Enterprise Security

Retrieve Notable urgency within Adaptive Response

berrybob
Explorer

Hi,

I am currently working on an Adaptive Response that notifies us whenever there is a Notable in our queue of a certain urgency. The notification must include rule title and its configured urgency.

I've been trying to solve this with the Add-On Builder but so far only managed to pull the rule title via helper.settings.get("search_name"). I tried to get the urgency with get_events() but that only seems to contain the details of the correlation search. Does anyone have a pointer of what Im missing? 

Labels (1)
0 Karma
1 Solution

meetmshah
SplunkTrust
SplunkTrust

Instead of doing this, we don't we NOT trigger AR in the first place. Instead, we let the Notable created, and later have another scheduled search look over the priority of the notable based on notable macro and trigger alert if >low.

What say?

Please hit Karma, if this helps!

View solution in original post

0 Karma

meetmshah
SplunkTrust
SplunkTrust

So if I understand this correctly in simple terms - you want to get notified whenever there's a notable event with certain urgency? If so, do you want to get notified via Email?

We can use Notable macro (`notable`) in order to get the notable details along with urgency and use fields like source and urgency - in order to get the specific result.

0 Karma

berrybob
Explorer

Hi meetmash, sorry for the delay. What I want to achieve, is to have Splunk ES perform an adaptive response. That AR is supposed to be attached to my detection rules and notify us on an alternative channel (like Slack, Webex, Teams etc.). However, we only want to get notified when the urgency (after the risk correlation) of the notable is higher than low.

I've been digging into this for some time and figured out that the event_id, which is required to get the urgency, can be received through makro ´get_event_id_meval´. There is also a makro named ´get_urgency´but that one does not take the risk calculation into account. Ultimately, I found other makros that seem to influence the final urgency and ended up with the following script:

 

 

[...]
orig_sid = helper.settings.get('sid')
events = helper.get_events()
for event in events:
    orig_rid = event.get('rid')
    kwargs_blockingsearch = {"output_mode":"json", "earliest_time":"-10m",      "latest_time":"now"}
    search_query = f"""SEARCH index=notable orig_sid={orig_sid} orig_rid={orig_rid}
| eval ‘get_event_id_meval‘ rule_id=event_id
| ‘get_correlations‘
| ‘get_urgency‘
| ‘risk_correlation‘"""
    try:
        job = service.jobs.create(search_query, **kwargs_blockingsearch)
        while not job.is_done():
            sleep(.2)
        result_reader = results.JSONResultsReader(job.results(output_mode="json"))
        urgency_levels = {"critical", "high", "medium"}
        for result in result_reader:
            if isinstance(result, dict):
                if result.get("urgency") in urgency_levels:
                    """ Here comes the code to notify us on alternative channel"""
                else:
                    """Event not higher than low, ignore"""
    except Exception as e:
        """some exception logging"""

 

 

I tried hard coding some known sid and rid and the script worked fine. However, attaching this as AR to a detection rule doesnt trigger the notification. Any clue what I am missing?

0 Karma

meetmshah
SplunkTrust
SplunkTrust

Instead of doing this, we don't we NOT trigger AR in the first place. Instead, we let the Notable created, and later have another scheduled search look over the priority of the notable based on notable macro and trigger alert if >low.

What say?

Please hit Karma, if this helps!

0 Karma

berrybob
Explorer

Sounds like a good plan B to me 🙂 Will try to go with that instead. KR

0 Karma

meetmshah
SplunkTrust
SplunkTrust

Did you go through the above response and have follow-up questions?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...