GithubHelp home page GithubHelp logo

flik / haproxy-ssl-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rustygeldmacher/haproxy-ssl-example

0.0 2.0 0.0 120 KB

Example setup for SSL termination and re-encryption

Dockerfile 28.29% JavaScript 71.71%

haproxy-ssl-example's Introduction

Example HAProxy SSL setup

This is a small demonstration of how to terminate SSL at HAProxy, and then re-establish another SSL connection to the backend servers.

Why would you want to do this? Regulatory compliance, mostly. For instance, HIPAA requires that all traffic which transmits PHI be encrypted, regardless of which network it is on. HAProxy can do SSL pass-through, but then you lose useful proxy-ish things like routing based on host, or modifying headers (such as adding the X-Forwarded-For header, which is key for proxied setups). To solve this, we can do a hybrid setup where HAProxy terminates public SSL (the cert that you bought from a CA), does it's work, then re-encrypts the request when it sends it off to a backend server.

For this example, we'll use two different certs: the first one (called xip.io) represents the public-facing cert on the load balancer. The second one, in the web machines, represents an internal self-signed cert that exists solely for encrypting internal traffic.

To run this example, make sure docker and docker-compose are installed.

Then run:

docker-compose build
docker-compose up -d haproxy

To hit the server, go to:

https://a.b.c.d.xip.io

Where a.b.c.d is your docker/boot2docker IP. You'll get some warnings about self-signed certificates, but this is OK.

Open Questions

  • How much extra CPU overhead does this cause?
  • Can we quanitify the real danger of using a self-signed cert internally?

haproxy-ssl-example's People

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.