> For the complete documentation index, see [llms.txt](https://docs.stoik.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoik.io/help/help-de/praventionstools/cloud-scan/gcp.md).

# Einrichtung: GCP

Gewähren Sie dem Cloud-Scan schreibgeschützten Zugriff auf ein Google Cloud-Projekt, indem Sie ein Dienstkonto erstellen, das Stoïk verwenden kann.

## Voraussetzungen

* Für diese Bereitstellung ist ein Administratorkonto erforderlich.
* Für die laufende Überwachung und Behebung von Sicherheitslücken ist ein technischer Berater erforderlich.
* Eine Person erledigt die gesamte Einrichtung von Anfang bis Ende: ein Stoïk-Protect-Benutzer mit Berechtigung zum Bearbeiten von Präventionstools, der außerdem Administrator des GCP-Projekts ist.

## Einrichtung

{% stepper %}
{% step %}

### Google Cloud Platform auswählen

Gehen Sie zu `Cloud Scan` > `Einstellungen`, klicken Sie auf `Neuer Anbieter`, und wählen Sie `Google Cloud Platform`.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FDw2b46xxHQFAG4OCkigt%2FScreenshot%202026-04-07%20at%2018.57.56.png?alt=media&amp;token=72ccef3f-3cb8-4f54-b98b-6c748f5e3e92" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Öffnen Sie Ihre Cloud Console

Gehen Sie zum [Google Cloud Console](https://console.cloud.google.com/) und melden Sie sich mit Ihrem Administratorkonto an.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FUTcz9AktGTD9Cczz9KPB%2Fcloud-scan-google-cloud-console.png?alt=media&amp;token=4f6d18c5-3eec-4040-9d46-12ae365c6dd7" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Öffnen Sie die API-Bibliothek

Gehen Sie zu `APIs & Dienste` > `Bibliothek` im linken Menü.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FH7VRpz11JW2ppKogPQ4y%2Fcloud-scan-console-api-services-library.png?alt=media&amp;token=e0153ae0-5695-4746-b3bc-da256ee2d1bb" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Finden Sie die Cloud Resource Manager API

Suchen Sie nach `Cloud Resource Manager API` und klicken Sie darauf.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2F4f8FTY2S563Lm31xK7Np%2Fcloud-scan-cloud-resource-manager-api.png?alt=media&amp;token=0aafc7a8-1d1d-40fc-b08d-b6eb064cb3d1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Aktivieren Sie die API

Klicken Sie auf `Aktivieren`.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FqHVrHGykLoST9s0PycrJ%2Fcloud-scan-resource-manager-api-enable.png?alt=media&amp;token=20c69a92-2c79-4568-a5c9-86c5806db366" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Öffnen Sie die Dienstkonten

Gehen Sie zu `IAM & Admin` > `Dienstkonten` im linken Menü.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FskzJLLEd9DokDw9pHIJF%2Fcloud-scan-iam-admin-service-accounts.png?alt=media&amp;token=c83333e7-9f3c-4fc9-9678-ff91daec5658" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Erstellen Sie das Dienstkonto

Klicken Sie auf `Dienstkonto erstellen`.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FBTbAgGb6fSK20BVXuuSz%2Fcloud-scan-create-service-account.png?alt=media&amp;token=168d4f6e-46ff-4420-a503-9002c33b3f2a" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Benennen Sie das Dienstkonto

Geben Sie `stoik-scanner` als Dienstkontonamen ein und klicken Sie dann auf `Erstellen und fortfahren`.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2F6whuJGKh4PNGgftwZqLV%2Fcloud-scan-create-service-account-name.png?alt=media&amp;token=d00f2170-bd90-455f-a9f3-94da30e44b62" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Rollen zuweisen

Fügen Sie die folgenden 3 Rollen hinzu: `Betrachter`, `Sicherheitsprüfer`, `Stackdriver-Konten-Betrachter`.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FCChwue8tVQSHKCpMIlCe%2Fcloud-scan-create-service-account-permissions.png?alt=media&amp;token=26b9ac91-e109-412d-8cd8-37548092f78b" alt=""><figcaption></figcaption></figure>

Lassen Sie Schritt 3 leer und klicken Sie auf `Fertig`.
{% endstep %}

{% step %}

### Öffnen Sie das Dienstkonto

Klicken Sie auf das soeben erstellte Dienstkonto und dann auf `Berechtigte mit Zugriff`.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2Ft4z2qlijQGNNDA4ISbLi%2Fcloud-scan-open-service-account.png?alt=media&amp;token=94f014b7-d982-4152-bfd9-8d3af5436de8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FiCKjOoUMiZUKJDD9lcDz%2Fcloud-scan-service-account-grant-access.png?alt=media&amp;token=362b9a8b-d905-4d37-ad5f-b8017951ebe0" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Zugriff gewähren

1. Wählen Sie Ihr Dienstkonto aus und klicken Sie auf `Zugriff gewähren`.
2. Geben Sie `stoik-scanner@stoik-gcp-scan-prod.iam.gserviceaccount.com` im `Neuen Berechtigten` Feld.
3. Weisen Sie die `Rolle "Service Account Token Creator"` zu und klicken Sie dann auf `Speichern`.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FtA2nkzIqHpx65ok06gqr%2Fcloud-scan-service-account-add-principals.png?alt=media&amp;token=f1c62da6-496e-4804-9afc-161d71df3c2b" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Kopieren Sie die E-Mail-Adresse des Dienstkontos

1. Klicken Sie auf `Details` in GCP.
2. Kopieren Sie die E-Mail-Adresse des erstellten Dienstkontos.

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2FBbOUrFQXlScFI32CxLgR%2Fcloud-scan-service-account-copy-email.png?alt=media&amp;token=4fa17999-bb77-4764-bfff-99c2a20735f6" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Einrichtung abschließen

<figure><img src="https://243136008-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaDGGQ49Oui29Ft0kJjSm%2Fuploads%2F6yEDTO51V6cbdB8McEz4%2FScreenshot%202026-04-07%20at%2018.59.05.png?alt=media&amp;token=1568ad28-5e33-4283-8b3c-d415d7606fce" alt=""><figcaption></figcaption></figure>

1. Fügen Sie die E-Mail-Adresse des Dienstkontos in das `E-Mail-Adresse des Dienstkontos` Feld in Stoïk Protect ein.
2. Klicken Sie auf `Einrichtung abschließen`.

{% hint style="info" %}
Aktualisieren Sie bei Bedarf die Stoïk Protect-Seite.
{% endhint %}
{% endstep %}
{% endstepper %}

## Zu scannende Projekte

Richten Sie die Projekte ein, die Ihre Server und Datenbanken enthalten: Ein nur für Stoïk erstelltes Projekt ist leer, daher gibt es nichts zu scannen. Die API muss jeweils projektweise aktiviert werden.

## Fehlerbehebung

<details>

<summary>Die Einrichtung ist fehlgeschlagen, dann hat sie beim erneuten Versuch funktioniert</summary>

Neue Rollen, Berechtigungen und APIs benötigen einige Minuten, um wirksam zu werden. Warten Sie 5 Minuten und klicken Sie erneut.

</details>

<details>

<summary>"role/stackdriver.accounts.viewer muss zugewiesen werden"</summary>

`Stackdriver-Betrachter` und `Stackdriver-Konten-Betrachter` sind zwei verschiedene Rollen. Das Dienstkonto benötigt genau `Betrachter`, `Sicherheitsprüfer` und `Stackdriver-Konten-Betrachter`.

</details>

<details>

<summary>"gehören nicht zu einem zulässigen Kunden"</summary>

Ihre Organisationsrichtlinie **Domain-Restricted Sharing** (`iam.allowedPolicyMemberDomains`) blockiert das Stoïk-Dienstkonto. Ihr Administrator fügt die Kunden-ID von Stoïk hinzu `C01isw1kw` zu den zulässigen Werten in `IAM & Admin` > `Organisationsrichtlinien`. Dafür ist die `Rolle des Organisationsrichtlinien-Administrators` auf Organisationsebene erforderlich: Eigentümer des Projekts zu sein reicht nicht aus.

</details>

<details>

<summary>"Integration mit GCP fehlgeschlagen" / getAccessToken verweigert</summary>

Zwei übliche Ursachen:

* Die Cloud Resource Manager API ist nicht aktiviert oder wurde erst vor wenigen Minuten aktiviert.
* `stoik-scanner@stoik-gcp-scan-prod.iam.gserviceaccount.com` hat die `Rolle "Service Account Token Creator"` Rolle für Ihr Dienstkonto nicht erhalten.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stoik.io/help/help-de/praventionstools/cloud-scan/gcp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
