Layer7 API Management

 View Only
  • 1.  How to retrieve stored password via restman api?

    Posted Sep 07, 2018 11:02 AM

    Please bear with me I am new to CA Gateway.

     

    Objective:

    • I am trying to retrieve stored password in CA Gateway via rest web service (restman) via curl command.

     

    What I have done:

    • I was able to list out stored passwords and be able to grab Id of the service account I was interested.
    • I used /restman/1.0/passwords/<id> URI to retrieve an entity but I didn't see encrypted password in returned data.
    • I've been looking into the REST management API the product provides for the answer but I have not been successful yet.

    I would appreciate your reply back and advice. Ty!



  • 2.  Re: How to retrieve stored password via restman api?

    Broadcom Employee
    Posted Sep 07, 2018 01:34 PM

    Passwords cannot be retrieved thru restman in their plain-text form for security reasons.

     

    To export then import it into another gateway, export using: 

    GET restman/1.0/bundle?password=<id>&encryptSecrets=true

    header: L7-key-passphrase = <password to encrypt with>

    import: 

    PUT restman/1.0/bundle

    header: L7-key-passphrase = <same password to decrypt with>



  • 3.  Re: How to retrieve stored password via restman api?

    Posted Sep 07, 2018 02:27 PM

    Thank you for taking your time to share with me valuable information. Understood that I can't retrieve the password.

    Bear with me asking one more question though.
    My ultimate goal is trying to update the target service account's password via PUT method. Would you mind teach me how to update the existing service account (e.g. FooAccount) 's password via restman? 



  • 4.  Re: How to retrieve stored password via restman api?

    Posted Sep 07, 2018 02:33 PM

    PUT 1.0/passwords/{id}

     

    I know the id but how can I enter new password to update?



  • 5.  Re: How to retrieve stored password via restman api?
    Best Answer

    Broadcom Employee
    Posted Sep 07, 2018 04:05 PM

    Sample:

    <l7:StoredPassword xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
          <l7:Name>Name</l7:Name>
          <l7:Password>PASSWORD</l7:Password>
          <l7:Properties>
             <l7:Property key="description">
                <l7:StringValue>Test password</l7:StringValue>
             </l7:Property>
             <l7:Property key="type">
                <l7:StringValue>Password</l7:StringValue>
             </l7:Property>
             <l7:Property key="usageFromVariable">
                <l7:BooleanValue>false</l7:BooleanValue>
             </l7:Property>
          </l7:Properties>
    </l7:StoredPassword>

     

    Generally its just a l7:Password element