A system written in Golang to help ops team to automate the process of mapping Vault groups to LDAP Groups.

Vault LDAP Helper

Vault LDAP helper works by listing all the members from a LDAP group and adding those members into a Vault group as mentioned in the config below. So you specify group name to a groupFilter(LDAP query).

This is important to note that a user has to be logged in once into Vault before he will be added to the Vault group by this utility.

This process runs every 3hrs. as it is also configurable from the timeInterval variable in config.yaml

Build

make

Run

vault_ldap_helper -config=

Configs

Create a config.yaml file and pass this file as an argument as stated above. The config has been defined in detail below.

vault:
  url: ""                                               : VAULT SERVERS URL
  getEntitiesAPI: "/v1/identity/entity/id?list=true"    : KEEP THEM AS IT IS UNLESS VAULT API CHANGES
  getVaultGroupsAPI: "/v1/identity/group/id?list=true"  : KEEP THEM AS IT IS UNLESS VAULT API CHANGES
  getVaultGroupByIDAPI: "/v1/identity/group/id/"        : KEEP THEM AS IT IS UNLESS VAULT API CHANGES
  updateVaultGroupByIDAPI: "/v1/identity/group/id/"     : KEEP THEM AS IT IS UNLESS VAULT API CHANGES
  getSyncLockAPI: "/v1/kv/vault_ldap_helper"            : *1
  updateSyncLockAPI: "/v1/kv/vault_ldap_helper"         : *2
  token: ""                                             : VAULT ROOT TOKEN *3
  httpTimeout: 3

timeInterval: 3                                         : *4
ldapCacheExpiration: 3                                  : *5

groups:                                                 : *6
  - 
    name: "group1"
    groupFilter: ""
  - 
    name: "group2"
    groupFilter: ""

ldap:
  hosts:                                                : LDAP SERVERS HOST NAMES
    - "ldap1.com"
    - "ldap2.com"
    - "ldap3.com"
  port: 389                                             : LDAP PORT
  base: ""                                              : LDAP BASE VALUE


  *1 -  We added sync lock concept to get rid of race condition between multiple running instances 
        of this process. We do it by storing a key-value pair lock in the vault itself. This api is
        for getting that lock value and *2 is for updating the lock value. (It's a binary lock 
        having value 0 & 1).
        
        vault_ldap_helper is a dictionary in Vault KV Secret Engine.
            {
              "lock": 1
            }

  *3 -  As creating and updating a group and adding removing members in a group is root operation 
        so we require root token for it. Decide with the team how you distribute root token to 
        this process and keep it safe.

  *4 -  This value corresponds to time interval (in hrs) at which this utility repeats it's 
        processes. As here its 3 so it repeats every 3 hrs. 

  *5 -  We maintain cache for ldap information. So, this is the expiration time for that cache.

  *6 -  The groups section is a mapping. 

        'name' corresponds to the Group name in the Vault.
        'groupFilter' corresponds to the LDAP query for listing all members in a group. 

        So once you have all the members from the LDAP group those members will be added in the 
        group in Vault given those members have logged in once into Vault.  
Owner
Rahul Indra
SRE @media-net, GSoC '20 @CERN, previously @codeIIEST
Rahul Indra
Similar Resources

The minilock file encryption system, ported to pure Golang. Includes CLI utilities.

The minilock file encryption system, ported to pure Golang. Includes CLI utilities.

Go-miniLock A pure-Go reimplementation of the miniLock asymmetric encryption system. by Cathal Garvey, Copyright Oct. 2015, proudly licensed under the

Nov 28, 2022

Sekura is an Encryption tool that's heavily inspired by the Rubberhose file system.

It allows for multiple, independent file systems on a single disk whose existence can only be verified if you posses the correct password.

Oct 16, 2022

Ransomware: a type of malware that prevents or limits users from accessing their system

Ransomware: a type of malware that prevents or limits users from accessing their system

Ransomware Note 1: This project is purely academic, use at your own risk. I do not encourage in any way the use of this software illegally or to attac

Nov 17, 2021

Ots - The Bhojpur OTS is a software-as-a-service product used as an Object Tracking System based on Bhojpur.NET Platform for application delivery.

