Splunk SOAR (f.k.a. Phantom)

How to reference a specific artifact in Phantom Playbook Visual Editor

zyun
Explorer

Hello, I'm looking to reference a specific artifact from the Phantom Playbook Visual Editor.

For example, a Phantom: Update Artifact block takes two parameters: artifact_id and cef_json. The list of default datapaths for artifact_id all follow the format of artifact:*.<field>, where the wildcard causes the update to occur on ALL artifacts. I would instead like to reference the first artifact in the container, so that only the first artifact is updated.

Is there a way to construct the datapath to accomplish this?

 

The current workaround I have for this is to use a Custom Function to output the first artifact object of the container, but this only creates a snapshot of the artifact object at the time the function is called; If I update the artifact after calling the function, I'll need to call the function again to get the updated artifact object values.

The closest thing I've seen to this is the phantom.collect() API call, in which you can specify a datapath with a specific label (ie. phantom.collect(container, "artifact:uniqueLabel")), where you can specify a label and only the artifacts with the given label is returned, but this same syntax does not work in the Playbook Visual Editor.

0 Karma

WalshyB
Path Finder

if its still required,

you could do a filter that would match all artifacts, i.e. id != "" and add code to the phantom.condition() function with limit=1 added into the parameters.

matched_artifacts_1, matched_results_1 = phantom.condition(
container=container,
conditions=[
["artifact:id", "!=", ""],
],
name="filter_first_artifact:condition_1",limit=1)

This should give you the first artifact in that container (first created). You can then use that filtered datapath to update only that artifact.

0 Karma
.conf21 Now Fully Virtual!
Register for FREE Today!

We've made .conf21 totally virtual and totally FREE! Our completely online experience will run from 10/19 through 10/20 with some additional events, too!