Giter Site home page Giter Site logo

cf-postgresql-broker's Introduction

PostgreSQL* Service Broker for the CLOUD FOUNDRY* Platform


Usage

Using PostgreSQL requires having Go installed, also using Linux distributions is recommended. In addition secure keypair will be required in order to deploy this application as it works using HTTPS only(HTTP protocol not supported).

Flags: -key The filepath to the ssl key. -cert The filepath to the ssl certificate.

go get github.com/cloudfoundry-community/cf-postgresql-broker
cd $GOPATH/get github.com/cloudfoundry-community/cf-postgresql-broker
# build application
go build -ldflags "-w"
# add execution permissions
chmod u+x cf-postgresql-broker
# deploy broker by passing key and certificate files on arguments
./cf-postgresql-broker -key=keyFILE -cert=certFILE

Generating key and certificate

In order to deploy the service broker using HTTPS, an x509 encoded RSA certificate will be needed. For security, allowed certificates must be at least 2048 bit RSA, signed with SHA256, SHA384 or SHA512 algorithms. Using RSA:2048 with SHA384 is recommended.

To generate a RSA:2048 key pair using SHA384 use openssl command on Linux systems.

RSA:2048 signed with SHA384

openssl req -x509 -sha384 -new -nodes -newkey rsa:2048 -keyout key.pem -out cert.pem

Enable http basic Auth with Nginx*

Once the software is running locally, you will need to enable http Basic Authentication prior to adding the service broker on Cloud Foundry*, you may accomplish this with Ngnix, altough there may be other alternatives, this software is tested with Ngnix*. The following steps assume Ubuntu 16.04 is being used and that Nginx* has been properly installed.

  • Create additional ssl key and certificate using the instructions described at "Generating key and certificate", make sure to use the recommended security policies previously.
  • Create user and password for http Basic Authentication, the tool will then request for a password.
$ sudo htpasswd -c /etc/nginx/.htpasswd someuser
  • Create a site configuration for Nginx*
sudo vi /etc/nginx/sites-available/broker.conf
  • Enter the configuration for the broker site, you may use the following template and add any additional settings, remember to use the recommended ciphers for your key and certificate.
server {
	listen $PORT
	ssl_certificate $PATH_TO_CERTIFICATE;
	ssl_certificate_key $PATH_TO_CERTIFICATE_KEY;

	ssl on;

	location / {
		proxy_set_header X-Real-IP $REMOTE_ADDR;
		proxy_set_header X-Forwarded-For $REMOTE_ADDR;
		proxy_set_header Host $HOST;
		proxy_pass https://$BROKER_ADDR:$BROKER_PORT;

		auth_basic "Restricted";
		auth_basic_user_file /etc/nginx/.htpasswd;
	}
}
  • Restart Nginx*
sudo systemctl restart nginx

Integration with the CLOUD FOUNDRY* Platform

In oder to add the broker on Cloud Foundry* you will require administrator privileges. Follow official documentation to learn how to add the broker using "cf" tool.

API documentation

The software follows the specification of the Service Broker API, please check https://docs.cloudfoundry.org/services/api.html

cf-postgresql-broker's People

Stargazers

App Service avatar Stephane Jolicoeur avatar

Watchers

Wayne E Seguin avatar Bill Chapman avatar Mike Heath avatar Matt Reider avatar Juan Antonio Breña Moral avatar David Laing avatar David Ehringer avatar Mevan Samaratunga avatar Ioannis Polyzos avatar Alex Heneveld avatar Eduardo Aceituno avatar Marcela Bonell avatar Colin Humphreys avatar James Cloos avatar Olivier Orand avatar Johannes Hiemer avatar Sylvain Gibier avatar Cornelia Davis avatar Van Nguyen avatar Ronak Banka avatar Takeshi Morikawa avatar Amulya Sharma avatar Benjamin Gandon avatar Xiujiao Gao avatar Guillaume Berche avatar Fermin Ordaz avatar  avatar clarence avatar  avatar Pierre Oblin avatar Arthur Halet avatar Weian Deng avatar Luke Woydziak avatar Balajee Nagarajan avatar Josh Quintana avatar Jian Huang avatar Mo Mo avatar  avatar Justin Carter avatar Lynn Lin avatar Nguyen Dang Minh avatar Andrei Krasnitski avatar Chris Clark avatar Piotr Milewski avatar Chris McGowan avatar  avatar Norman Abramovitz avatar  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.