將 ECR 映像提取至您的 AWS 帳戶 - Amazon Athena

將 ECR 映像提取至您的 AWS 帳戶

Athena Federation Connector Lambda 函式會使用存放在 Athena 受管 Amazon ECR 儲存庫中的容器映像。若要在這些容器映像上執行安全掃描,您必須先將其複製到帳戶中的 Amazon ECR 儲存庫。本節提供如何將映像複製到您的儲存庫,並設定 Lambda 函式以使用映像的逐步說明。

必要條件

  • Athena Federation Connector – 該連接器可以透過任何來源建立,前提是其使用了容器映像。

    注意

    若要驗證映像部署,請檢查 Athena Federation Connector Lambda 中的映像索引標籤

  • Docker 已安裝且在執行中

  • AWS CLI 已安裝

  • 具有適當提取許可的帳戶憑證

如何傳輸映像

  1. 從 Athena Federation Connector Lambda 找到映像 URI

    account_id_1.dkr.ecr.us-east-1.amazonaws.com/athena-federation-repository:2025.15.1
  2. 為 Athena 受管帳戶產生 Docker 身分驗證權杖:

    aws ecr get-login-password --region regionID | docker login --username AWS --password-stdin athena-managed-registry

    其中:

    • regionID 是您的部署區域 (例如 us-east-1)

    • athena-managed-registry 是映像 URI 的登錄檔部分 (例如 account_id_1.dkr.ecr.us-east-1.amazonaws.com)

  3. 從 Athena 受管帳戶提取映像:

    docker pull athenaImageURI
  4. 向您的登錄檔驗證 Docker:

    aws ecr get-login-password --region regionID | docker login --username AWS --password-stdin customer-registry

    其中 customer-registry 是您的 ECR 登錄檔 (例如 account_id_2.dkr.ecr.us-east-1.amazonaws.com)

  5. 為您的儲存庫標記提取的映像:

    docker tag athenaImageURI yourImageURI
  6. 將映像推送到您的儲存庫:

    docker push yourImageURI
  7. 更新您的 Athena Federation Connector:

    1. 導覽至您的 Lambda 函式

    2. 選取部署新映像

    3. 輸入您的新映像 URI

    Athena 聯合連接器映像現在位於您的帳戶中,可讓您在映像上執行 CVE 掃描。