Gemini for Google Cloud は、あらゆるスキルレベルのユーザーを必要に応じて支援する、常時稼働の AI コラボレーターです。このラボでは、Security Command Center の Gemini 機能を使用して、Google Cloud 環境内のセキュリティに関する構成ミスを特定し、修復する方法を学習します。
注: Duet AI は、Google の次世代モデルである Gemini に名称変更されました。このラボは、この変更を反映して更新されたものです。ラボの手順を実施する際に、ユーザー インターフェースやドキュメントで Duet AI に言及されていた場合は、Gemini と同等であると見なしてください。
注: Gemini は初期段階のテクノロジーであるため、もっともらしく見える出力でも事実に反する場合があります。Gemini からのすべての出力は、使用する前に検証することをおすすめします。詳細については、Gemini for Google Cloud と責任ある AI をご覧ください。
gcloud container clusters create test --region={{{project_0.default_region|lab region}}} --num-nodes=1
これには数分かかることがあります。完了すると、次のような結果が返されます。
Creating cluster test in {{{project_0.default_region|lab region}}}... Cluster is being health-checked (master is healthy)...done.
Created [https://container.googleapis.com/v1/projects/agmsb-gke-lab/zones/us-central1/clusters/test].
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/us-central1/test?project=agmsb-gke-lab
kubeconfig entry generated for test.
NAME: test
LOCATION: {{{project_0.default_region|lab region}}}
MASTER_VERSION: 1.27.3-gke.100
MASTER_IP: 34.66.224.143
MACHINE_TYPE: e2-medium
NODE_VERSION: 1.27.3-gke.100
NUM_NODES: 3
STATUS: RUNNING
ここで、ウェブアプリのコードを含むリポジトリのクローンを作成します。
git clone https://github.com/GoogleCloudPlatform/microservices-demo && cd microservices-demo
GKE クラスタで e コマース アプリを実行できるようになったので、セキュリティ ポスチャーを改善できる分野を Gemini を使用して特定します。
Google Cloud コンソールのタブに戻ります。
Google Cloud コンソール ページを更新します。
Cloud Shell ペインを最小化します。
Google Cloud コンソールのツールバーの右上にある Gemini アイコン()をクリックします。
[チャットを開始] をクリックします。
次のプロンプトを入力します。
What services in Google Cloud can help me identify areas to improve security for a set of microservices running in a GKE cluster?
Gemini から、次のような回答が返されます。
There are a number of services in Google Cloud that can help you identify areas to improve security for a set of microservices running in a GKE cluster. These include:
Security Command Center can help you identify and prioritize security risks across your Google Cloud environment, including GKE clusters.
Cloud Asset Inventory can help you track and manage your Google Cloud resources, including GKE clusters.
Cloud Logging can help you collect and analyze logs from your GKE clusters.
Cloud Monitoring can help you monitor the performance and health of your GKE clusters.
These are just a few of the many services in Google Cloud that can help you improve the security of your microservices. By using these services, you can help protect your data from unauthorized access, and you can also help improve your security posture over time.
このシナリオでは、Security Command Center を使用します。
ナビゲーション メニューを開き、[セキュリティ] > [リスクの概要] を選択します。
脆弱性について説明しているビジュアリゼーションが複数あるため、Security Command Center で何が脆弱性として分類されているかをすぐに理解できるよう Gemini に尋ねます。
次のプロンプトを入力します。
How does Security Command Center define a vulnerability?
Gemini から、次のような回答が返されます。
Security Command Center defines a vulnerability as a flaw or weakness in software programs that an attacker could use to gain access to or otherwise compromise your Google Cloud environment.
How do control plane authorized networks work in GKE?
Gemini から、次のような回答が返されます。
Control plane authorized networks allow you to restrict access to the control plane of your GKE cluster. By default, the control plane is accessible from any address. However, you can add one or more authorized networks to restrict access to only those networks.
To add an authorized network, go to the Google Kubernetes Engine page in the Google Cloud console. Click the name of the cluster you want to modify. Under Networking, in the Control plane authorized networks field, click edit Edit control plane authorized networks...