首页 > 解决方案 > How to write Vault LDAP Auth Configuration from a json config file?

问题描述

In my hashicorp vault container. I want to use the the ldap auth method to allows authentication https://www.vaultproject.io/docs/auth/ldap.html

I'm writing a shell script that should write vault ldap configuration from a json file. My vault ldap configuration with the connection parameters is stored in the same directory and is named as parameters.json. What is the correct syntax to load LDAP connection parameters from an external file?

vault auth enable ldap
vault write auth/ldap/config config=@parameters.json

The above command does not overwrite the values from this file.

标签: bashshellldaphashicorp-vault

解决方案


通过将其替换为带有键值对的文本值(key1=value 1 .... key n..value n)使其工作

vault write auth/ldap/config binddn=@binddn bindpass=@bindpass url =@url

显然ldap连接属性需要一个个指定,无法导入json文件解析


推荐阅读