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/allan-simon/hydra
Hydra is being developed by german-based company Ory. Join our newsletter to stay on top of new developments. We offer basic support requests on Google Groups and Gitter as well as consulting around integrating Hydra into your particular environment and premium support.
Hydra uses the security first OAuth2 and OpenID Connect SDK Fosite and Ladon for policy-based access control.
Table of Contents
At first, there was the monolith. The monolith worked well with the bespoke authentication module. Then, the web evolved into an elastic cloud that serves thousands of different user agents in every part of the world.
Hydra is driven by the need for a scalable, low-latency, in memory Access Control, OAuth2, and OpenID Connect layer that integrates with every identity provider you can imagine.
Hydra is available through Docker and relies on RethinkDB for persistence. Database drivers are extensible in case you want to use RabbitMQ, MySQL, MongoDB, or some other database instead.
Hydra is built for high throughput environments. Using 10.000 simultaneous connections on a Macbook Pro Late 2013, the OAuth2 token validation endpoint served on average 37500 requests / sec. Other endpoints like the JSON Web Key endpoint serve up to 4700 requests / sec. Read this issue for information on reproducing these benchmarks yourself.
This section is a quickstart guide to working with Hydra. In-depth docs are available as well:
There are various ways of installing hydra on your system.
The client and server binaries are downloadable at releases.
There is currently no installer available. You have to add the hydra binary to the PATH environment variable yourself or put
the binary in a location that is already in your path (/usr/bin
, ...).
If you do not understand what that all of this means, ask in our chat channel. We are happy to help.
Starting the host is easiest with docker. The host process handles HTTP requests and is backed by a database. Read how to install docker on Linux, OSX or Windows. Hydra is available on Docker Hub.
You can use Hydra without a database, but be aware that restarting, scaling or stopping the container will lose all data:
$ docker run -d -p 4444:4444 oryam/hydra --name my-hydra
ec91228cb105db315553499c81918258f52cee9636ea2a4821bdb8226872f54b
Using the client command line interface: You can ssh into the hydra container and execute the hydra command from there:
$ docker exec -i -t <hydra-container-id> /bin/bash
# e.g. docker exec -i -t ec91228 /bin/bash
root@ec91228cb105:/go/src/github.com/ory-am/hydra# hydra
Hydra is a twelve factor OAuth2 and OpenID Connect provider
[...]
If you wish to compile hydra yourself, you need to install and set up Go 1.5+ and add $GOPATH/bin
to your $PATH
. To do so, run the following commands in a shell (bash, sh, cmd.exe, ...):
go get github.com/ory-am/hydra
go get github.com/Masterminds/glide
cd $GOPATH/src/github.com/ory-am/hydra
glide install
go install github.com/ory-am/hydra
hydra
The tutorial teaches you to set up Hydra, a RethinkDB instance and an exemplary identity provider written in React using docker compose. It will take you about 5 minutes to get complete the tutorial.
Why should I use Hydra? It's not that hard to implement two OAuth2 endpoints and there are numerous SDKs out there!
OAuth2 and OAuth2 related specifications are over 200 written pages. Implementing OAuth2 is easy, getting it right is hard. Even if you use a secure SDK (there are numerous SDKs not secure by design in the wild), messing up the implementation is a real threat - no matter how good you or your team is. To err is human.
An in-depth list of security features is listed in the security guide.
Hydra has received a lot of positive feedback. Let's see what the community is saying:
Nice! Lowering barriers to the use of technologies like these is important.
OAuth is a framework not a protocol. The security it provides can vary greatly between implementations. Fosite (which is what this is based on) is a very good implementation from a security perspective: https://github.com/ory-am/fosite#a-word-on-security
[...] Thanks for releasing this by the way, looks really well engineered. [...]
The Guide is available on GitBook.
The HTTP API is documented at Apiary.
Run hydra -h
or hydra help
.
Developing with Hydra is as easy as:
go get github.com/ory-am/hydra
go get github.com/Masterminds/glide
cd $GOPATH/src/github.com/ory-am/hydra
glide install
go test $(glide novendor)
If you want to run a Hydra instance, there are two possibilities:
Run without Database:
go run main.go host
Run against RethinkDB using Docker:
docker run --name some-rethink -d -p 8080:8080 -p 28015:28015 rethinkdb
DATABASE_URL=rethinkdb://localhost:28015/hydra go run main.go host
A list of extraordinary contributors and bug hunters.
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.