Bhojpur OTS - Object Tracking System The Bhojpur OTS is a software-as-a-service product used as an Object Tracking System based on Bhojpur.NET Platfor

Sep 26, 2022

Arche - Smart Hybrid Workforce Manager: A system that aims to provide companies an easy to use platform for managing company resources by allowing employees to book company spaces and resources.

Arche - Smart Hybrid Workforce Manager: A system that aims to provide companies an easy to use platform for managing company resources by allowing employees to book company spaces and resources.

Description Smart Hybrid Workforce Manager is a system that aims to provide companies an easy to use system for managing company resources by allowing

Dec 8, 2022

A Binance Chain vanity address generator written in golang.

A Binance Chain vanity address generator written in golang.

VaniBNB A Binance Chain vanity address generator written in golang. For example address ending with 0xkat Raw https://github.com/makevoid/vanieth http

Sep 9, 2022

TLS/SSL Tunnel - A modern STunnel replacement written in golang

TLS/SSL Tunnel - A modern STunnel replacement written in golang

go-tunnel - Robust Quic/TLS Tunnel (Stunnel replacement) What is it? A supercharged Stunnel replacement written in golang. is in a sense a proxy enabl

Jan 1, 2023

Stackledger: a new blockchain written in golang

StackLedger Stackledger is a new blockchain. It is written in golang and uses a novel networking stack built from two primitives: channels and extensi

Feb 21, 2022
sops is an editor of encrypted files that supports YAML, JSON, ENV, INI and BINARY formats and encrypts with AWS KMS, GCP KMS, Azure Key Vault, age, and PGP
sops is an editor of encrypted files that supports YAML, JSON, ENV, INI and BINARY formats and encrypts with AWS KMS, GCP KMS, Azure Key Vault, age, and PGP

sops is an editor of encrypted files that supports YAML, JSON, ENV, INI and BINARY formats and encrypts with AWS KMS, GCP KMS, Azure Key Vault, age, and PGP. (demo)

Jan 9, 2023
A plugin that turn hashicorp vault into blockchain wallet.
A plugin that turn hashicorp vault into blockchain wallet.

dq-vault - Hashicorp vault BTC/ETH plugin This vault plugin stores a user's mnemonic inside vault in an encrypted manner. The plugin uses this stored

Dec 7, 2022
Jan 7, 2023
Sidecar container for injecting secrets into configuration files from Hashicorp Vault

talebearer noun A person who spreads scandal or tells secrets; gossip Note This code is not being actively developed, and has not seen substantial cha

Nov 1, 2021
docker plugin use vault as secret provider.

docker plugin vault docker secret plugin for vault provider how to build docker plugin rm -fr plugin/rootfs/.dockerenv plugin/rootfs/* docker build -

Aug 12, 2022
A simple, secure self-destructing message service, using HashiCorp Vault product as a backend
A simple, secure self-destructing message service, using HashiCorp Vault product as a backend

sup3rS3cretMes5age! A simple, secure self-destructing message service, using Has

Mar 5, 2022
Create @tailscale authentication tokens using vault

Vault Secrets Plugin - Tailscale Vault secrets plugins to simplying creation, ma

Nov 21, 2022
Running chaincode in development mode: Smart contract developers that want to iteratively develop and test their chaincode packages without the overhead of the smart contract lifecycle process for every update.

Fabric DEVMODE - Nano bash 1 ORG + 1 PEER + 1 ORDERER Based on fabric-samples/test-network-nano-bash, but using devmode fabric peer Prereqs Follow the

May 14, 2022
hack-browser-data is an open-source tool that could help you decrypt data from the browser.
hack-browser-data is an open-source tool that could help you decrypt data  from the browser.

hack-browser-data is an open-source tool that could help you decrypt data ( password|bookmark|cookie|history|credit card|download

Dec 23, 2022
Tools to help teams develop smart contracts on the Cardano blockchain
Tools to help teams develop smart contracts on the Cardano blockchain

toolkit-for-cardano toolkit-for-cardano simplifies the development of Cardano smart contracts by providing teams with frequently needed tasks: Build T

Dec 19, 2022