Giter Club home page Giter Club logo

bouncer's Introduction

Bouncer

"Get the hell out of here."

Bouncer is an authenticating reverse proxy for Wesabe applications with aspirations to be a web application firewall.

Bouncer accepts Basic HTTP authentication credentials, verifies them, and proxies the request to a backend with new, Wesabe credentials:

Authorization: Wesabe ${base64(user_id + ":" + account_key)}

Along the way, it ensures that HTTP requests are well-formed, non-funky, and worth being in the same club with.

Configuration

Bouncer needs two pieces of information to run:

  • a config file
  • a port

You run bouncer something like this:

`java -jar bouncer.jar /etc/bouncer.properties 8080`

The config file should look like this:

# If true, an unhandled exceptions will return a debug message. Otherwise,
# an exception report will be emailed to [email protected]
bouncer.debug-errors=true

# The backend, as a URI.
bouncer.backend.uri=http://0.0.0.0:8081

# The Basic Auth realm.
bouncer.auth.realm=Wesabe API

# The JDBC class, URI, username, and password.
bouncer.jdbc.driver=com.mysql.jdbc.Driver
bouncer.jdbc.uri=jdbc:mysql://localhost/pfc_development
bouncer.jdbc.username=pfc
bouncer.jdbc.password=blah

# If true, gzip content encoding is enabled.
bouncer.http.compression.enable=true

# A comma-separated list of mime types which can be compressed.
bouncer.http.compression.mime-types=application/xml,application/json

# The minimum response entity size to compress, in bytes.
bouncer.http.compression.minimum-size=100

# The number of seconds to wait for existing connections to finish after the
# listening HTTP port is closed.
bouncer.http.graceful-wait=5000

# The number of threads available to the proxying HTTP client.
bouncer.http.client.threads=40

# The maximum number of connections per backend.
bouncer.http.client.max-connections=1000

# A comma-separated list of memcache servers, with ports.
bouncer.memcached.servers=memcache1:11211,memcache2:11212

# anything prefixed with c3p0 is sent directly to the c3p0 data source
c3p0.maxIdleTime=1800

TODO

  • update to Jetty 7 when it comes out
  • clean up the authentication code
  • add integration test (how to set up DB/memcache?)
  • audit logging, with detail/log split
  • charset normalization
  • move authentication out to something like Grendel
  • accept OAuth credentials
  • ensure well-formedness of application/json, application/xml, and application/x-www-form-urlencoded entities (maybe using
    VTD-XML and Jackson?)
  • validate content-length, etc.
  • ingress/egress filtering with customizable responses
  • client-timeout tarpit for total losers, but we'd have to see how it behaves
  • IP filtering
  • URI/method blocking
  • on-the-wire entity rewriting (e.g., *** for password)
  • rate limiting based on IP, user, user-agent, OAuth, client cert
  • limit response entity size

bouncer's People

Contributors

bgreenlee avatar codahale avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.