Secrets Revealed in Container Images: An Internet-wide Study on Occurrence and Impact (2307.03958v1)
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.
- Imperfect Forward Secrecy: How Diffie-Hellman Fails in Practice. In ACM CCS.
- A security analysis of Amazon’s Elastic Compute Cloud service. IEEE/IFIP DSN (2012).
- Assessing the Use of Insecure ICS Protocols via IXP Network Traffic Analysis. In IEEE ICCCN.
- Docker Container Security in Cloud Computing. In IEEE CCWC.
- Stuart Burns. 2021. How to keep Docker secrets secret. https://www.techtarget.com/searchitoperations/tip/How-to-keep-Docker-secrets-secret. (Accessed on 06/13/2022).
- Online Discoverability and Vulnerabilities of ICS/SCADA Devices in the Netherlands. arXiv:2011.02019.
- Measuring and Applying Invalid SSL Certificates: The Silent Majority. In ACM IMC.
- To Docker or Not to Docker: A Security Perspective. IEEE Cloud Comp. 3, 5 (2016).
- COMSYS. 2023. Docker Secret Analysis Code. https://github.com/COMSYS/docker-secret-analysis.
- Ang Cui and Salvatore J. Stolfo. 2010. A Quantitative Analysis of the Insecurity of Embedded Network Devices: Results of a Wide-Area Scan. In ACM ACSAC.
- Easing the Conscience with OPC UA: An Internet-Wide Study on Insecure Deployments. In ACM IMC.
- Missed Opportunities: Measuring the Untapped TLS Support in the Industrial Internet of Things. In ACM ASIACCS. New York, NY, USA.
- Jean-Laurent de Morlhon. 2020. Scaling Docker’s Business to Serve Millions More Developers: Storage - Docker. https://www.docker.com/blog/scaling-dockers-business-to-serve-millions-more-developers-storage/. (Accessed on 08/17/2022).
- deepfence. 2022. SecretScanner. https://github.com/deepfence/SecretScanner. (Accessed on 10/11/2022).
- David Dittrich and Erin Kenneally. 2012. The Menlo Report: Ethical Principles Guiding Information and Communication Technology Research. Technical Report. U.S. Department of Homeland Security.
- Docker Inc. 2022a. Docker Documentation: Best practices for writing Dockerfiles. https://docs.docker.com/develop/develop-images/dockerfile{_}best-practices/. (Accessed on 11/11/2022).
- Docker Inc. 2022b. Docker Documentation: Deploy a registry server. https://docs.docker.com/registry/deploying/. (Accessed on 11/30/2022).
- Docker Inc. 2022c. Docker Documentation: Dockerfile reference. https://docs.docker.com/engine/reference/builder/. (Accessed on 08/11/2022).
- Docker Inc. 2022d. Docker Documentation: HTTP API. https://docs.docker.com/registry/spec/api/. (Accessed on 08/09/2022).
- Docker Inc. 2022e. Docker Documentation: Image Manifest. https://docs.docker.com/registry/spec/manifest-v2-2/. (Accessed on 08/09/2022).
- Docker Inc. 2022f. Docker Hub Container Image Library. https://hub.docker.com/. (Accessed on 06/07/2022).
- Docker Inc. 2022g. Increase Rate Limits - Docker. https://www.docker.com/increase-rate-limits/. (Accessed on 08/17/2022).
- Docker Inc. 2022h. Manage sensitive data with Docker secrets. https://docs.docker.com/engine/swarm/secrets/. (Accessed on 06/15/2022).
- Docker Inc. 2022i. What is a Container? - Docker. https://www.docker.com/resources/what-container/. (Accessed on 08/09/2022).
- A Search Engine Backed by Internet-Wide Scanning. In ACM CCS.
- ZMap: Fast Internet-wide Scanning and Its Security Applications. In USENIX SEC.
- Git Leaks: Boosting Detection Effectiveness Through Endpoint Visibility. In IEEE TrustCom.
- Automated Detection of Password Leakage from Public GitHub Repositories. In ACM ICSE. New York, NY, USA.
- A deeper understanding of SSH: Results from Internet-wide scans. In IEEE NOMS.
- Béla Genge and Călin Enăchescu. 2016. ShoVAT: Shodan-Based Vulnerability Assessment Tool for Internet-Facing Services. Sec. and Commun. Netw. 9, 15 (2016).
- GitGuardian. 2022. Git Security Scanning & Secrets Detection. https://www.gitguardian.com/. (Accessed on 06/17/2022).
- Hidden in Plain Sight: Obfuscated Strings Threatening Your Privacy. In ACM ASIACCS. New York, NY, USA.
- Dan Goodin. 2013. PSA: Don’t upload your important passwords to GitHub. https://arstechnica.com/information-technology/2013/01/psa-dont-upload-your-important-passwords-to-github/. (Accessed on 06/13/2022).
- Dan Goodin. 2018. Thousands of servers found leaking 750MB worth of passwords and keys. https://arstechnica.com/information-technology/2018/03/thousands-of-servers-found-leaking-750-mb-worth-of-passwords-and-keys/. (Accessed on 06/13/2022).
- Analyzing Internet-connected industrial equipment. In IEEE ICSigSys.
- Mining Your Ps and Qs: Detection of Widespread Weak Keys in Network Devices. In USENIX SEC.
- Michael Henriksen. 2022. Reconnaissance tool for GitHub organizations. https://github.com/michenriksen/gitrob. (Accessed on 06/17/2022).
- The Boon and Bane of Cross-Signing: Shedding Light on a Common Practice in Public Key Infrastructures. In ACM CCS.
- TLS in the Wild: An Internet-wide Analysis of TLS-based Protocols for Electronic Communication. NDSS (2016).
- The SSL Landscape: A Thorough Analysis of the x.509 PKI Using Active and Passive Measurements. In ACM IMC.
- Tracking the Deployment of TLS 1.3 on the Web: A Story of Experimentation and Centralization. ACM SIGCOMM Comput. Commun. Rev. 50, 3 (2020).
- Security Analysis and Threats Detection Techniques on Docker Container. In IEEE ICCC.
- Henri Hubert. 2021. Secrets exposed in Docker images: Hunting for secrets in Docker Hub. https://blog.gitguardian.com/hunting-for-secrets-in-docker-hub/. (Accessed on 06/13/2022).
- Static Vulnerability Analysis of Docker Images. IOP: Mat. Sc. and Eng. 1131, 1 (apr 2021).
- Sabrina Kall and Slim Trabelsi. 2021. An Asynchronous Federated Learning Approach for a Security Source Code Scanner. In ICISSP, Paolo Mori, Gabriele Lenzini, and Steven Furnell (Eds.).
- Peeking Under the Skirts of a Nation: Finding ICS Vulnerabilities in the Critical Digital Infrastructure. In ECCWS.
- Poster: Committed by Accident —- Prevention and Remediation Strategies Against Secret Leakage. https://www.ieee-security.org/TC/SP2022/program-posters.html.
- Tracking Certificate Misissuance in the Wild. In IEEE SP.
- Mohit Kumar. 2013. Hundreds of SSH Private Keys exposed via GitHub Search. https://thehackernews.com/2013/01/hundreds-of-ssh-private-keys-exposed.html. (Accessed on 06/13/2022).
- Detectify Labs. 2016. Slack bot token leakage exposing business critical information. https://labs.detectify.com/2016/04/28/slack-bot-token-leakage-exposing-business-critical-information/. (Accessed on 06/15/2022).
- TLS 1.3 in Practice: How TLS 1.3 Contributes to the Internet. In ACM WWW. New York, NY, USA.
- Analyzing Spatial Differences in the TLS Security of Delegated Web Services. In ACM ASIACCS. New York, NY, USA.
- Éireann P. Leverett. 2011. Quantitatively Assessing and Visualising Industrial System Attack Surfaces. Master’s thesis. University of Cambridge.
- Exploring the Unchartered Space of Container Registry Typosquatting. In USENIX SEC.
- Understanding the Security Risks of Docker Hub. In ESORICS, Liqun Chen, Ninghui Li, Kaitai Liang, and Steve Schneider (Eds.). Cham.
- Optimizing Leak Detection in Open-Source Platforms with Machine Learning Techniques. In ICISSP.
- The Fragility of Industrial IoT’s Data Backbone: Security and Privacy Issues in MQTT and CoAP Protocols. Technical Report. Trend Micro Inc.
- How Bad Can It Git? Characterizing Secret Leakage in Public GitHub Repositories. NDSS (2019).
- An Internet-wide view of ICS devices. In IEEE PST.
- Uncovering Vulnerable Industrial Control Systems from the Internet Core. In IEEE/IFIP NOMS.
- Claus Pahl. 2015. Containerization and the PaaS Cloud. IEEE Cloud Comp. 2, 3 (2015).
- The Seven Sins: Security Smells in Infrastructure as Code Scripts. In ICSE.
- Security Smells in Ansible and Chef Scripts: A Replication Study. ACM Trans. Softw. Eng. Methodol. 30, 1 (jan 2021).
- Akond Rahman and Laurie Williams. 2021. Different Kind of Smells: Security Smells in Infrastructure as Code Scripts. IEEE S&P 19, 3 (2021).
- Share, But be Aware: Security Smells in Python Gists. In IEEE ICSME.
- RedHunt Labs. 2021. Scanning Millions Of Publicly Exposed Docker Containers — Thousands Of Secrets Leaked (Wave 5). https://redhuntlabs.com/blog/scanning-millions-of-publicly-exposed-docker-containers-thousands-of-secrets-leaked.html. (Accessed on 06/13/2022).
- Secrets in Source Code: Reducing False Positives using Machine Learning. In IEEE COMSNETS.
- Impact of Evolving Protocols and COVID-19 on Internet Traffic Shares. https://arxiv.org/abs/2201.00142.
- SecurityFail. 2022. kompromat. https://github.com/SecurityFail/kompromat. (Accessed on 11/09/2022).
- MatÃas Sequeira. 2020. Low-hanging Secrets in Docker Hub and a Tool to Catch Them All. https://ioactive.com/guest-blog-docker-hub-scanner-matias-sequeira/. (Accessed on 06/13/2022).
- Shodan. 2013. Shodan. https://www.shodan.io.
- Detecting and Mitigating Secret-Key Leaks in Source Code Repositories. In IEEE/ACM MSR.
- Measuring the Security Harm of TLS Crypto Shortcuts. In ACM IMC.
- Stack Overflow. 2022. Developer Survey 2021. https://insights.stackoverflow.com/survey/2021. (Accessed on 07/11/2022).
- The Linux Foundation. 2022. Kubernetes - Production-Grade Container Orchestration. https://kubernetes.io/. (Accessed on 11/12/2022).
- TruffleSecurity. 2022. TruffleHog. https://github.com/trufflesecurity/trufflehog. (Accessed on 06/17/2022).
- Itamar Turner-Trauring. 21. Don’t leak your Docker image’s build secrets. https://pythonspeed.com/articles/docker-build-secrets/. (Accessed on 06/13/2022).
- An Internet-Wide View of Connected Cars: Discovery of Exposed Automotive Devices. In ACM ARES. New York, NY, USA.
- Large-Scale Cluster Management at Google with Borg. In ACM EuroSys. New York, NY, USA.
- Managing Security of Virtual Machine Images in a Cloud Environment. In ACM CCSW.
- Jonathan Codi West and Tyler Moore. 2022. Longitudinal Study of Internet-Facing OpenSSH Update Patterns. In PAM, Oliver Hohlfeld, Giovane Moura, and Cristel Pelsser (Eds.). Cham.
- Jordan Writght. 2014. Why Deleting Sensitive Information from Github Doesn’t Save You. https://jordan-wright.com/blog/2014/12/30/why-deleting-sensitive-information-from-github-doesnt-save-you/. (Accessed on 06/13/2022).
- The Landscape of Industrial Control Systems (ICS) Devices on the Internet. In IEEE Cyber SA.
- On the Relation between Outdated Docker Containers, Severity Vulnerabilities, and Bugs. In IEEE SANER.
- On the usage of JavaScript, Python and Ruby packages in Docker Hub images. Sc. of Comp. Prog. 207 (2021).
- Large-Scale Analysis of the Docker Hub Dataset. In IEEE CLUSTER.
- Slimmer: Weight Loss Secrets for Docker Registries. In IEEE CLOUD.
- Zeljka Zorz. 2014. 10,000 GitHub users inadvertently reveal their AWS secret access keys. https://www.helpnetsecurity.com/2014/03/24/10000-github-users-inadvertently-reveal-their-aws-secret-access-keys/. (Accessed on 06/13/2022).
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.