Secrets Revealed in Container Images: An Internet-wide Study on Occurrence and Impact

Markus Dahlmanns,Constantin Sander,Robin Decker,Klaus Wehrle
DOI: https://doi.org/10.1145/3579856.3590329
2023-07-08
Abstract:Containerization allows bundling applications and their dependencies into a single image. The containerization framework Docker eases the use of this concept and enables sharing images publicly, gaining high momentum. However, it can lead to users creating and sharing images that include private keys or API secrets-either by mistake or out of negligence. This leakage impairs the creator's security and that of everyone using the image. Yet, the extent of this practice and how to counteract it remains unclear. In this paper, we analyze 337,171 images from Docker Hub and 8,076 other private registries unveiling that 8.5% of images indeed include secrets. Specifically, we find 52,107 private keys and 3,158 leaked API secrets, both opening a large attack surface, i.e., putting authentication and confidentiality of privacy-sensitive data at stake and even allow active attacks. We further document that those leaked keys are used in the wild: While we discovered 1,060 certificates relying on compromised keys being issued by public certificate authorities, based on further active Internet measurements, we find 275,269 TLS and SSH hosts using leaked private keys for authentication. To counteract this issue, we discuss how our methodology can be used to prevent secret leakage and reuse.
Cryptography and Security,Networking and Internet Architecture
What problem does this paper attempt to address?
### Problems the Paper Attempts to Solve This paper aims to investigate whether Docker images contain confidential security materials (such as encryption keys or API keys) and how these leaked keys are used in actual deployments. Specifically, the authors conducted research in the following areas: 1. **Scanning publicly available Docker images**: Searching for Docker images containing confidential information on Docker Hub and other private registries. 2. **Measuring actual usage**: Analyzing whether these leaked secrets are actually used in production environments. Through the above research, the authors hope to reveal the following issues: - The proportion of Docker images containing confidential information. - The actual impact range of these leaked confidential information. - Propose methods to prevent secret leaks and reuse. ### Main Findings - Among the 337,171 Docker Hub images and 8,076 other private registries analyzed, 8.5% of the images contained confidential information. - Specifically, this includes 52,107 private keys and 3,158 leaked API keys. - These leaked keys could lead to large-scale attacks, endangering the security of authentication and private data. - Discovered 1,060 certificates issued based on leaked keys, and 275,269 TLS and SSH hosts used leaked private keys for authentication.