IBM Security QRadar SOAR

 View Only
  • 1.  Parse Utilities Function for SOAR - Get Complete Header from .EML

    Posted 28 days ago

    Is it possible to pull the header from a .EML attachment using this app? An example playbook bundled with the App provides a way (snippit below) to grab IPs from the header but not the complete header.

    Thank you Community!

    Ken

    ################################################
      # Add Artifacts for IPs found in Email Headers #
      ################################################
      for eml_header in email.get("received", []):
        
        the_header = eml_header.get("from", None)
        
        if the_header:
          ips = re.findall('(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)', the_header)
          unique_ips = set(ips)
      
          for an_ip in unique_ips:
            if an_ip:
              incident.addArtifact("IP Address", an_ip, u"Hop {0} at {1}\n\nHeader: {2}".format(eml_header.get("hop", ""), eml_header.get("date_utc", ""), the_header))
              



    ------------------------------
    ken ching
    ------------------------------


  • 2.  RE: Parse Utilities Function for SOAR - Get Complete Header from .EML

    Posted 28 days ago

    If you add a note to the incident with all the results of "Parse Utilities: Email Parse" all the headers will be there.



    ------------------------------
    Maria Czapkowska
    ------------------------------



  • 3.  RE: Parse Utilities Function for SOAR - Get Complete Header from .EML

    Posted 27 days ago

    Thanks for the response Maria.

    By "all results" do you mean this?:

    incident.addNote(str(email.get("received", [])))


    ------------------------------
    ken ching
    ------------------------------



  • 4.  RE: Parse Utilities Function for SOAR - Get Complete Header from .EML

    Posted 10 days ago

    No, I mean the results of the function "Parse Utilities: Email Parse". If you have the code you shared, that means you have the parse utilities app and the playbook.

    I don't know what's the output name in your case, for me its email_parse so in the script Email Parsing (Attachment) I'd add

    incident.addNote(str(playbook.functions.results.email_parse)



    ------------------------------
    Maria Czapkowska
    ------------------------------