For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Marcint43_13640's avatar
Marcint43_13640
Icon for Nimbostratus rankNimbostratus
Nov 07, 2013

session refresh with iControl ... not work

I am trying to write command line interface to some features of my F5 ... with authorization via cookie file (username and password should be given only once (per ~ 10 hours)) Authorization with cookie file works fine ... until something wrong happens with my session.

For the first time I am authenticating traditionally, with given username and password:

     eval {
        my $soap = SOAP::Lite->new(
           'proxy' => [
              "https://" . $CONFIG{'F5_HOST'} . ":" . $CONFIG{'F5_PORT'} . "/iControl/iControlPortal.cgi",
              'credentials' => [
                 $CONFIG{'F5_HOST'} . ":" . $CONFIG{'F5_PORT'},
                 "BIG-IP",
                 $CONFIG{'F5_USER'},  clear text username
                 $PASSWORD,
                 ],
              cookie_jar=>HTTP::Cookies->new(ignore_discard => 1, file=>$CookieFile, autosave=>1 ),
           ]
        ); 

Cookie file saved on disk looks as follow:

$ cat $CookieFile
LWP-Cookies-1.0
Set-Cookie3: BIGIPAuthCookie=71C*************************************; path="/"; domain=**.**.***.***; path_spec; secure; discard; version=0
Set-Cookie3: BIGIPAuthUsernameCookie=*******; path="/"; domain=**.**.***.***; path_spec; secure; discard; version=0

... "for some time" I do not have to give username and password, this credentials are READ from file "path_to_my_cookie_file":

     eval {
        my $soap = SOAP::Lite->new(
                 'proxy' => [
                    "https://" . $CONFIG{'F5_HOST'} . ":" . $CONFIG{'F5_PORT'} . "/iControl/iControlPortal.cgi",
                    cookie_jar=>HTTP::Cookies->new(ignore_discard => 1, file=>$CookieFile, autosave=>1 ),
              ]
        );
     }; 

and then get_failover_state() from 'uri' => 'urn:iControl:System/Failover'.

...this works ... for some about of 20 minutes (and this time varies! not always 20min, why?) and then ... cookie is not valid, I am getting: "401 F5 Authorization Required" and I have to type username and password 😞

When I am using F5 with web browser my session is kept longer without any ask for password.

How to keep my session (in many hours) via iControl ? F5 limits concurent session to 10, how to work with that and keeping session ?

No RepliesBe the first to reply