Prisma Cloud コンピューティング: Google Cloud Registry のログインの問題
7448
Created On 11/18/19 18:29 PM - Last Modified 03/02/23 02:32 AM
Symptom
顧客は何を心配する必要がありますか?
イメージのプッシュまたはプルGCR最小限のパーマが必要です。
Defender イメージをレジストリにプッシュする際に問題が発生した場合は、次の手順に従ってください。
Environment
- SaaS
- 自己ホスト バージョン 21.04 以降
Cause
解決策のセクションを確認してください。
Resolution
ログイン:
gcloud beta auth application-default login --scopes=
https://www.googleapis.com/auth/devstorage.full_control、
[https://www.googleapis.com/auth/devstorage.read_write]
https://www.googleapis.com/auth/devstorage.full_control、
[https://www.googleapis.com/auth/devstorage.read_write]
アクセス トークンを取得します。
gcloud beta auth application-default print-access-token
スコープが正しいことを確認します。
curl https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=<TOKEN >
{
"issued_to": "7640850-6qr4p6g8ejuq83di341hur.apps.googleusercontent.com",
"オーディエンス": "7640850-6qr4p6g8ejuq83di341hur.apps.googleusercontent.com",
"スコープ": "https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/devstorage.read_write",
"expires_in": 355,
"access_type": "オフライン"
}
{
"issued_to": "7640850-6qr4p6g8ejuq83di341hur.apps.googleusercontent.com",
"オーディエンス": "7640850-6qr4p6g8ejuq83di341hur.apps.googleusercontent.com",
"スコープ": "https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/devstorage.read_write",
"expires_in": 355,
"access_type": "オフライン"
}
ドッカーログインを行います:
$ sudo docker login -u oauth2accesstoken -p "<TOKEN >" https://gcr.io
に画像をプッシュできるようになりましたGCRデーモン セットをデプロイします。
で作業するときGKE、デーモン セットをデプロイするには、kubectl がクラスターに接続されている必要があります。 インストールに進む前に、PROJECT_ID、Compute Engine ゾーンなどの gcloud のデフォルトが Cloud Shell に設定されていることを確認してください。
$ gcloud config set project PROJECT_ID
$ gcloud config set compute/zone europe-west1-d
$ gcloud config set container/cluster twistlock-demo
kubectl ツールのクラスター認証情報を取得します。
$ gcloud container clusters get-credentials twistlock-demo
デフォルトでは、認証情報は ~/.kube/config に保存されます。 設定は、次を実行して確認できます。
$ kubectl クラスター情報