<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Splunk SOAR Playbook Virustotal output IP Reputation in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-SOAR-Playbook-Virustotal-output-IP-Reputation/m-p/746716#M29471</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/269896"&gt;@zksvc&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please could you share your code for doing this check? I suspect that you are counting the number of categories returned rather than the counts in each category - e.g. in that specific example you have "malicious" and "malware".&lt;/P&gt;&lt;P&gt;Check that what you're counting isnt an array of objects and/or share you config/code and I'd be happy to look into it further.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
    <pubDate>Thu, 22 May 2025 09:31:46 GMT</pubDate>
    <dc:creator>livehybrid</dc:creator>
    <dc:date>2025-05-22T09:31:46Z</dc:date>
    <item>
      <title>Splunk SOAR Playbook Virustotal output IP Reputation</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-SOAR-Playbook-Virustotal-output-IP-Reputation/m-p/746713#M29470</link>
      <description>&lt;P&gt;I've obtained this information from VirusTotal, and I want to create a playbook to check IP reputation and retrieve the results. I want to make a decision where if the result is greater than 0, it will write a note stating 'It's malicious from VirusTotal.' You can see this example: Community Score or information like '4/94 security vendors flagged.' I want to compare it according to VirusTotal from the playbook. However, when I run it, it only shows 'detected urls: 2.' Can someone explain this?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="11112.png" style="width: 360px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39086i7C4B59021BAE4317/image-size/medium?v=v2&amp;amp;px=400" role="button" title="11112.png" alt="11112.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1111.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39087iC063FC62389C2633/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1111.png" alt="1111.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 08:54:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-SOAR-Playbook-Virustotal-output-IP-Reputation/m-p/746713#M29470</guid>
      <dc:creator>zksvc</dc:creator>
      <dc:date>2025-05-22T08:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk SOAR Playbook Virustotal output IP Reputation</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-SOAR-Playbook-Virustotal-output-IP-Reputation/m-p/746716#M29471</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/269896"&gt;@zksvc&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please could you share your code for doing this check? I suspect that you are counting the number of categories returned rather than the counts in each category - e.g. in that specific example you have "malicious" and "malware".&lt;/P&gt;&lt;P&gt;Check that what you're counting isnt an array of objects and/or share you config/code and I'd be happy to look into it further.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 09:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-SOAR-Playbook-Virustotal-output-IP-Reputation/m-p/746716#M29471</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-05-22T09:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk SOAR Playbook Virustotal output IP Reputation</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-SOAR-Playbook-Virustotal-output-IP-Reputation/m-p/746721#M29472</link>
      <description>&lt;P&gt;What i want is from ES if it send to SOAR it will detect src IP then get information from VIrustotal, if it malicious it will write a note "Malicious from VirusTotal" and change the status to "Pending" to make sure monitoring team will double check it. i share screenshot for playbook&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zksvc_1-1747907510798.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39089i3D39838865BD749F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zksvc_1-1747907510798.png" alt="zksvc_1-1747907510798.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also here the code&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"""

"""


import phantom.rules as phantom
import json
from datetime import datetime, timedelta


@phantom.playbook_block()
def on_start(container):
    phantom.debug('on_start() called')

    # call 'update_event_1' block
    update_event_1(container=container)

    return

@phantom.playbook_block()
def update_event_1(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, loop_state_json=None, **kwargs):
    phantom.debug("update_event_1() called")

    # phantom.debug('Action: {0} {1}'.format(action['name'], ('SUCCEEDED' if success else 'FAILED')))

    container_artifact_data = phantom.collect2(container=container, datapath=["artifact:*.cef.event_id","artifact:*.id"])

    parameters = []

    # build parameters list for 'update_event_1' call
    for container_artifact_item in container_artifact_data:
        if container_artifact_item[0] is not None:
            parameters.append({
                "status": "in progress",
                "comment": "tahap analisa via SOAR",
                "event_ids": container_artifact_item[0],
                "context": {'artifact_id': container_artifact_item[1]},
            })

    ################################################################################
    ## Custom Code Start
    ################################################################################

    # Write your custom code here...

    ################################################################################
    ## Custom Code End
    ################################################################################

    phantom.act("update event", parameters=parameters, name="update_event_1", assets=["soar_es"], callback=ip_reputation_1)

    return


