c# - Return the date of last activity for an AWS Access Key -


i'm running audit gather information iam users , keys across our aws accounts. have following code gather keys:

amazonidentitymanagementserviceclient iam = new amazonidentitymanagementserviceclient(accesskey, secretkey);  listusersrequest userreq = new listusersrequest(); listusersresponse userres = iam.listusers(userreq);  foreach (user user in userres.users) {      listaccesskeysrequest keyreq = new listaccesskeysrequest     {         username = user.username     };     listaccesskeysresponse keyres = iam.listaccesskeys(keyreq);      foreach (accesskeymetadata key in keyres.accesskeymetadata)     {         // store these values          // key.accesskeyid         // key.username         // key.createdate         // key.status     } } 

one metric grab date key last used. way can determine keys can removed accounts while making sure key isn't being used. there api or call can make information?


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -