Skip to content

Commit

Permalink
chore(gcp): print inactive GCP APIs (#2987)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCloudSec authored Oct 31, 2023
1 parent a994553 commit 082390a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions prowler/providers/gcp/lib/service/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import google_auth_httplib2
import httplib2
from colorama import Fore, Style
from googleapiclient import discovery

from prowler.lib.logger import logger
Expand Down Expand Up @@ -57,8 +58,8 @@ def __is_api_active__(self, audited_project_ids):
if response.get("state") != "DISABLED":
project_ids.append(project_id)
else:
logger.error(
f"{self.service} API has not been used in project {project_id} before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/dataproc.googleapis.com/overview?project={project_id} then retry."
print(
f"\n{Fore.YELLOW}{self.service} API {Style.RESET_ALL}has not been used in project {project_id} before or it is disabled.\nEnable it by visiting https://console.developers.google.com/apis/api/dataproc.googleapis.com/overview?project={project_id} then retry."
)
except Exception as error:
logger.error(
Expand Down

0 comments on commit 082390a

Please sign in to comment.