search
HomeOperation and MaintenanceDockerWhat are the security features of 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

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
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
Linux and Docker: Docker on Different Linux DistributionsLinux and Docker: Docker on Different Linux DistributionsApr 19, 2025 am 12:10 AM

The methods of installing and using Docker on Ubuntu, CentOS, and Debian are different. 1) Ubuntu: Use the apt package manager, the command is sudoapt-getupdate&&sudoapt-getinstalldocker.io. 2) CentOS: Use the yum package manager and you need to add the Docker repository. The command is sudoyumininstall-yyum-utils&&sudoyum-config-manager--add-repohttps://download.docker.com/lin

Mastering Docker: A Guide for Linux UsersMastering Docker: A Guide for Linux UsersApr 18, 2025 am 12:08 AM

Using Docker on Linux can improve development efficiency and simplify application deployment. 1) Pull Ubuntu image: dockerpullubuntu. 2) Run Ubuntu container: dockerrun-itubuntu/bin/bash. 3) Create Dockerfile containing nginx: FROMubuntu;RUNapt-getupdate&&apt-getinstall-ynginx;EXPOSE80. 4) Build the image: dockerbuild-tmy-nginx. 5) Run container: dockerrun-d-p8080:80

Docker on Linux: Applications and Use CasesDocker on Linux: Applications and Use CasesApr 17, 2025 am 12:10 AM

Docker simplifies application deployment and management on Linux. 1) Docker is a containerized platform that packages applications and their dependencies into lightweight and portable containers. 2) On Linux, Docker uses cgroups and namespaces to implement container isolation and resource management. 3) Basic usages include pulling images and running containers. Advanced usages such as DockerCompose can define multi-container applications. 4) Debug commonly used dockerlogs and dockerexec commands. 5) Performance optimization can reduce the image size through multi-stage construction, and keeping the Dockerfile simple is the best practice.

Docker: Containerizing Applications for Portability and ScalabilityDocker: Containerizing Applications for Portability and ScalabilityApr 16, 2025 am 12:09 AM

Docker is a Linux container technology-based tool used to package, distribute and run applications to improve application portability and scalability. 1) Dockerbuild and dockerrun commands can be used to build and run Docker containers. 2) DockerCompose is used to define and run multi-container Docker applications to simplify microservice management. 3) Using multi-stage construction can optimize the image size and improve the application startup speed. 4) Viewing container logs is an effective way to debug container problems.

How to start containers by dockerHow to start containers by dockerApr 15, 2025 pm 12:27 PM

Docker container startup steps: Pull the container image: Run "docker pull [mirror name]". Create a container: Use "docker create [options] [mirror name] [commands and parameters]". Start the container: Execute "docker start [Container name or ID]". Check container status: Verify that the container is running with "docker ps".

How to view logs from dockerHow to view logs from dockerApr 15, 2025 pm 12:24 PM

The methods to view Docker logs include: using the docker logs command, for example: docker logs CONTAINER_NAME Use the docker exec command to run /bin/sh and view the log file, for example: docker exec -it CONTAINER_NAME /bin/sh ; cat /var/log/CONTAINER_NAME.log Use the docker-compose logs command of Docker Compose, for example: docker-compose -f docker-com

How to check the name of the docker containerHow to check the name of the docker containerApr 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 create containers for dockerHow to create containers for dockerApr 15, 2025 pm 12:18 PM

Create a container in Docker: 1. Pull the image: docker pull [mirror name] 2. Create a container: docker run [Options] [mirror name] [Command] 3. Start the container: docker start [Container name]

See all articles

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

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Atom editor mac version download

Atom editor mac version download

The most popular open source editor