TMAegis
Thêm quy tắc cho docker

TMA-DOCKER-4.9

Ensure secrets are not stored in Dockerfiles

CaoCấp 1Xem xét thủ côngdocker

Mô tả

Do not store any secrets in Dockerfiles. Docker images are not opaque and contain information about the commands used to build them. As such secrets should not be included in Dockerfiles used to build images as they will be visible to any users of the image. Reported as a manual review item: the audit needs a site-specific judgement.

Cách kiểm tra

Phương pháp kiểm tra: Xem xét thủ công

Khuyến nghị này không thể kiểm tra tự động. Lần quét sẽ liệt kê mục này kèm hướng dẫn khi bạn truyền cờ --include-manual.

Run the below command to get the list of images: docker images Run the below command for each image in the list above, and look for any secrets: docker history <IMAGE ID> Alternatively, if you have access to Dockerfile for the image, verify that there are no secrets as described above.

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

Do not store any kind of secrets within Dockerfiles. Where secrets are required during the build process, make use of a secrets management tool, such as the buildkit builder included with Docker.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
dockermanual
Tham chiếu
CIS Docker Benchmark v1.9.0 - 4.9 Ensure secrets are not stored in Dockerfiles