Global Security Forum

Security Global Forum

Our mission is to provide clients with an online user community of industry peers and IBM experts, to exchange tips and tricks, best practices, and product knowledge. We hope the information you find here helps you maximize the value of your IBM Security solutions.

 View Only
  • 1.  POST REST calls on SVA examples

    Posted Thu May 04, 2023 08:48 AM

    I often make REST calls to SVA appliances to obtain information. These calls are made using only curl and standard bash scripting (no programming involved). I now wanted to do a DNS lookup using my REST code calls, and to my disappointment this failed.

     

    The call seems straightforward enough, according to the documentation it is simply a call to 'https://{appliance_hostname}/isam/net/lookup' but after digging into it a bit deeper, I see that this is a POST, and all my existing calls are only GETs.

     

    I thought that I had bookmarked examples of ISAM REST calls, but when I looked for it, I only found examples using Python code. Hence my question:

     

    Can anybody please provide me with some examples on how to make SVA REST POST calls only using curl and bash scripting (without using programming)?

     

    All feedback apreciated.

     

    Jacques Heydenrych

    WPS Health Solutions


    CONFIDENTIALITY NOTICE: This e-mail, including any attachments, may contain confidential, privileged and/or proprietary information which is solely for the use of the intended recipient(s). Any review, use, disclosure, or retention by others is strictly prohibited. If you are not an intended recipient, please contact the sender and delete this e-mail, any attachments, and all copies.


  • 2.  RE: POST REST calls on SVA examples

    Posted Fri May 05, 2023 07:45 AM

    CURL is a great Command Line Utility using POST verb with http(s) is a bit more complex than simple GET verb processing. Have you reviewed the help (-h) that is built into most CURL implementations. CURL supports providing the POST payload in the command line or from a file. Am partial to using the File method when doing POST verb with CURL. There are many different references on the Web as well, here is just one example: https://curl.se/docs/manpage.html 

    Good Luck.

      



    ------------------------------
    Steve Able
    Director of Strategy and Architecture
    Adaptigent formally GT Software, Inc.

    ------------------------------



  • 3.  RE: POST REST calls on SVA examples

    Posted Fri May 05, 2023 07:55 AM

    Yes, I do use 'curl'. When I said that I use Bash, I meant Bash utilities like curl, sed, echo etc.

     

    My problem is that what I am currently using only caters for REST calls where the verb is GET, I am looking for (non-Python) examples where the verb is POST.

     

    And of course an example that shows an actual DNS lookup REST call just using Bash would be awesome!

     

    Thanks

     

    Jacques Heydenrych

    WPS Health Solutions

     


    CONFIDENTIALITY NOTICE: This e-mail, including any attachments, may contain confidential, privileged and/or proprietary information which is solely for the use of the intended recipient(s). Any review, use, disclosure, or retention by others is strictly prohibited. If you are not an intended recipient, please contact the sender and delete this e-mail, any attachments, and all copies.





  • 4.  RE: POST REST calls on SVA examples

    Posted Mon May 08, 2023 01:50 PM

    Hey Jacques,

    I hope this isn't unsolicited or unwelcome, but I was able to use AI to whip up a quick POST example for CURL that you could plug into whatever Bash script you want:

    curl -X POST -H "Content-Type: application/json" -d '{"username": "johndoe", "password": "secretpassword"}' https://example.com/login

    This is just sending a JSON payload, which you could cook up with your Bash script, to a fake endpoint.

    Hope this helps,

    Steven



    ------------------------------
    Steven Perva
    Sr Mainframe Innovation Engineer
    Ensono
    Chicago IL
    Looking for somewhere to chat all things IBM Z? Join the System Z Enthusiast Discord at https://discord.gg/rFXEVKK7AH
    ------------------------------



  • 5.  RE: POST REST calls on SVA examples

    Posted Tue May 09, 2023 02:45 AM

    Hi Jacques,

    you can find examples on using curl for GET/POST/PUT calls in the rest api documentation that comes with the appliance, or that you can find here :

    https://ibm-security.github.io/apidocs/verifyaccess/10.0.5.0/ISVA-mgmt-rest-api/index.html



    ------------------------------
    Tom Bosmans
    ------------------------------