Mengonfigurasi pengelolaan siklus proses untuk workload terkelola

Dokumen ini menunjukkan cara mengonfigurasi pengelolaan siklus proses sertifikat untuk workload terkelola seperti Compute Engine dan Google Kubernetes Engine (GKE), menggunakan Certificate Manager (generasi ke-2). Anda dapat mengotomatiskan penerbitan dan perpanjangan sertifikat dengan menautkan workload identity pool terkelola ke pool Certificate Authority Service menggunakan konfigurasi penerbitan sertifikat. Hal ini membantu mencegah pemadaman layanan yang disebabkan oleh sertifikat yang habis masa berlakunya.

Cara kerja identitas workload terkelola

Workload identity terkelola memberi workload Compute Engine dan GKE Anda identitas yang diattestasi, beserta sertifikat dan trust anchor yang digunakan workload untuk saling mengautentikasi melalui mutual TLS (mTLS). Workload identity terkelola dikelompokkan ke dalam workload identity pool, yang bertindak sebagai batas kepercayaan untuk identitas di dalamnya.

Saat Anda menautkan workload identity pool ke pool CA Service, Google Cloud akan otomatis menerbitkan dan memperpanjang sertifikat untuk workload Anda. Otomatisasi ini menghilangkan pengelolaan kredensial manual dan mencegah pemadaman layanan.

Sebelum memulai

  1. Login ke akun Google Cloud Anda. Jika Anda baru menggunakan Google Cloud, buat akun untuk mengevaluasi performa produk kami dalam skenario dunia nyata. Pelanggan baru juga mendapatkan kredit gratis senilai $300 untuk menjalankan, menguji, dan men-deploy workload.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  4. Verify that billing is enabled for your Google Cloud project.

  5. Enable the Compute Engine, Certificate Manager, Certificate Authority Service APIs, if any are not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  8. Verify that billing is enabled for your Google Cloud project.

  9. Enable the Compute Engine, Certificate Manager, Certificate Authority Service APIs, if any are not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

  10. Pastikan Anda sudah memiliki workload identity pool dengan identitas workload terkelola. Untuk mengetahui informasi selengkapnya, lihat Mengonfigurasi autentikasi workload identity terkelola untuk Compute Engine atau Mengonfigurasi autentikasi workload identity terkelola untuk GKE.
  11. Pastikan Anda sudah memiliki pool CA Service yang dapat menerbitkan sertifikat ke workload Anda. Untuk mengetahui informasi selengkapnya, lihat Membuat kumpulan CA.

Peran yang diperlukan

Untuk mendapatkan izin yang Anda perlukan guna mengonfigurasi pengelolaan siklus proses, minta administrator untuk memberi Anda peran IAM berikut pada project Anda:

Untuk mengetahui informasi selengkapnya tentang pemberian peran, lihat Mengelola akses ke project, folder, dan organisasi.

Anda mungkin juga bisa mendapatkan izin yang diperlukan melalui peran khusus atau peran bawaan lainnya.

Mengonfigurasi siklus proses untuk workload terkelola

Konfigurasikan workload identity pool terkelola untuk menentukan cara workload terkait menerima dan memperpanjang sertifikat dari pool CA Service yang ada.

  1. Di konsol Google Cloud , buka halaman Certificate Manager (2nd gen).

    Buka Certificate Manager (generasi ke-2)

  2. Di panel navigasi, klik Manage Lifecycle.
  3. Pilih tab Managed Workload Identity.
  4. Temukan workload identity pool yang ingin Anda konfigurasi, lalu klik Configure lifecycle management.
  5. Pilih Region dan CA pool untuk region tersebut.
  6. Di kolom Certificate lifetime, tentukan validitas sertifikat yang diterbitkan. Nilainya harus antara 21 dan 30 hari.
  7. Tetapkan Rotation window ke nilai antara 50 dan 80. Ini adalah persentase masa berlaku sertifikat yang memicu perpanjangan.
  8. Di kolom Key algorithm, pilih algoritma enkripsi yang akan digunakan untuk membuat kunci pribadi.
  9. Klik Update.

Langkah berikutnya