Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/jwendel/smcache
SMCache is a Go library to store certificates from Let's Encrypt in GCP Secret Manager. It is an implementation of the Cache within acme autocert that will store data within Google Cloud's Secret Manager.
This is not an official Google product.
import (
"github.com/jwendel/smcache"
"golang.org/x/crypto/acme/autocert"
)
func main() {
m := &autocert.Manager{
Cache: smcache.NewSMCache(smcache.Config{ProjectID: "my-project-id", SecretPrefix: "test-"}),
Prompt: autocert.AcceptTOS,
HostPolicy: autocert.HostWhitelist("example.com", "www.example.com"),
}
s := &http.Server{
Addr: ":https",
TLSConfig: m.TLSConfig(),
}
panic(s.ListenAndServeTLS("", ""))
}
SMCache requires admin access to the Secret Manager API to function properly. This is configure in the IAM policy for a resource.
Example of enabling this API for Compute Engine:
<projectId>-compute@developer.gserviceaccount.com
(Compute Engine default service account
)Add Another Role
, and select Secret Manager Admin
.Bonus Security: if you're paranoid about this resource getting access to other secrets, you can set a condition on the Role we just added.
Add Condition
, then set a name and description for it.Resource
-> Name
, Operator: Starts With
, and set it to whatever value you want, such as "test-
".
SecretPrefix
you set on the smcache.Config
.There are 2 demos checked into this repo under example/.
fmt.Errorf
)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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.