From 4ba1c0259f0386b0bb5325453615bf7eebcb2ffc Mon Sep 17 00:00:00 2001 From: Sergio Garcia Date: Wed, 27 Nov 2024 14:00:26 -0400 Subject: [PATCH] fix(gcp): use session credentials to check if API is active (#5935) --- prowler/providers/gcp/lib/service/service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prowler/providers/gcp/lib/service/service.py b/prowler/providers/gcp/lib/service/service.py index dbb7f226387..9763230153c 100644 --- a/prowler/providers/gcp/lib/service/service.py +++ b/prowler/providers/gcp/lib/service/service.py @@ -55,7 +55,9 @@ def __is_api_active__(self, audited_project_ids): project_ids = [] for project_id in audited_project_ids: try: - client = discovery.build("serviceusage", "v1") + client = discovery.build( + "serviceusage", "v1", credentials=self.credentials + ) request = client.services().get( name=f"projects/{project_id}/services/{self.service}.googleapis.com" )