Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Latest commit

 

History

History
35 lines (24 loc) · 1 KB

README.md

File metadata and controls

35 lines (24 loc) · 1 KB

GCP Unused Service Account Lister

Crawls your GCP Organization and returns service accounts that have not been used in the past 90 days based on GCP Recommender Service Account Insight findings.

Requirements

  • python 3.x
  • GCP Recommender API (enabled in your project)
    • To enable: gcloud services enable recommender.googleapis.com

Installation

# Clone the repo locally
git clone [email protected]:ScaleSec/gcp_sa_lister.git

# Configure virtual environment
python3 -m venv ./venv/
source ./venv/bin/activate

# Install packages
pip3 install -r requirements.txt

Execution

python3 saUnused.py

Results

The results will be in JSON format and include the service account email and project number.

Disclaimer

You need to have the Recommender service (API) enabled across your projects with insights preexisting. For directions on enabling the API visit the documentation.