Code Monkey home page Code Monkey logo

registry-ldap-auth's Introduction

NGINX logo

Introduction

This image provides an LDAP and Active Directory authentication proxy for a Docker registry. It uses an NGINX web server with builtin LDAP and SSL support. It is based on felixbuenemann/nginx-ldap.

The sources including the sample files used in this description can be found on GitHub.

The Docker image can be downloaded at Docker Hub.

Prerequisites

The authentication proxy works with different LDAP servers like ApacheDS or OpenLDAP. It also works with Active Directory. So a container with a running LDAP server is expected. If you need information about creating a container with a test LDAP server please refer to h3nrik/nginx-ldap.

A running Docker registry container is required. Details about the Docker registry can be found at the official Docker registry project page.

You need a valid SSL certificate. It must be known by a trusted CA! No self-signed ones are allowed. Theoretically you could also use self-signed certificates. Therefore the Docker daemon need to be started with the --insecure-registry command line parameter. But this is not recommended.

If you plan to use an LDAP host that is not represented by a Docker container you might want to have a look at the Docker ambassador pattern.

Installation

Assuming your running Docker registry container is named registry and the LDAP container is named ldap. The following steps will add LDAP authentication to your registry.

  1. The SSL certificate files must be copied into a local folder (e.g. /ssl/cert/path). It will be mounted as a volume into the proxy server later. The certificate file must be named docker-registry.crt and the private key file docker-registry.key.

  2. Create an LDAP configuration file named ldap.conf. A sample-ldap.conf file is provided with the image sources. It could look like:

     url ldap://ldap/dc=example,dc=com?samaccountname?sub?(objectClass=user);
     binddn [email protected];
     binddn_passwd secretPassword;
     group_attribute uniquemember;
     group_attribute_is_dn on;
     require group 'cn=docker,ou=groups,dc=example,dc=com';
     require valid_user;
     satisfy all;	
    
  3. Create a Docker container for the authentication proxy. The proxy container expects the registry container to be linked with the name docker-registry. The used NGINX web server configuration can be found in the config folder.

     docker run --name registry-ldap-auth --link ldap:ldap --link registry:docker-registry -v /ssl/cert/path:/etc/ssl/docker:ro -v `pwd`/sample-ldap.conf:/etc/nginx/ldap.conf:ro -p 443:443 -p 5000:5000 -d felixbuenemann/registry-ldap-auth
    

Licenses

This docker image contains compiled binaries for:

  1. The NGINX web server. Its license can be found on the NGINX website.
  2. The nginx-auth-ldap module. Its license can be found on the nginx-auth-ldap module project site.

registry-ldap-auth's People

Contributors

felixbuenemann 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.