Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/m3db/prometheus_remote_client_golang
promremote
is a Prometheus remote write client written in Go.
go get -u github.com/m3db/prometheus_remote_client_golang
promremote
is used to send metrics to a Prometheus remote write endpoint such as supported by
m3coordinator. It can be pulled into
an existing codebase as a client library or used as a cli tool (cmd/main.go
) for ad hoc testing
purposes.
IMPORTANT: A running program or application that has a Prometheus remote write endpoint is required.
To use promremote
as a client library, the client must be constructed manually using structs.
// create config and client
cfg := promremote.NewConfig(
promremote.WriteURLOption(writeURLFlag),
promremote.HTTPClientTimeoutOption(60 * time.Second),
promremote.UserAgent(userAgent),
)
client, err := promremote.NewClient(cfg)
if err != nil {
log.Fatal(fmt.Errorf("unable to construct client: %v", err))
}
timeSeriesList := []promremote.TimeSeries{
promremote.TimeSeries{
Labels: []promremote.Label{
{
Name: "__name__",
Value: "foo_bar",
},
{
Name: "biz",
Value: "baz",
},
},
Datapoint: promremote.Datapoint{
Timestamp: time.Now(),
Value: 1415.92,
},
},
}
if err := client.WriteTimeSeries(timeSeriesList); err != nil {
log.Fatal(err)
}
If one wants to use promremote
as a CLI, he or she can utilize the tool located in the cmd/
directory. The tool takes in a series of labels and a datapoint then writes them to a Prometheus
remote write endpoint. Below is an example showing a metric with two labels
(__name__:foo_bar
and biz:baz
) and a datapoint (timestamp:now
value:1415.92
).
Note: One can either specify a Unix timestamp (e.g. 1556026725
) or the keyword now
as the
first parameter in the -d
flag.
go run cmd/promremotecli/main.go -t=__name__:foo_bar -t=biz:baz -d=now,1415.92
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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.