簡體   English   中英

谷歌雲 IAM 工作負載身份聯合與 azure 廣告“應用注冊”/“企業應用程序”

[英]google cloud IAM workload identity federation with azure ad 'app registration'/'enterprise applications'

我正在嘗試設置 Azure AD 'Enterprise Application' 以從 myapps.microsoft.com 訪問谷歌雲以獲取身份和訪問權限。

我按照https://cloud.google.com/iam/docs/configuring-workload-identity-federation#azure中的描述設置了工作負載身份聯合,但是身份驗證無法正常工作,並出現以下錯誤。

gcloud auth login --cred-file="/Users/pavan-mac/Downloads/clientLibraryConfig-aad-oidc.json"       

ERROR: gcloud crashed (TransportError): HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fiam.googleapis.com%2Fprojects%<removed>%2Flocations%2Fglobal%2FworkloadIdentityPools%2Faad-integration%2Fproviders%2Faad-oidc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7feb69c80a10>: Failed to establish a new connection: [Errno 60] Operation timed out'))

2個問題:

  1. 我懷疑問題出在屬性映射上。 使用 Azure AD OIDC 提供程序時指定屬性的理想配置是什么?
  2. 我希望能夠使用 GCP 中的工作負載聯合功能為 Azure AD 企業應用程序中的用戶/組分配 Google 雲中的映射角色(例如,所有者/編輯者/查看者角色)。 有人可以幫助我了解如何使用正確的屬性映射將 azure 廣告中的角色鏈接到 GCP 中的服務帳戶嗎?

由於您在 Azure 虛擬機之外使用 CLI,因此您無權訪問 Azure 托管標識。 這就是元數據服務器169.254.169.254//metadata/identity/oauth2/token錯誤的原因

Workload Identity Federation 的要求/選項之一是為您運行 Google Cloud CLI 的資源創建或分配托管身份。

准備外部身份提供者

要讓應用程序獲取 Azure AD 應用程序的訪問令牌,您可以使用托管身份

在此 Google 文檔中演示了一個技巧,需要您自己從 Azure 實例元數據服務獲取訪問令牌並將其粘貼到斷言中。 我沒有嘗試過這種技術,但這意味着每次令牌過期時,您都需要重復該過程。

curl \
  "http://169.254.169.254/metadata/identity/oauth2/token?resource=APP_ID_URI&api-version=2018-02-01" \
  -H "Metadata: true" | jq -r .access_token

從 Azure 實例元數據服務 (IMDS) 獲取訪問令牌

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM