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/one-com/ozone
Golang HTTP daemon engine.
Ozone is not a web framework. It's a daemon engine which will serve your http.Handler's and take care of the boilerplate to make a nice configurable well behaving daemon.
The use case for using Ozone is HTTP based micro services and infrastructure glue daemons where you know what your http.Handler should do. You just want it served with graceful zero-downtime reloads/upgrades, logging and ready made configuration integrating nicely with Linux systemd. Ozone comes with a ready made configurable and modular reverse HTTP proxy handler.
Ozone reads a JSON config file which defines HTTP servers, their listeners (any TLS configuration) and their http.Handler. Configuration is fully modular, letting you provide your own dedicated handler configuration.
Ozone can be asked to listen on a UNIX socket for commands, allowing you to control the running daemon. New commands can be implemented and registered by the application.
Ozone doesn't per default do access-logging. It can be configured to do that, but you can also just issue the "alog" command on the control socket to get access log for a specific HTTP server.
Ozone is build on the github.com/One-com/gone set of libraries which provide much of the functionality.
A simple
//...declarations left out
type handlerConfig struct {
Response string
}
func createHandler(name string, js jconf.SubConfig, handlerByName func(string) (http.Handler, error)) (h http.Handler, cleanup func() error, err error) {
h = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
var cfg *handlerConfig
err = js.ParseInto(&cfg)
if err != nil {
return
}
w.Write([]byte(cfg.Response + "\n"))
})
return
}
func init() {
flag.StringVar(&configFile, "c", "options.json", "Configuration file")
flag.BoolVar(&dryrun, "n", false, "Dryrun - Dump full config")
flag.StringVar(&controlSocket, "s", "", "Path to control socket")
flag.DurationVar(&shutdownTimeout, "g", time.Duration(0), "Default timeout (seconds) to do graceful shutdown")
flag.Parse()
ozone.Init(ozone.DumpConfig(dryrun), ozone.ControlSocket(controlSocket), ozone.ShutdownTimeout(shutdownTimeout))
}
func main() {
ozone.RegisterHTTPHandlerType("MyConfigurableHandler", createHandler)
err := ozone.Main(configFile)
if err != nil {
os.Exit(1)
}
}
The configuration file is structured as:
{
"HTTP" : { // defining HTTP servers
"servername" : {
"Handler" : "handlername" // top level HTTP handler
"Listeners" : { ... } // specification of server listeners.
}
},
"Handlers" : {
"handlername" : {
"Type" : "MyConfurableHandler",
"Config" : { ... }
}
}
}
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.