Skip to content

Commit

Permalink
fix: logging fixed
Browse files Browse the repository at this point in the history
`candidate_service_account` gets logged correctly now
  • Loading branch information
peb-peb authored and mshudrak committed Mar 15, 2023
1 parent da6113d commit 6c410ae
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gcp_scanner/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def crawl_loop(initial_sa_tuples: List[Tuple[str, Credentials, List[str]]],
iam_policy)

for candidate_service_account in project_service_accounts:
logging.info('Trying {candidate_service_account}')
logging.info(f'Trying {candidate_service_account}')
if not candidate_service_account.startswith('serviceAccount'):
continue
try:
Expand All @@ -257,8 +257,7 @@ def crawl_loop(initial_sa_tuples: List[Tuple[str, Credentials, List[str]]],
(candidate_service_account, creds_impersonated, updated_chain))
project_result['service_account_edges'].append(
candidate_service_account)
logging.info('Successfully impersonated {candidate_service_account}'
'using {sa_name}')
logging.info(f'Successfully impersonated {candidate_service_account} using {sa_name}')
except Exception:
logging.error('Failed to get token for %s',
candidate_service_account)
Expand Down

0 comments on commit 6c410ae

Please sign in to comment.