Five malicious Docker container images were recently detected on Docker Hub, totaling more than 120,000 pulls.
There’s a new threat cybersecurity teams need to watch out for: malicious Docker containers hiding on legitimate sites like Docker Hub, where Aqua Security’s threat research arm, Team Nautilus, found five images accounting for a whopping 120,000 pulls by unsuspecting users.
Team Nautilus is further warning that the malicious Docker images could be part of a larger software supply chain attack with its eyes on disrupting cloud-native environments. Supply chain attacks traditionally involve physical tampering with hardware in order to install malicious code that can affect other organizations further down the chain. Consider these Docker images a digital version of a piece of equipment that’s been tampered with to install malware.
Attack-wise, the code being used in the five malicious images aims to do the same thing: install a malicious binary called xmrig that secretly mines the Monero cryptocurrency, invisibly eating up system resources.
SEE: Security incident response policy (TechRepublic Premium)
Three of the images–thanhtudo, thieunutre and chanquaa–install xmrig using a Python script called dao.py, which was used in a previously discovered malicious Docker image called azurenql that was pulled 1.5 million times. These three images rely on misspellings to trick users into downloading them, and Nautilus said they’re not likely to be part of the possible supply chain attack.
The other two malicious Docker images–openjdk and golang–attempt to trick users into believing they are images for the open source Java implementation OpenJDK and open-source programming language Go. It’s these that are likely part of a supply chain attack aiming to infect the companies that pull those images.
Assaf Morag, Team Nautilus lead data analyst, warned in a blog post announcing the discovery that supply chain attacks are a serious threat to cloud-native environments. “Organizations should create a security strategy that can detect and prevent supply chain attacks at every stage of the application lifecycle–from build to production,” Morag said.
Tips for preventing supply chain attacks
In his blog post, Morag recommends three strategies for preventing supply chain attacks, starting with controlling access to public registries and treating any of them being run as high risk. “Create a curated internal registry for base container images and limit who can access public registries. Enact policies that ensure container images are vetted before they are included in the internal registry,” Morag said.
Second, Morag recommends using static and dynamic malware scanning on container images, as many attackers are able to obfuscate at-rest code. Monitor active images for suspicious traffic and other activity to be sure malware hasn’t been downloaded at runtime.
Morag also recommends what basically amounts to treating software supply chains the same as physical ones: keep integrity records. “It’s important to ensure that the container images in use are the same ones that have been vetted and approved,” Morag said. Digital signing, blockchain-based chains-of-custody and other tools ensure that the Docker image you’re downloading is the exact same one that you’re supposed to be.
On a related note, and as mentioned above, attackers often rely on people downloading malicious files, both from Docker Hub and elsewhere by mistake, crafting carefully misspelled file names likely to go unnoticed at a glance. Be sure to always check that you’re downloading from the right source by looking at the publisher’s profile, reading comments and vetting them before causing a security incident.