我需要從本地提取 docker 影像。但是,我無權訪問 AWS 密鑰,無法對私有存盤庫執行此類操作。如何在沒有 AWS 身份驗證的情況下提取 ECR 影像?我注意到 ECR 公共存盤庫,但是,我仍然需要一定程度的限制來保護存盤庫內容。
uj5u.com熱心網友回復:
是的,您可以臨時進行身份驗證。正如檔案指出的那樣;
You can use temporary security credentials to make programmatic requests for AWS resources using the AWS CLI or AWS API (using the AWS SDKs). The temporary credentials provide the same permissions as long-term security credentials, such as IAM user credentials.
參考:https ://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html
此外,如果無法通過這種方式或任何其他方式成功驗證,您可以使用public registries registry policies。您可以通過ALLOW某些 IP/服務/用戶訪問您的注冊表。示例注冊表策略如下;
{
"Version": "2012-10-17",
"Id": "ECRPolicyId1",
"Statement": [
{
"Sid": "IPAllow",
"Effect": "Deny",
"Principal": "*",
"Action": "ecr:*",
"Condition": {
"NotIpAddress": {
"aws:SourceIp": [
1.2.3.4/32,
2.3.4.5/32
]
},
"IpAddress": {
"aws:SourceIp": "0.0.0.0/0"
}
}
}
]
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/437973.html
標籤:亚马逊网络服务
下一篇:外部開發人員訪問EC2服務器
