Servicenow Integration with IBM Guardium

akki1947
Giga Contributor

Hi,

We have requirement to integrate servicenow instance with IBM guardium tool. 

>To use the command-line interface (CLI) to register the client ID from the collector side. Each client needs to be registered only once. The CLI returns a client secret for the client ID.How to use it ?

>To use the curl command-line tool from the REST client to send a request for an access token along with the client secret to the Guardium appliance.How to use Curl tool in servicenow integraton?

Any other implementation pointers will be very helpful.

3 REPLIES 3

Daniel Gurney1
Tera Expert

I think your question is more about Guardium API than about ServiceNow.   Have you read through this documentation?

https://www.ibm.com/support/knowledgecenter/SSMPHH_11.1.0/com.ibm.guardium.doc.reference/cli_api/usi...

 

If you are going to write code to register a client, then you will want to run that code on a different Linux VM and perhaps use TCL EXPECT to capture the Guardium collector's prompt, as Guardium CLI does not allow for scripting.

 

Hope this helps!

Nani9
Tera Contributor

Is there any place, I can get steps or overview from servicenow side ?

 

Thanks

I assume what you are asking is how to pull data from IBM Guardium into ServiceNow.

Steps:

  • From the command line of your central-manager, register an oauth client. This needs to be done just once.  Save the client_secret like you would a password and reuse it.
    grdapi register_oauth_client client_id="servicenow" grant_types="password" scope="read,write"
  • Authenticate and parse the response for "access_token" property
    https://www.ibm.com/docs/en/guardium/11.4?topic=guardapi-guardium-rest-api
            var req = new sn_ws.RESTMessageV2();
            req.setHttpMethod("POST");
            req.setEndpoint(this.baseUrl + "/oauth/token");
            req.setRequestHeader("content-type", "application/x-www-form-urlencoded");
            req.setRequestBody( ... );  //  client_id=servicenow&client_secret=xxxxx&username=admin&password=xxxx&grant_type=password
            var response = req.execute();
    

    The response of a post to https://<your-cm>/oauth/token looks like this
    {"access_token":"29ff4bb4-e622-41cf-97d0-de695ebd756b","token_type":"bearer","expires_in":10799,"scope":"read write"}
  • Use the access_token in header to all future Guardium REST-APIs
            req = new sn_ws.RESTMessageV2();
            req.setRequestHeader("Authorization", "Bearer " + this.oauthToken);
            req.setRequestHeader("Content-Type", "application/json");
            req.setHttpMethod(method);
            req.setEndpoint(this.baseUrl + "/restAPI/" + resource);
    


https://www.ibm.com/docs/en/guardium/11.4?topic=commands-guardium-api-z-reference