Source controller support for Instance Metadata Service v2 (IMDSv2) on AWS
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Issue đề cập đến source-controller và thư viện minio-go nhưng không có tệp hoặc bài kiểm thử nào trong repository. Hãy bắt đầu bằng cách lần theo thiết lập thông tin xác thực AWS cho S3 Bucket source và các yêu cầu IMDS, sau đó xác minh reconciliation với các instance yêu cầu IMDSv2 và xác nhận rằng các yêu cầu được xác thực bằng token loại bỏ lỗi 401.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I get the following error message in source-controller when Flux is configured to use S3 bucket source,:
{
"level": "error",
"ts": "2022-06-03T13:29:32.250Z",
"logger": "controller.bucket",
"msg": "Reconciler error",
"reconciler group": "source.toolkit.fluxcd.io",
"reconciler kind": "Bucket",
"name": "deploy-bucket",
"namespace": "flux-system",
"error": "failed to confirm existence of 'retracted-flux-1ejashffo6o0p' bucket: 401 Unauthorized"
}
I have created the bucket source with the following command:
flux create source bucket deploy-bucket \
--bucket-name=retracted-flux-1ejashffo6o0p \
--provider=aws \
--endpoint=s3.amazonaws.com \
--region=eu-central-1 \
--interval=5m
.. and receive the following error message:
✚ generating Bucket source
► applying Bucket source
✔ Bucket source created
◎ waiting for Bucket source reconciliation
✗ failed to confirm existence of 'retracted-flux-1ejashffo6o0p' bucket: 401 Unauthorized
It appears that minio-go library uses Instance Metadata Service (IMDS) at 169.254.169.254 to create temporary credentials to access the S3 bucket (from captured traffic):
GET /latest/meta-data/iam/security-credentials/ HTTP/1.1
Host: 169.254.169.254
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip
This is not permitted, because my configuration requires Instance Metadata Service v2 (IMDSv2) since doing so avoids some vulnerabilities:
HTTP/1.1 401 Unauthorized
Content-Length: 0
Date: Fri, 03 Jun 2022 13:29:32 GMT
Server: EC2ws
Connection: close
Content-Type: text/plain
The fix would be to use Instance Metadata Service v2 (IMDSv2) compatible client with the minio-go library. This adds a session token to the requests.
I was able to workaround by creating an IAM user with an access key, then creating the source with--access-key and --secret-key args.
I am running Flux v0.30.2 on EKS with the Kubernetes version v1.21. I have created the IAM policy to access the bucket as instructed by documentation. Instances receive this policy from the instance profile. The access works when tested with AWS CLI aws s3 ls command.
Resources:
- AWS: Use IMDSv2
- aws/containers-roadmap issue EKS: Support for IMDSv2 #930
- Ngôn ngữ chính
- Go
- Star
- 283
- Fork
- 252
- Merge trung bình
- 1 giờ 6 phút
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fluxcd/source-controller
-
area/docs good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
fluxcd/source-controller#666 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/oci area/security enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
fluxcd/source-controller#2167 · 4 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/git bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
fluxcd/source-controller#2165 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fluxcd/source-controller#2150 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
GitRepository `.spec.ref.commit` + `.spec.ref.branch` does not shallow clone, contrary to the docsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
fluxcd/source-controller#2146 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của fluxcd/source-controller
Issue tương tự
-
enhancement low priority
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
eugenioenko/ttt#674 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Remove obsolete ipAllocationPolicy field from containernodepool-subnetworkref test dependencyĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
GoogleCloudPlatform/k8s-config-connector#13462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
vavallee/bindery#2793 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày