Exposed Kubernetes configuration secrets can fuel supply chain attacks

Pierluigi Paganini November 24, 2023

Researchers warn of publicly exposed Kubernetes configuration secrets that could pose a threat of supply chain attack for organizations.

Aqua Nautilus researchers warn of publicly exposed Kubernetes configuration secrets that put organizations at risk of supply chain attacks.

The experts noticed that these misconfigurations impact hundreds of organizations and open-source projects. Impacted entities include SAP’s Artifacts management system, two top blockchain companies, and multiple other Fortune-500 companies.

These encoded Kubernetes configuration secrets were uploaded to public repositories, experts warn.

The experts used the GitHub API to fetch all entries containing .dockerconfigjson and .dockercfg, which store credentials for accessing a container image registry.

“Although all Secrets types inherently contain sensitive information, the potential for exploitation varies. Secrets such as basic-auth,tls,and ssh-auth may pertain to external services linked to the cluster. However, exploiting these requires discovering the IP address or URL associated with the cluster, which can be challenging and resource-intensive.” reads the analysis published by Aqua. “The service-account-token is more relevant to internal services and can be a valuable asset for post-exploitation and lateral movement within a network, yet it is more challenging to exploit from an external standpoint.”

The initial query produced more than 8,000 results, and then refining it the experts discovered 438 records potentially holding valid credentials for registries. 203 records contained valid credentials that grant access to the respective registries. The researchers pointed out that most of these credentials provided both pulling and pushing privileges.

The analysis of 438 passwords revealed that 21.2% (93 passwords) seemed to be manually set by individuals, while the remaining ones were generated by computers. The researchers used the PESrank model to calculate password strength per each password. They discovered that 43 manually set passwords could be easily compromised by attackers. 

“Alarmingly, we identified commonly known weak passwords such as password, test123456,windows12,ChangeMe,dockerhub, and others in active use.” continues the report. “This underscores the critical need for organizational password policies that enforce strict password creation rules to prevent the use of such vulnerable passwords.”

#RegistryCounterValid Creds (#)Valid Creds (%)
1Private registry1354533%
2Docker Hub946468%
3Quay544481%
4Azure ECR24521%
5GitHub registry211048%
6Jfrog19421%
7Red hat171588%
8Gitlab registry17953%
9Aliyun CS13323%
10Openshift1000%
11GCR900%
12IBM ICR8450%
13Harbor700%
14DigitalOcean400%
15Tencent300%
16AWS100%
17OVH100%
18Pivotal100%
Sum43820346.3%

Table 2: Exposed registries analysis

In some cases, the secrets remained exposed online for up to five years.

Moreover, the research revealed that all the scanners tested by the researchers were unable to detect these leaks, suggesting that they primarily focused on searching for plaintext passwords and tokens, overlooking encoded secrets.

The researchers highlighted the findings related to AWS (row 16) and GCR (Google Container Registry, row 11) were only related to temporary credentials that had already expired.

But on a positive note, all the credentials associated with AWS and Google Container Registry (GCR) were found to be temporary and expired, making access impossible. In a similar vein, the GitHub Container Registry required two-factor authentication (2FA) as an added layer against unauthorized access.

“The implications of these findings are profound, affecting not only individual developers but also large organizations, as evidenced by our discovery of valid credentials for a Fortune 500 company’s container images registries and artifact repositories.” concludes the report. “The potential for data breaches, loss of proprietary code, and supply chain attacks is a stark reminder of the need for stringent security practices.”

Follow me on Twitter: @securityaffairs and Facebook and Mastodon

Pierluigi Paganini

(SecurityAffairs – hacking, Kubernetes configuration)



you might also like

leave a comment