Home Operation and Maintenance Docker What are the security features of docker?

What are the security features of docker?

Jan 28, 2022 pm 03:21 PM
docker

Docker security features include: 1. Encrypted node ID; 2. TLS-based authentication mechanism; 3. Security access token; 4. CA configuration that supports periodic certificate automatic update; 5. Encrypted cluster storage ; 6. Encrypted network; 7. Docker security scanning; 8. Docker content trust; 9. Docker key, etc.

What are the security features of docker?

The operating environment of this tutorial: linux5.9.8 system, docker-1.13.1 version, Dell G3 computer.

The Docker platform also introduces a large number of its own security technologies. Swarm mode is built on TLS and is extremely simple and flexible to configure. Security scans scan images at the binary source code level and provide detailed reports of known flaws.

Docker content trust allows users to sign and certify content, and keys are now first-class citizens in Docker. Docker sets reasonable default values ​​for these security technologies, but users can also modify the configuration or disable these security technologies.

Swarm mode

Swarm mode is the future trend of Docker. Swarm mode allows users to manage multiple Docker hosts in a cluster and deploy applications in a declarative manner.

Each Swarm is composed of manager and worker nodes, and the nodes can be Linux or Windows. The manager node forms the control layer in the cluster and is responsible for cluster configuration and workload distribution. Worker nodes are containers that run application code.

As expected, Swarm mode includes many security features out of the box, while also setting sensible defaults. These security features include the following.

  • Encrypted node ID.

  • TLS-based authentication mechanism.

  • Secure access token.

  • CA configuration that supports periodic certificate automatic updates.

  • Encrypted cluster storage (configuration DB).

  • Encrypted network.

Docker Security Scan

The ability to quickly find code flaws is crucial. Docker Security Scanning makes it easy to detect known flaws in Docker images.

Docker security scanning is now available for private repository images on Docker Hub. At the same time, this technology can also be used as part of the Docker trusted service localization deployment solution. Finally, all official Docker images have been security scanned, and scan reports are available in their repositories.

Docker security scanning scans Docker images at the binary code level, and checks the software in them against a database of known vulnerabilities (CVE database). After the scan is completed, a detailed report is generated.

Open a browser to visit Docker Hub and search for the Alpine repository. The image below shows the Tags tab of the official Alpine repository.

What are the security features of docker?

#The Alpine warehouse is an official warehouse, which means that the warehouse will automatically scan and generate corresponding reports. As you can see, the images with image tags edge, lates, and 3.6 have all passed the check for known defects. However, the alpine:3.5 image has known defects (marked in red).

If you open the alpine:3.5 image, you can find the detailed information as shown below.

What are the security features of docker?

This is an easy way to discover details of known flaws in your own software.

Docker Trusted Registry (DTR) is part of the localized image warehouse service in Docker Enterprise Edition. It provides the same capabilities and also allows users to control their image scanning timing. and scanning methods.

For example, DTR allows users to choose whether to automatically trigger scans when images are pushed, or whether they can only be triggered manually. At the same time, DTR also allows users to manually update the CVE database, which is an ideal solution for scenarios where DTL cannot connect to the Internet to automatically update CVE data.

This is Docker security scanning, a great way to deeply detect whether Docker images have known security flaws. Of course, with greater ability comes greater responsibility. When users discover defects, they need to bear the responsibility of solving the corresponding defects.

Docker Content Trust

Dockr Content Trust (Docker Content Trust, DCT) makes it easy for users to confirm the integrity of downloaded images and its publisher. This is important when downloading images in an untrusted network environment.

At a high level, DCT allows developers to sign images published to Docker Hub or Docker Trusted Services. When these images are pulled, the signature status will be automatically confirmed. The image below illustrates this process.

What are the security features of docker?

#DCT can also provide key context, such as whether the image has been signed and can be used in production environments, whether the image has been replaced by a new version and becomes obsolete, etc.

The context provided by DTC is still in its infancy and is quite complex to configure. To enable DCT functionality on a Docker host, all you have to do is set the DOCKER_CONTENT_TRUST variable to 1 in your environment.

$ export DOCKER_CONTENT_TRUST=1
Copy after login

In actual environments, users may want to enable this feature by default in the system.

If you use the Docker unified configuration layer (part of Docker Enterprise Edition), you need to check the Run Only Signed Images checkbox as shown in the figure below. This will force all nodes in the UCP cluster to run only signed images.

What are the security features of docker?

