
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
github.com/google/go-containerregistry/pkg/authn/k8schain
Advanced tools
k8schainThis is an implementation of the authn.Keychain interface loosely based on the authentication semantics used by the Kubelet when performing the pull of a Pod's images.
This keychain supports passing a Kubernetes Service Account and some ImagePullSecrets which may represent registry credentials.
In addition to those, the keychain also includes cloud-specific credential helpers for Google Container Registry (and Artifact Registry), Azure Container Registry, and Amazon AWS Elasic Container Registry. This means that if the keychain is used from within Kubernetes services on those clouds (GKE, AKS, EKS), any available service credentials will be discovered and used.
In general this keychain should be used when the code is expected to run in a Kubernetes cluster, and especially when it will run in one of those clouds.
To get a cloud-agnostic keychain, use pkg/authn/kubernetes instead.
To get only cloud-aware keychains, use google.Keychain, or pkg/authn.NewKeychainFromHelper with a cloud credential helper implementation -- see the implementation of k8schain.NewNoClient for more details.
A k8schain keychain can be built via one of:
// client is a kubernetes.Interface
kc, err := k8schain.New(ctx, client, k8schain.Options{})
...
// This method is suitable for use by controllers or other in-cluster processes.
kc, err := k8schain.NewInCluster(ctx, k8schain.Options{})
...
The k8schain keychain can be used directly as an authn.Keychain, e.g.
auth, err := kc.Resolve(registry)
if err != nil {
...
}
Or, with the remote.WithAuthFromKeychain option:
img, err := remote.Image(ref, remote.WithAuthFromKeychain(kc))
if err != nil {
...
}
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.