Track usage of IBM Cloud API keys
This is a sample Python tool to search Activity Tracker with LogDNA service on IBM Cloud for usage of API keys. It utilizes the IAM Identity Services API to obtain a list of personal API keys as well as keys for account service IDs.
Copy over the file creds.sample.json to, e.g., credsEU.json. Edit the file and adapt it to the region (us-south, eu-de, ...) and add your LogDNA service key as well as a valid API key. The LogDNA service key can be obtained in the LogDNA UI following these documented steps. An IBM Cloud API key can be created on this page or on the command line.
The trackAPIKeys.py tool is invoked with the name of the credentials file as parameter. Usage information is printed if no parameters is provided:
It returns a JSON document with information per individual key. The tool is discussed in the IBM Cloud blog post Improve Security: Track API Keys Using IAM and LogDNA. The post includes a screenshot with sample output.
See LICENSE for license information.
The tool is provided on a "as-is" basis and is un-supported. Use with care...
To contribute, please open a Pull Request.