
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
github.com/sniperkit/cacher
=========
[WIP]
Package httpcache provides a http.RoundTripper implementation that works as a mostly RFC-compliant cache for http responses.
It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client and not for a shared proxy).
plugins/lru
provides an in-memory cache that will evict least-recently used entries. (original: github.com/die-net/lrucache
)plugins/lru/twotier
allows caches to be combined, for example to use lrucache above with a persistent disk-cache. (original: github.com/die-net/lrucache/twotier
)github.com/gregjones/httpcache/diskcache
provides a filesystem-backed cache using the diskv library.plugins/bbolt
plugins/boltdb-gzip
plugins/boltdb-ttl
plugins/storm
plugins/leveldb
provides a filesystem-backed cache using leveldb.plugins/azurestorage
uses Azure Storage service. (original: github.com/PaulARoy/azurestoragecache
)plugins/gcs
uses Google cloud service engine. (original: github.com/PaulARoy/azurestoragecache
)plugins/diskv/s3
uses Amazon S3 for storage. (original: github.com/sourcegraph/s3cache
)plugins/etcd/v2
provides etcd api v2 implentationplugins/etcd/v3
provides etcd api v3 implentationplugins/e3ch
provides etcd api v3 implentation with hierarchyplugins/memcache
provides memcache implementations, for both App Engine and 'normal' memcache servers. (Original: memcache
)plugins/gorm
provides gorm implementations, mainly for debugging and developmentBelow is a basic example of usage.
func httpCacheExample() {
numOfRequests := 0
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", fmt.Sprintf("private, max-age=10"))
if numOfRequests == 0 {
w.Write([]byte("Hello!"))
} else {
w.Write([]byte("Goodbye!"))
}
numOfRequests++
}))
httpClient := &http.Client{
Transport: httpcache.NewMemoryCacheTransport(),
}
makeRequest(ts, httpClient) // "Hello!"
// The second request is under max-age, so the cache is used rather than hitting the server
makeRequest(ts, httpClient) // "Hello!"
// Sleep so the max-age is passed
time.Sleep(time.Second * 11)
makeRequest(ts, httpClient) // "Goodbye!"
}
func makeRequest(ts *httptest.Server, httpClient *http.Client) {
resp, _ := httpClient.Get(ts.URL)
var buf bytes.Buffer
io.Copy(&buf, resp.Body)
println(buf.String())
}
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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.