|
1 | | -# Getting Started with GCP on Prowler Cloud/App |
| 1 | +# Getting Started With GCP on Prowler |
2 | 2 |
|
3 | | -Set up your GCP project to enable security scanning using Prowler Cloud/App. |
| 3 | +## Prowler App |
4 | 4 |
|
5 | | -## Requirements |
| 5 | +### Step 1: Get the GCP Project ID |
6 | 6 |
|
7 | | -To configure your GCP project, you’ll need: |
| 7 | +1. Go to the [GCP Console](https://console.cloud.google.com/) |
| 8 | +2. Locate the Project ID on the welcome screen |
8 | 9 |
|
9 | | -1. Get the `Project ID` |
10 | | -2. Access to Prowler Cloud/App |
11 | | -3. Configure authentication in GCP: |
| 10 | + |
12 | 11 |
|
13 | | - 3.1 Retrieve credentials from Google Cloud |
| 12 | +### Step 2: Access Prowler Cloud or Prowler App |
14 | 13 |
|
15 | | -4. Add the credentials to Prowler Cloud/App |
| 14 | +1. Navigate to [Prowler Cloud](https://cloud.prowler.com/) or launch [Prowler App](../prowler-app.md) |
| 15 | +2. Go to "Configuration" > "Cloud Providers" |
16 | 16 |
|
17 | | ---- |
| 17 | +  |
18 | 18 |
|
19 | | -## Step 1: Get the Project ID |
| 19 | +3. Click "Add Cloud Provider" |
20 | 20 |
|
21 | | -1. Go to the [GCP Console](https://console.cloud.google.com/) |
22 | | -2. Locate your Project ID on the welcome screen |
| 21 | +  |
23 | 22 |
|
24 | | - |
| 23 | +4. Select "Google Cloud Platform" |
25 | 24 |
|
26 | | ---- |
| 25 | +  |
27 | 26 |
|
28 | | -## Step 2: Access Prowler Cloud/App |
| 27 | +5. Add the Project ID and optionally provide a provider alias, then click "Next" |
29 | 28 |
|
30 | | -1. Go to [Prowler Cloud](https://cloud.prowler.com/) or launch [Prowler App](../prowler-app.md) |
31 | | -2. Navigate to `Configuration` > `Cloud Providers` |
| 29 | +  |
32 | 30 |
|
33 | | -  |
| 31 | +### Step 3: Set Up GCP Authentication |
34 | 32 |
|
35 | | -3. Click `Add Cloud Provider` |
| 33 | +Choose the preferred authentication mode before proceeding: |
36 | 34 |
|
37 | | -  |
| 35 | +**User Credentials (Application Default Credentials)** |
38 | 36 |
|
39 | | -4. Select `Google Cloud Platform` |
| 37 | +* Quick scan as current user |
| 38 | +* Uses Google Cloud CLI authentication |
| 39 | +* Credentials may time out |
40 | 40 |
|
41 | | -  |
| 41 | +**Service Account Key File** |
42 | 42 |
|
43 | | -5. Add the Project ID and optionally provide a provider alias, then click `Next` |
| 43 | +* Authenticates as a service identity |
| 44 | +* Stable and auditable |
| 45 | +* Recommended for production |
44 | 46 |
|
45 | | -  |
| 47 | +For detailed instructions on how to set up authentication, see [Authentication](./authentication.md). |
46 | 48 |
|
47 | | ---- |
| 49 | +6. Once credentials are configured, return to Prowler App and enter the required values: |
48 | 50 |
|
49 | | -## Step 3: Configure Authentication in GCP |
| 51 | + For "Service Account Key": |
50 | 52 |
|
51 | | -### Retrieve Credentials from Google Cloud |
| 53 | + - `Service Account Key JSON` |
52 | 54 |
|
53 | | -1. In the [GCP Console](https://console.cloud.google.com/), click on `Activate Cloud Shell` |
| 55 | + For "Application Default Credentials": |
54 | 56 |
|
55 | | -  |
| 57 | + - `client_id` |
| 58 | + - `client_secret` |
| 59 | + - `refresh_token` |
56 | 60 |
|
57 | | -2. Click `Authorize Cloud Shell` |
| 61 | +  |
| 62 | + |
| 63 | +7. Click "Next", then "Launch Scan" |
58 | 64 |
|
59 | | -  |
| 65 | +  |
60 | 66 |
|
61 | | -3. Run the following command: |
| 67 | +--- |
62 | 68 |
|
63 | | - ```bash |
64 | | - gcloud auth application-default login |
65 | | - ``` |
| 69 | +## Prowler CLI |
66 | 70 |
|
67 | | - - Type `Y` when prompted |
| 71 | +### Credentials Lookup Order |
68 | 72 |
|
69 | | -  |
| 73 | +Prowler follows the same credential search process as [Google authentication libraries](https://cloud.google.com/docs/authentication/application-default-credentials#search_order), checking credentials in this order: |
70 | 74 |
|
71 | | -4. Open the authentication URL provided in a browser and select your Google account |
| 75 | +1. [`GOOGLE_APPLICATION_CREDENTIALS` environment variable](https://cloud.google.com/docs/authentication/application-default-credentials#GAC) |
| 76 | +2. [`CLOUDSDK_AUTH_ACCESS_TOKEN` + optional `GOOGLE_CLOUD_PROJECT`](https://cloud.google.com/sdk/gcloud/reference/auth/print-access-token) |
| 77 | +3. [User credentials set up by using the Google Cloud CLI](https://cloud.google.com/docs/authentication/application-default-credentials#personal) |
| 78 | +4. [Attached service account (e.g., Cloud Run, GCE, Cloud Functions)](https://cloud.google.com/docs/authentication/application-default-credentials#attached-sa) |
72 | 79 |
|
73 | | -  |
| 80 | +???+ note |
| 81 | + The credentials must belong to a user or service account with the necessary permissions. |
| 82 | + For detailed instructions on how to set the permissions, see [Authentication > Required Permissions](./authentication.md#required-permissions). |
74 | 83 |
|
75 | | -5. Follow the steps to obtain the authentication code |
| 84 | +???+ note |
| 85 | + Prowler will use the enabled Google Cloud APIs to get the information needed to perform the checks. |
76 | 86 |
|
77 | | -  |
| 87 | +### Configure GCP Credentials |
78 | 88 |
|
79 | | -6. Paste the authentication code back in Cloud Shell |
| 89 | +To authenticate with GCP, use one of the following methods: |
80 | 90 |
|
81 | | -  |
| 91 | +```console |
| 92 | +gcloud auth application-default login |
| 93 | +``` |
82 | 94 |
|
83 | | -7. Use `cat <file_name>` to view the temporary credentials file |
| 95 | +or set the credentials file path: |
84 | 96 |
|
85 | | -  |
| 97 | +```console |
| 98 | +export GOOGLE_APPLICATION_CREDENTIALS="/path/to/credentials.json" |
| 99 | +``` |
86 | 100 |
|
87 | | -8. Extract the following values for Prowler Cloud/App: |
| 101 | +These credentials must belong to a user or service account with the necessary permissions to perform security checks. |
88 | 102 |
|
89 | | - - `client_id` |
90 | | - - `client_secret` |
91 | | - - `refresh_token` |
| 103 | +For more authentication details, see the [Authentication](./authentication.md) page. |
92 | 104 |
|
93 | | -  |
| 105 | +### Project Specification |
94 | 106 |
|
95 | | ---- |
| 107 | +To scan specific projects, specify them with the following command: |
96 | 108 |
|
97 | | -## Step 4: Add Credentials to Prowler Cloud/App |
| 109 | +```console |
| 110 | +prowler gcp --project-ids <project-id-1> <project-id-2> |
| 111 | +``` |
98 | 112 |
|
99 | | -1. Go back to Prowler Cloud/App and enter the required credentials, then click `Next` |
| 113 | +### Service Account Impersonation |
100 | 114 |
|
101 | | -  |
| 115 | +For service account impersonation, use the `--impersonate-service-account` flag: |
102 | 116 |
|
103 | | -2. Click `Launch Scan` to begin scanning your GCP environment |
| 117 | +```console |
| 118 | +prowler gcp --impersonate-service-account <service-account-email> |
| 119 | +``` |
104 | 120 |
|
105 | | -  |
| 121 | +More details on authentication methods in the [Authentication](./authentication.md) page. |
0 commit comments