Seit dem 17. Juni 2024 ist Cloud Source Repositories für Neukunden nicht mehr verfügbar. Wenn Ihre Organisation noch nicht Cloud Source Repositories verwendet hat, können Sie die API nicht aktivieren oder Cloud Source Repositories verwenden. Für neue Projekte, die nicht mit einer Organisation verbunden sind, kann die Cloud Source Repositories API nicht aktiviert werden. Organisationen, die Cloud Source Repositories vor dem 17. Juni 2024 verwendet haben, sind von dieser Änderung nicht betroffen.
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Sie sollten Sicherheitsschlüssel keinesfalls in einem Versionskontrollsystem speichern.
Mit Cloud Source Repositories können Sie verhindern, dass Nutzer Sicherheitsschlüssel in einemGoogle Cloud -Repository speichern. Cloud Source Repositories kann nach folgenden Arten von Sicherheitsschlüsseln suchen:
Google Cloud Anmeldedaten für das Dienstkonto (JSON-Format)
PEM-codierte private Schlüssel (einschließlich RSA, DSA und PGP)
Diese Suchfunktion ist für alle Repositories kostenlos verfügbar.
So funktioniert das Feature zur Suche nach Sicherheitsschlüsseln
Wenn ein Nutzer den Befehl git push ausführt, sucht dieses Feature nach Daten, die möglicherweise ein Sicherheitsschlüssel sind. Wird eine Übereinstimmung gefunden, sperrt das Feature die Push-Übertragung von git und benachrichtigt die Nutzer, was wo gefunden wurde. Beispiel:
The push has been rejected because we detect that it contains a private key.
Please check the following commands and confirm that it's intentional:
git show [COMMIT]
You can use `git rev-list --objects --all` to find the files.
To push these files, please run `git push -o nokeycheck`.
Hinweise
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-03 (UTC)."],[],[],null,["# Detecting security keys\n\nYou should never store security keys in a version-control system.\nCloud Source Repositories can help you prevent users from storing security keys in a\nGoogle Cloud repository. Cloud Source Repositories\ncan check for the following types of security keys:\n\n- Google Cloud service account credentials (JSON format)\n- PEM-encoded private keys (including RSA, DSA, and PGP)\n\nThis checking feature is available for all repositories at no charge.\n\nHow the security-key checking feature works\n-------------------------------------------\n\nWhen a user executes a `git push` command, the checking feature looks for data\nthat might be a security key. If a match is found, the feature blocks the `git`\npush and notifies users what was found and where. For example: \n\n```\nThe push has been rejected because we detect that it contains a private key.\nPlease check the following commands and confirm that it's intentional:\n\ngit show [COMMIT]\n\nYou can use `git rev-list --objects --all` to find the files.\n\nTo push these files, please run `git push -o nokeycheck`.\n```\n| **Note:** To help store security keys more securely, consider using [Cloud Key Management Service](/kms/docs/store-secrets).\n\nBefore you begin\n----------------\n\n\nIn the Google Cloud console, on the project selector page,\nselect or create a Google Cloud project.\n| **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n[Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDisable security key detection\n------------------------------\n\nTo disable security key detection, use the following `gcloud` command: \n\n gcloud init\n gcloud source project-configs update --disable-pushblock\n\nEnable security key detection\n-----------------------------\n\nTo enable private key detection, use the following `gcloud` command: \n\n gcloud init\n gcloud source project-configs update --enable-pushblock\n\nOverride security key detection\n-------------------------------\n\nTo override the security key detection feature, use the following `git`\ncommand: \n\n git push -o nokeycheck\n\nWhat's next\n-----------\n\nAfter you set up a Google Cloud repository, you might find the following\ntopics helpful:\n\n- [Controlling access to repositories](/source-repositories/docs/configure-access-control)\n- [Using the source browser](/source-repositories/docs/using-source-browser)"]]