IBM Verify

IBM Verify

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.  ISVA Management Authorization Rest API

    Posted 10/29/22 11:46 AM

    I'm trying to script various remote LDAP groups into my Management Authorization for an appliance.  I use curl since I'm more familiar with it, and all other scripts work perfectly, but I'm hitting a wall for Management Authorizations.
    The following script -
    applianceURLs=("120.100.10.45:444")
    userPass='admin@local:password'
    curl -k -s -H "Accept:application/json" -u $userPass -X PUT https://$applianceURLs/authorization/config/v1 -d {"enforcing":true}
    sleep 2
    echo
    echo "***** Configuration for - "$applianceURLs" - COMPLETED *****"
    curl -k -s -H "Accept:application/json" -u $userPass -X PUT https://$applianceURLs/isam/pending_changes
    echo
    sleep 2
    curl -k -s -H "Accept:application/json" -H "Content-Type:application/json" -u $userPass -X POST https://$applianceURLs/authorization/roles/v1 \
    POST DATA:{
       "users": [
         {
           "name:webseal-user",
           "type:local"
         }
        ],
        "groups": [
         {
           "name": "webseal-group",
           "type": "local"
         }
        ],
        "features": [
          {
            "name":   "reverse_proxy",
            "access": "w"
          }
        ],
       "name": "WebSEAL Administrator"
     }

    exit 0

    I got the POST language from the Rest API documentation but it keeps shooting these errors;
    $ ./CreateManagementAuthorization.sh
    {"enforcing":true}
    ***** Configuration for - 120.100.10.45:444 - COMPLETED *****
    {"result":0,"message":"Successfully deployed all pending changes.","status":0}
    ./CreateManagementAuthorization.sh: line 25: users:: command not found
    ./CreateManagementAuthorization.sh: line 27: name:webseal-user,: command not found
    ./CreateManagementAuthorization.sh: line 28: type:local: command not found
    ./CreateManagementAuthorization.sh: line 30: ],: command not found
    ./CreateManagementAuthorization.sh: line 31: groups:: command not found
    ./CreateManagementAuthorization.sh: line 33: name:: command not found
    ./CreateManagementAuthorization.sh: line 34: type:: command not found
    ./CreateManagementAuthorization.sh: line 36: ],: command not found
    ./CreateManagementAuthorization.sh: line 37: features:: command not found
    ./CreateManagementAuthorization.sh: line 39: name:: command not found
    ./CreateManagementAuthorization.sh: line 40: access:: command not found
    ./CreateManagementAuthorization.sh: line 42: ],: command not found
    ./CreateManagementAuthorization.sh: line 43: name:: command not found
    ./CreateManagementAuthorization.sh: line 44: syntax error near unexpected token `}'
    ./CreateManagementAuthorization.sh: line 44: ` }'

    Any ideas, suggestions, or fixes?




  • 2.  RE: ISVA Management Authorization Rest API

    Posted 10/30/22 03:59 PM

    Jose,

     

    The problem is that the curl command which you are invoking is not passing the JSON data in the request, and is instead trying to exedcute the supplied JSON data as local commands.  To overcome this problem you need to:

    1. Supply the data with the '-data' option;
    2. Ensure that the JSON data is enclosed within quotes;
    3. Collapse the JSON data to a single line.

     

    So, you original curl request would become:

    curl -k -s -H "Accept:application/json" -H "Content-Type:application/json" -u $userPass -X POST \

    --data '{ "users": [  {  "name:webseal-user", "type:local" } ],"groups": [{  "name": "webseal-group", "type": "local" } ], "features": [  {  "name":   "reverse_proxy",  "access": "w"  ], "name": "WebSEAL Administrator" }' \
    $applianceURLs/authorization/roles/v1

     

    (Please note that the command has not been tested).

     

    I hope that this helps.

     

     

    Scott A. Exton
    Senior Software Engineer
    Chief Programmer - IBM Security Verify Access

    IBM Master Inventor

    cid4122760825*<a href=image002.png@01D85F83.85516C50">