TMAegisBeta
Thêm quy tắc cho docker

Docker

TMA-DOCKER-4.8

Ensure that COPY is used instead of ADD in Dockerfiles

Trung bìnhCấp 1Xem xét thủ côngdocker

Mô tả

You should use the COPY instruction instead of the ADD instruction in the Dockerfile. The COPY instruction simply copies files from the local host machine to the container file system. The ADD instruction could potentially retrieve files from remote URLs and perform operations such as unpacking them. 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 command below to get the list of images: docker images Run the command below against each image in the list above and look for any ADD instructions: docker history <IMAGE ID> Alternatively, if you have access to the Dockerfile for the image, you should verify that there are no ADD instructions.

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

You should use COPY rather than ADD instructions in Dockerfiles.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
dockermanual
Tham chiếu
CIS Docker Benchmark v1.9.0 - 4.8 Ensure that COPY is used instead of ADD in Dockerfiles