google / gcp_scanner

A comprehensive scanner for Google Cloud
Apache License 2.0
305 stars 94 forks source link

BUG: `Trying {candidate_service_account}` gets logged directly instead of candidate_service_account #103

Closed peb-peb closed 1 year ago

peb-peb commented 1 year ago

Affected Component

Describe the bug

During Scanning resources with latest codebase, I got the following output at the end:

2023-03-15 11:49:28 - INFO - Retrieving credentials from /home/peb/Downloads/sa_keys/qwiklabs-gcp-02-f08fbae4db62-d34106e8dd27.json
...
...
2023-03-15 11:52:14 - INFO - Retrieving cloud source repositories qwiklabs-gcp-02-fa95c3a79f7c
2023-03-15 11:52:17 - INFO - Trying {candidate_service_account}
2023-03-15 11:52:17 - INFO - Trying {candidate_service_account}
2023-03-15 11:52:17 - INFO - Trying {candidate_service_account}
2023-03-15 11:52:17 - INFO - Trying {candidate_service_account}
2023-03-15 11:52:17 - INFO - Trying {candidate_service_account}
2023-03-15 11:52:17 - INFO - Trying {candidate_service_account}
2023-03-15 11:52:17 - INFO - Trying {candidate_service_account}
2023-03-15 11:52:17 - INFO - Trying {candidate_service_account}
2023-03-15 11:52:17 - INFO - Trying {candidate_service_account}
2023-03-15 11:52:17 - INFO - Saving results for qwiklabs-gcp-02-fa95c3a79f7c into the file

To Reproduce

Steps to reproduce the behavior:

  1. Run the command gcp-scanner -o output -k /home/peb/Downloads/sa_keys -l INFO

Expected behavior

2023-03-15 12:03:27 - INFO - Trying qwiklabs-gcp-02-fa95c3a79f7c@qwiklabs-gcp-02-fa95c3a79f7c.iam.gserviceaccount.com should be logged

Current behavior

Trying {candidate_service_account} gets logged

Screenshots

image