Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
creds.sample.json
trackAPIKeys.py

README.md

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.

Setup

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.

Usage

The trackAPIKeys.py tool is invoked with the name of the credentials file as parameter. Usage information is printed if no parameters is provided:

./trackAPIKeys.py credsEU.json

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.

License

See LICENSE for license information.

The tool is provided on a "as-is" basis and is un-supported. Use with care...

Contribute

To contribute, please open a Pull Request.

You can’t perform that action at this time.