IBM Guardium

IBM Guardium

Join this online user 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.

 View Only
  • 1.  Creating a web interface for Guardium's REST API

    Posted Thu May 21, 2020 04:06 AM
    I've have been trying to make a simple web interface using JS to send POST and GET requests to the REST API of a local Guardium appliance, but I have encountered a problem with the CORS policy not allowing any of the requests. Using postman I have been able to use the API just fine but I can't get around the CORS policy in the browser. I have seen many Guardium API website POC even from IBM but couldn't find any code examples or guide. To summarize the question, is there a way to get around the CORS policy using JS or is there a different method I could take to create a simple web interface for sending GET and POST request to the appliance?

    ------------------------------
    Ron Shleif
    ------------------------------


  • 2.  RE: Creating a web interface for Guardium's REST API

    Posted Fri May 22, 2020 09:02 AM

    Ron,

    What you are describing seems very much like Swagger, which is on Guardium Data Protection's roadmap for 11.4 release.  A couple years ago I wrote a python script which takes the output of '/restAPI/restapi' and converts it to OpenAPI format.

    As far as getting around CORS policy, there is a way to disable it in Chrome (I'm not sure which browser you are using) I found here.



    ------------------------------
    JOSHUA KLAHN
    ------------------------------



  • 3.  RE: Creating a web interface for Guardium's REST API

    Posted Mon May 25, 2020 01:59 AM
    Hello Joshua, 
    Is there a possibility you can share the script? 

    Thanks, Alexey.

    ------------------------------
    Sincerely,
    Alexey Saltovski
    Tech Department Manager
    Tangram-Soft LTD
    Israel

    IBM Champion
    ------------------------------



  • 4.  RE: Creating a web interface for Guardium's REST API

    Posted Tue June 09, 2020 05:36 AM

    1. CORS is allowed on Guardium appliance for REST API requests especially to support such client.
    2.  I wrote a pure javascript client a few years ago, can't find the code - I do remember it was not simple, it required two phase requests with first one being an OPTIONS request and after that the actual GET/POST API request.
    I think javascript frameworks such as jquery and others can make it easier.
    Good luck

    ------------------------------
    GUY GALIL
    ------------------------------