Containers always run as root: image USER is ignored and there is no runAsUser

Đang mở
#3,245 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 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
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, go
Lĩnh vực
backend, infrastructure

Hướng nghiên cứu

The report names Container API securityContext and image layer unpacking, but no source files or tests. Start by locating container creation, runtime user and group handling, and the image layer extraction path; reproduce with an image declaring USER and the reported postgres or vault cases. Done means image USER is honored, runAsUser and runAsGroup are supported, and image layer ownership is preserved.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area/api area/gvisor area/microVM area/node area/security kind/feature

On v0.6.0 an image with USER redpanda runs as uid 0 in an actor, on both gVisor and microVM. The Container API has no runAsUser or runAsGroup.

Images whose entrypoint drops to a non-root user show more problems:

  • gVisor: the official postgres image fails with exec: "/usr/local/bin/docker-entrypoint.sh": stat /usr/local/bin/docker-entrypoint.sh: permission denied after CHOWN, SETUID and SETGID are added to securityContext.capabilities. Without them it fails earlier with chown: changing ownership of '/var/lib/postgresql/data': Operation not permitted. hashicorp/vault fails at su-exec: vault: Permission denied.
  • microVM: vault server -dev fails with open /home/vault/.vault-token.tmp: permission denied, although that directory belongs to the vault user in the image.

Request

  • Honor the image USER.
  • Add securityContext.runAsUser and runAsGroup.
  • Keep file ownership from image layers when they are unpacked.
Ngôn ngữ chính
Go
Star
6.1k
Fork
676
Merge trung bình
2 ngày 41 phút
Pull request đã merge (30 ngày)
500

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của agent-substrate/substrate

Tất cả issue của agent-substrate/substrate

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.