Bootstrap FreeKB - Broadcom API Gateway - List Stored Passwords using the Gateway Migration Utility
Broadcom API Gateway - List Stored Passwords using the Gateway Migration Utility

Updated:   |  Broadcom API Gateway articles

This assumes you are familiar with the basic usage of the Gateway Migration Utility. Following is an example of how to list every Stored Password in an API Gateway.

/path/to/GatewayMigrationUtility.sh restman
-host apig.example.com
-port 8443
-username john.doe
-password f5VPX0yUJPg.m4BrjdgMv84UgktddJD3xA
-method GET
-path '1.0/passwords'

 

Or the -argFile option can be used, to reduce the number of options that are used on the command line.

/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/passwords'

 

Let's say you have a stored password named foo. Notice the actual password is not viewable.

 

You can return a single Stored Password by including the ID of the Stored Password.

/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/passwords/da698409abc96df215cf2f80b2175a41'

 

Or, you can use the -query option to return a single Stored Password by including the name of the Stored Password.

/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/passwords'
-query 'name=foo'

 

The -response option can be used to output the XML to a file.

/path/to/GatewayMigrationUtility.sh restman
-argFile example.properties
-method GET
-path '1.0/passwords'
-response /path/to/passwords.xml

 

Here is an example of the output that should be returned. Just like when using the GUI, the actual password is not included in the output.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:List xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
    <l7:Name>SECURE_PASSWORD List</l7:Name>
    <l7:Type>List</l7:Type>
    <l7:TimeStamp>2020-09-15T06:58:08.958-05:00</l7:TimeStamp>
    <l7:Link rel="self" uri="https://api.example.com:8443/restman/1.0/passwords?name=foo"/>
    <l7:Link rel="template" uri="https://api.example.com:8443/restman/1.0/passwords/template"/>
    <l7:Item>
        <l7:Name>foo</l7:Name>
        <l7:Id>da698409abc96df215cf2f80b2175a41</l7:Id>
        <l7:Type>SECURE_PASSWORD</l7:Type>
        <l7:TimeStamp>2020-09-15T06:58:08.958-05:00</l7:TimeStamp>
        <l7:Link rel="self" uri="https://api.example.com:8443/restman/1.0/passwords/da698409abc96df215cf2f80b2175a41"/>
        <l7:Resource>
            <l7:StoredPassword id="da698409abc96df215cf2f80b2175a41" version="1">
                <l7:Name>foo</l7:Name>
                <l7:Properties>
                    <l7:Property key="description">
                        <l7:StringValue>foo</l7:StringValue>
                    </l7:Property>
                    <l7:Property key="lastUpdated">
                        <l7:DateValue>2019-07-25T14:39:50.934-05:00</l7:DateValue>
                    </l7:Property>
                    <l7:Property key="type">
                        <l7:StringValue>Password</l7:StringValue>
                    </l7:Property>
                    <l7:Property key="usageFromVariable">
                        <l7:BooleanValue>true</l7:BooleanValue>
                    </l7:Property>
                </l7:Properties>
            </l7:StoredPassword>
        </l7:Resource>
    </l7:Item>
</l7:List>

 

Let's say you have a service that contain a variable that references a stored password. In this example, myService is using the Set Context Variable assertion to reference the Stored Password named foo.

 

If you migrate out the service, the exported XML will contain something like this. Likewise, when the service is migrate in, if the stored password does not exist, it will be created.

<l7:Item>
    <l7:Name>foo</l7:Name>
    <l7:Id>da698409abc96df215cf2f80b2175a41</l7:Id>
    <l7:Type>SECURE_PASSWORD</l7:Type>
    <l7:TimeStamp>2020-09-16T05:31:16.200-05:00</l7:TimeStamp>
    <l7:Resource>
        <l7:StoredPassword id="da698409abc96df215cf2f80b2175a41" version="3">
            <l7:Name>foo</l7:Name>
            <l7:Password bundleKey="$L7C2$1bead,S6r54nqpTRWFUOpEZLyBkMyO3U80wYUkOZM6UX6Wn2E=$hto1qecMnl7Di039zMZtCzE6TuRx7WPpssQAsZ3sX/ecO3XG/yf8YV1Z57t6tGuAH4YlVowT9JFAJJsdI8H83S+aVULbKElAwQ7uSRoVy6P46ngSsfkWD5MJ1DD2PoEv">$L7C2$1,DycsfgD+WoSrtxHE4bvshEadl9wKFL+hOSyurIgtk4g=$3eCI+Vzr0LN1cOSCmP9zTJHm5BdcwpIdYsM3m+jZ/VrWWTrpcYaTniDQDaBS87yJEM+VW5cJQ3QDvnoQvWcj3Q==</l7:Password>
            <l7:Properties>
                <l7:Property key="description">
                    <l7:StringValue>my foo stored password</l7:StringValue>
                </l7:Property>
                <l7:Property key="lastUpdated">
                    <l7:DateValue>2020-09-16T04:54:23.501-05:00</l7:DateValue>
                </l7:Property>
                <l7:Property key="type">
                    <l7:StringValue>Password</l7:StringValue>
                </l7:Property>
                <l7:Property key="usageFromVariable">
                    <l7:BooleanValue>true</l7:BooleanValue>
                </l7:Property>
            </l7:Properties>
        </l7:StoredPassword>
    </l7:Resource>
</l7:Item>

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter ff6147 in the box below so that we can be sure you are a human.