As can be seen from the above figure, UCP further encapsulates the DCT and provides security preference information of the signed image. For example, a user may have a requirement that only images signed by secops can be used in a production environment.

Once the DCT function is turned on, unsigned images cannot be obtained and used. The following figure shows the error reported when trying to pull an unsigned image through the Docker CLI or UCP Web UI interface again after DCT is turned on (both examples try to pull the image labeled "unsigned").

What are the security features of docker?

The following figure shows how DCT prevents the Docker client from pulling a tampered image.

What are the security features of docker?

#The following figure shows how DCT prevents clients from pulling old images.

What are the security features of docker?

Docker content trust is an important technology that helps users check images pulled from the Docker service. The basic mode of this technology is very simple to configure, but some advanced features such as context are still very complicated to configure at this stage.

Docker Key

Many applications require keys. Such as passwords, TLS certificates, SSH keys, etc.

Before Docker version 1.13, there was no standard and secure way to share keys between applications. A common way is for developers to write the key as text into an environment variable. This is far from ideal.

Docker1.13 introduces Docker keys, turning keys into first-class citizens in the Docker ecosystem. For example, a new subcommand docker secret has been added to manage keys. There is also a dedicated place to create and manage keys in Docker's UCP interface.

In the background, the key is encrypted after creation and during transmission, is mounted to the memory file system when used, and is only accessible to those services that have been authorized. This is truly a comprehensive end-to-end solution.

The figure below shows the overall process.

What are the security features of docker?

Each step of the workflow shown in the figure above is introduced in turn.

1) The key is created and sent to Swarm.

2) The key is stored in the cluster storage and is encrypted (each manager node can access the cluster storage).

3) Service B is created and the key is used.

4) The process of key transmission to the task node (container) of service B is encrypted.

5) The container of service B decrypts the key and mounts it to the path /run/secrets. This is a temporary in-memory file system (this step is different in Windows Docker because there is no concept of an in-memory file system in Windows).

6) Once the container (service task) is completed, the memory file system is closed and the key is deleted.

7) Containers in service A cannot access the key.

Users can manage keys through the docker secret subcommand, and can specify a key for a service by appending --secret when running the docker service create command.

Recommended learning: "docker video tutorial"

The above is the detailed content of What are the security features of docker?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to update the image of docker How to update the image of docker Apr 15, 2025 pm 12:03 PM

The steps to update a Docker image are as follows: Pull the latest image tag New image Delete the old image for a specific tag (optional) Restart the container (if needed)

How to use docker desktop How to use docker desktop Apr 15, 2025 am 11:45 AM

How to use Docker Desktop? Docker Desktop is a tool for running Docker containers on local machines. The steps to use include: 1. Install Docker Desktop; 2. Start Docker Desktop; 3. Create Docker image (using Dockerfile); 4. Build Docker image (using docker build); 5. Run Docker container (using docker run).

How to exit the container by docker How to exit the container by docker Apr 15, 2025 pm 12:15 PM

Four ways to exit Docker container: Use Ctrl D in the container terminal Enter exit command in the container terminal Use docker stop <container_name> Command Use docker kill <container_name> command in the host terminal (force exit)

How to copy files in docker to outside How to copy files in docker to outside Apr 15, 2025 pm 12:12 PM

Methods for copying files to external hosts in Docker: Use the docker cp command: Execute docker cp [Options] <Container Path> <Host Path>. Using data volumes: Create a directory on the host, and use the -v parameter to mount the directory into the container when creating the container to achieve bidirectional file synchronization.

How to view the docker process How to view the docker process Apr 15, 2025 am 11:48 AM

Docker process viewing method: 1. Docker CLI command: docker ps; 2. Systemd CLI command: systemctl status docker; 3. Docker Compose CLI command: docker-compose ps; 4. Process Explorer (Windows); 5. /proc directory (Linux).

How to check the name of the docker container How to check the name of the docker container Apr 15, 2025 pm 12:21 PM

You can query the Docker container name by following the steps: List all containers (docker ps). Filter the container list (using the grep command). Gets the container name (located in the "NAMES" column).

How to save docker image How to save docker image Apr 15, 2025 am 11:54 AM

To save the image in Docker, you can use the docker commit command to create a new image, containing the current state of the specified container, syntax: docker commit [Options] Container ID Image name. To save the image to the repository, you can use the docker push command, syntax: docker push image name [: tag]. To import saved images, you can use the docker pull command, syntax: docker pull image name [: tag].

How to start mysql by docker How to start mysql by docker Apr 15, 2025 pm 12:09 PM

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

See all articles