@phantom.playbook_block()
def ip_reputation_1(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, loop_state_json=None, **kwargs):
    phantom.debug("ip_reputation_1() called")

    # phantom.debug('Action: {0} {1}'.format(action['name'], ('SUCCEEDED' if success else 'FAILED')))

    container_artifact_data = phantom.collect2(container=container, datapath=["artifact:*.cef.src","artifact:*.id"])

    parameters = []

    # build parameters list for 'ip_reputation_1' call
    for container_artifact_item in container_artifact_data:
        if container_artifact_item[0] is not None:
            parameters.append({
                "ip": container_artifact_item[0],
                "context": {'artifact_id': container_artifact_item[1]},
            })

    ################################################################################
    ## Custom Code Start
    ################################################################################

    # Write your custom code here...

    ################################################################################
    ## Custom Code End
    ################################################################################

    phantom.act("ip reputation", parameters=parameters, name="ip_reputation_1", assets=["virustotalv3"], callback=decision_1)

    return


@phantom.playbook_block()
def decision_1(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, loop_state_json=None, **kwargs):
    phantom.debug("decision_1() called")

    # check for 'if' condition 1
    found_match_1 = phantom.decision(
        container=container,
        conditions=[
            ["ip_reputation_1:action_result.data.*.detected_communicating_samples.*.positives", "&amp;gt;", 0]
        ],
        delimiter=None)

    # call connected blocks if condition 1 matched
    if found_match_1:
        update_event_2(action=action, success=success, container=container, results=results, handle=handle)
        return

    return


@phantom.playbook_block()
def update_event_2(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, loop_state_json=None, **kwargs):
    phantom.debug("update_event_2() called")

    # phantom.debug('Action: {0} {1}'.format(action['name'], ('SUCCEEDED' if success else 'FAILED')))

    update_event_1_result_data = phantom.collect2(container=container, datapath=["update_event_1:action_result.parameter.event_ids","update_event_1:action_result.parameter.context.artifact_id"], action_results=results)

    parameters = []

    # build parameters list for 'update_event_2' call
    for update_event_1_result_item in update_event_1_result_data:
        if update_event_1_result_item[0] is not None:
            parameters.append({
                "status": "Pending",
                "comment": "Source IP is Malicious from VirusTotal",
                "event_ids": update_event_1_result_item[0],
                "context": {'artifact_id': update_event_1_result_item[1]},
            })

    ################################################################################
    ## Custom Code Start
    ################################################################################

    # Write your custom code here...

    ################################################################################
    ## Custom Code End
    ################################################################################

    phantom.act("update event", parameters=parameters, name="update_event_2", assets=["soar_es"])

    return


@phantom.playbook_block()
def on_finish(container, summary):
    phantom.debug("on_finish() called")

    ################################################################################
    ## Custom Code Start
    ################################################################################

    # Write your custom code here...

    ################################################################################
    ## Custom Code End
    ################################################################################

    return&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 09:53:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-SOAR-Playbook-Virustotal-output-IP-Reputation/m-p/746721#M29472</guid>
      <dc:creator>zksvc</dc:creator>
      <dc:date>2025-05-22T09:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk SOAR Playbook Virustotal output IP Reputation</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-SOAR-Playbook-Virustotal-output-IP-Reputation/m-p/746830#M29497</link>
      <description>&lt;P&gt;It's because VirusTotal version, all is good after i change to VirusTotalV3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zksvc_0-1747985933386.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/39118iE3EA12BD0C6194E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zksvc_0-1747985933386.png" alt="zksvc_0-1747985933386.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 07:39:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-SOAR-Playbook-Virustotal-output-IP-Reputation/m-p/746830#M29497</guid>
      <dc:creator>zksvc</dc:creator>
      <dc:date>2025-05-23T07:39:00Z</dc:date>
    </item>
  </channel>
</rss>

