https://github.com/dinvlad/find-gcp-keys
Find and report valid Google Service Account keys on a filesystem
https://github.com/dinvlad/find-gcp-keys
credential-storage credentials gcp google-cloud google-cloud-platform google-service-account leaked-secrets security service-account service-account-file service-accounts
Last synced: about 2 months ago
JSON representation
Find and report valid Google Service Account keys on a filesystem
- Host: GitHub
- URL: https://github.com/dinvlad/find-gcp-keys
- Owner: dinvlad
- License: bsd-3-clause
- Created: 2020-09-02T00:12:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-14T19:52:54.000Z (over 5 years ago)
- Last Synced: 2025-11-27T13:42:30.158Z (4 months ago)
- Topics: credential-storage, credentials, gcp, google-cloud, google-cloud-platform, google-service-account, leaked-secrets, security, service-account, service-account-file, service-accounts
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# find-gcp-keys
This tool finds and prints valid Google Service Account keys on your filesystem.
This is useful for keeping track of any unexpired/non-disabled keys you may have.
It does NOT require any special permissions,
or even to be authenticated with Google Cloud SDK.
## Requirements
Python 3.7+
## Installation
```
pip3 install find-gcp-keys
```
## Usage
### Command line
```
find-gcp-keys [--no-validate/-n] [--file-pattern/-p ]
```
Note that by default, the CLI only searches for the JSON key files
matching a particular pattern (`-.json`). You can
override this behavior, e.g. to search for _all_ JSON files:
```
find-gcp-keys -p '.*\.json'
```
### Library:
```py
from find_gcp_keys import find_key_paths, find_valid_keys, is_valid_key
...
# determine if a given file is a valid key
if is_valid_key(file_path):
...
# recursively search for valid keys
for file_path in find_valid_keys(dir_path):
...
# recursively search for possible keys, but don't validate them
for file_path in find_key_paths(dir_path):
...
```