Coder Social home page Coder Social logo

rabbitmq-ldap-integration's Introduction

RabbitMQ integration with LDAP

The main goal of this guide is to demonstrate, step by step, how to set up RabbitMQ to authenticate and authorize via the LDAP plugin. It starts with a very simple scenario, Only Authentication, which just configures RabbitMQ to authenticate users via LDAP.

Every scenario helps the user launch an OpenLDAP server, import required LDAP entries to work with the scenario and configure RabbitMQ accordingly. It also helps the user verify the configuration.

The guide continues further configuring RabbitMQ with LDAP to secure vhost access, secure resource (i.e. exchanges and queues) access and management plugin access too.

The last scenario, Authentication and Authorization (tags, vhosts, resources), is the most complete one and it is one possible LDAP+RabbitMQ scenario out of the many we may encounter in real-world.

The aim of this repository is to address more scenarios in the future.

Prerequisites to follow this guide

This guide assumes RabbitMQ is running locally (on port 5672 and 15672). It also provides an script to deploy OpenLDAP locally via Docker. Additionally, we need the following prerequisites:

  • ldap tools are installed such as ldapsearch and/or ldapadd.
  • Ruby is installed. We will use it to run some AMQP clients.
  • Python is installed. We will use it to run rabbitmqadmin
  • rabbitadmin is installed. Go to http://localhost:15672/cli/rabbitmqadmin, copy the downloaded file to your preferred location in your PATH

Prerequisites to follow this guide when using RabbitMQ for PCF

If you are currently running RabbitMQ for PCF you can still use this guide. We have written the first scenario called Only Authentication for OpenLDAP running locally and for OpenLDAP running externally, in a separate VM in GCP. The two scenarios only differ on how to configure RabbitMQ for PCF because both share the same mechanisms to set up LDAP which are:

  • Invoke script start.sh to deploy OpenLDAP
  • and invoke script import.sh to import the users and ldap layout required by the scenario

In a nutshell, to run any of the other scenarios in RabbitMQ for PCF, you need to do these 3 simple steps:

  1. Deploy OpenLDAP externally
    cd only-authentication-4-pcf; ./start.sh
  2. Import the scenario's ldap configuration (users and objects),
    e.g. cd authentication-and-tags; ./import.sh
  3. Make sure you have enabled LDAP plugin in RabbitMQ for PCF
  4. Take the scenarios's ldap configuration, e.g. authentication-and-tags/rabbitmq.config and configure RabbitMQ for PCF with it.

Implemented Integration scenarios

Future Integration scenarios

Best Practices | Recommendations

In addition to all the recommendations done in the RabbitMQ LDAP documentation, it is worth keeping an eye on these other ones.

Use rabbitmq-auth-backend-cache

With external authz backends like the LDAP one we highly recommend using https://github.com/rabbitmq/rabbitmq-auth-backend-cache in production because under load RabbitMQ is known to hammer LDAP servers hard enough with queries that they can't keep up.

Check out the scenario Cache Authentication and Authorization backend results.

Properly configure LDAP timeouts

Make sure the connection timeouts in your LDAP server are larger than your configured timeout (auth_ldap.timeout) otherwise your LDAP server may terminate the connection and the ldap plugin may fail to operate afterwards.

Cache LDAP connection to avoid excessive connection churn

LDAP server connections are pooled to avoid excessive connection churn and LDAP server load. By default the pool has up to 64 connections. This can be controlled using the auth_ldap.connection_pool_size . Pooled connections without activity are closed after a period of time configurable via auth_ldap.idle_timeout which by default it is set to 300000 msec.

Monitor log file to detect when RabbitMQ lost connection with LDAP server

TODO : Add more sample log statements and the minimum configuration to enable it

[warning] <0.1777.0> HTTP access denied: rabbit_auth_backend_ldap failed authenticating bob: ldap_connect_error

rabbitmq-ldap-integration's People

Contributors

lukebakken avatar marcialrosales avatar nsarvi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

alexrogalskiy

rabbitmq-ldap-integration's Issues

Help on SSL with LDAP

This tutorial really helped me to understand LDAP and configure the same with RabbitMQ.
Is it possible for clarification around SSL usage, since we will be passing user name and passwords over the network.

While the basic around use_ssl true sounds easy, is there more configuration that needs to be done as part of SSL options to guarantee security standards.

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.