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.  Node.js API Integration with Resilient

    Posted 07/27/21 11:40 AM
    I need to access Resilient's API with Node.js by using an API-key and API-secret generated in Resilient.

    How do I define the headers when making a http request to resilient API?
    I am using superagent
    And have tried sending the authentication in different ways


    I tested it in Postman using the Basic Authentication, but I just get timeout on the request.
    So I suspect that there is something about my request headers that are not quite right.

    If someone have any experience with Resilient and Node.js it would be much appreciated

    ------------------------------
    Andreas Fiehn
    ------------------------------


  • 2.  RE: Node.js API Integration with Resilient

    Posted 07/28/21 01:43 AM
    Hello Andreas,

    I think the problem is about auth header. You should base64 encode your credential string (apikeyid:apikeysecret).

    apikey="qweqwe"
    apisecret="ewqewq"
    credentialstring = "qweqwe:ewqewq"
    b64encoded_string = "cXdlcXdlOmV3cWV3cQ=="

    So you header should be {"Authorization": "Basic cXdlcXdlOmV3cWV3cQ=="}

    If you look headers on Postman, you will see same header on Postman too.

    ------------------------------
    Burak Karaduman
    ------------------------------



  • 3.  RE: Node.js API Integration with Resilient

    Posted 08/06/21 06:54 AM
    Thank you Burak,
    I used the Node.js  Buffer-object to base64-encode it and it works now

    let credentialString = resilientKeyID + ":" +  resilientKeySecret;
    var buff = Buffer.from(credentialString);
    let base64CredentialString = buff.toString('base64');
    let auth = "Basic " + base64CredentialString;
    
    let header = {"Authorization": auth}


    ------------------------------
    Andreas Fiehn
    ------------------------------



  • 4.  RE: Node.js API Integration with Resilient

    Posted 08/06/21 07:05 AM
    Hello,

    I am glad it worked.

    ------------------------------
    Burak Karaduman
    ------------------------------