Mulai 17 Juni 2024, Cloud Source Repositories tidak tersedia untuk pelanggan baru. Jika organisasi Anda belum pernah menggunakan Cloud Source Repositories, Anda tidak dapat mengaktifkan API atau menggunakan Cloud Source Repositories. Project baru yang tidak terhubung ke organisasi tidak dapat mengaktifkan Cloud Source Repositories API. Organisasi yang telah menggunakan Repositori Sumber Cloud sebelum 17 Juni 2024 tidak akan terpengaruh oleh perubahan ini.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Anda tidak boleh menyimpan kunci keamanan dalam sistem kontrol versi.
Cloud Source Repositories dapat membantu Anda mencegah pengguna menyimpan kunci keamanan di repositoriGoogle Cloud . Cloud Source Repositories
dapat memeriksa jenis kunci keamanan berikut:
Google Cloud kredensial akun layanan (format JSON)
Kunci pribadi berenkode PEM (termasuk RSA, DSA, dan PGP)
Fitur pemeriksaan ini tersedia untuk semua repositori tanpa biaya.
Cara kerja fitur pemeriksaan kunci keamanan
Saat pengguna menjalankan perintah git push, fitur pemeriksaan akan mencari data yang mungkin berupa kunci keamanan. Jika kecocokan ditemukan, fitur ini akan memblokir git
notifikasi push dan memberi tahu pengguna apa yang ditemukan dan di mana. Contoh:
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`.
Sebelum memulai
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-11 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)"]]