TL;DR
This paper introduces DITECTOR, a novel framework for large-scale security analysis of Docker images. By analyzing over 12 million Docker Hub repositories and constructing an image dependency graph, they reveal alarming rates of vulnerabilities, secret leaks, and malicious files, highlighting the pervasive security risks within the Docker ecosystem and their propagation through the supply chain.
What Problem Does This Paper Address?
Docker has revolutionized software development by enabling easy sharing and reuse of containerized applications through registries like Docker Hub. However, this widespread adoption creates a complex "supply chain" where vulnerabilities and malicious code can propagate rapidly. While existing research has touched upon various Docker image security issues, there's a lack of a comprehensive, large-scale analysis that considers the interconnectedness of images through their dependencies. This paper aims to fill that gap by providing a systematic measurement of security risks across the Docker image ecosystem, focusing on how these threats spread.
Methods
The core of the paper is the DITECTOR framework. It comprises several key components:
- Crawler: Gathers image descriptions from Docker Hub, focusing on repository, tag, and image-level metadata.
- IDEA (Image Dependency Graph) Construction: This is a novel approach that builds a graph representing the relationships between Docker images based on their layer information. Each layer is assigned a unique ID derived from its parent layer's ID and its own content or configuration digest. This allows for tracing upstream and downstream dependencies.
- Threat Detection: DITECTOR analyzes images for five types of security risks:
- Sensitive Command Parameters: Identifies potentially risky parameters in startup commands that could break isolation or elevate privileges.
- Secret Leakage: Uses tools like TruffleHog to scan for leaked secrets (API keys, passwords, etc.) within image descriptions, metadata, and content.
- Software Vulnerability: Leverages tools like Anchore for Software Composition Analysis (SCA) to detect known vulnerabilities.
- Misconfiguration: Manually identifies common insecure configurations for popular databases.
- Malicious File: Employs antivirus engines and datasets of known malicious packages to detect harmful files, particularly cryptocurrency miners.
DITECTOR prioritizes analysis of "critical" images: those with high pull counts (indicating widespread use) and high dependency weights (meaning many other images rely on them).
Datasets
The primary dataset consists of over 12 million image repositories collected from Docker Hub. From this, they construct an image dependency graph and select a subset of 33,952 critical images for in-depth security analysis. This subset includes:
- All official images.
- Top 10 most recently updated tags from repositories with at least 100 pulls.
- Images with a dependency weight greater than or equal to 10.
The paper does not introduce a new benchmark dataset but rather leverages the vast public data available on Docker Hub.
Key Insights and Ideas
- Pervasive Vulnerabilities: The sheer volume of images containing known vulnerabilities (93.7%) is staggering, suggesting that most Docker images are not adequately secured.
- Secret Leakage is Commonplace: A significant number of images (4,437) contain leaked secrets, with the majority of these leaks occurring in the image content. This highlights a critical risk for supply chain security.
- Malicious Images are a Real Threat: The discovery of 31 malicious images, primarily used for cryptocurrency mining, and their propagation to 334 downstream images, demonstrates a clear and present danger.
- Dependency Graph is Crucial: The IDEA framework is key to understanding how threats propagate. It reveals that many images inherit risks from their parents, and attackers can exploit this to spread malicious code widely.
- "Critical" Images are High-Risk Targets: Focusing on high-pull-count and high-dependency-weight images is an effective strategy for identifying the most impactful security risks.
- Lack of Timely Updates: The analysis of image update times versus vulnerability disclosure dates reveals that many images are not updated promptly, leaving them vulnerable to known exploits for extended periods.
Key Results
- 93.7% of analyzed images contain known vulnerabilities.
- 4,437 images have secret leaks.
- 50 images contain misconfigurations.
- 31 images were detected to execute malicious files (primarily cryptocurrency miners).
- 334 downstream images were identified as being affected by malicious images.
- 103 repositories were found using the
--privilegedflag, indicating potential security risks. - 99.6% of detected secrets were leaked through image content.
- 83.5% of images contain vulnerabilities disclosed in 2024, emphasizing the need for regular updates.
Limitations and Future Work
- Tool Limitations: The accuracy and completeness of the findings are dependent on the capabilities of the open-source tools used (TruffleHog, Anchore). Future work could involve developing more advanced, customized detection tools.
- Scope: The study primarily focuses on Docker Hub, which is representative but not the entirety of the Docker ecosystem.
- Future Work: The authors suggest enhancing security information provided by registries, developing more advanced security tools, and continuing to monitor and mitigate threats within the Docker ecosystem. They also plan to open-source parts of their dataset and framework.
Summary updated