Skip to content

Commit f1f160c

Browse files
committed
PHPC-45: Orchestarte PLAIN/LDAP authentication mechanism
1 parent 337d184 commit f1f160c

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

Vagrantfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Vagrant.configure(2) do |config|
2121

2222
mo.vm.provision "shell", path: "scripts/ubuntu/essentials.sh"
2323
mo.vm.provision "shell", path: "scripts/ubuntu/mongo-orchestration.sh"
24+
mo.vm.provision "shell", path: "scripts/ubuntu/ldap/install.sh"
2425
end
2526

2627
config.vm.define "ldap", autostart: false do |ldap|

scripts/presets/standalone-plain.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "mongod",
3+
"id" : "STANDALONE-PLAIN",
4+
"auth_key": "secret",
5+
"login": "root",
6+
"password": "toor",
7+
"procParams": {
8+
"dbpath": "/tmp/standalone-plain/",
9+
"ipv6": true,
10+
"logappend": true,
11+
"logpath": "/tmp/standalone-plain/m.log",
12+
"journal": true,
13+
"port": 2400,
14+
"setParameter": {"enableTestCommands": 1, "saslauthdPath": "/var/run/saslauthd/mux", "authenticationMechanisms": "MONGODB-CR,PLAIN"}
15+
}
16+
}
17+

scripts/ubuntu/ldap/install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
sudo apt-get -y install ldap-utils libsasl2-modules-ldap sasl2-bin
2+
3+
# setup saslauthd
4+
sudo sed -i 's/MECHANISMS="pam"/MECHANISMS="ldap"/' /etc/default/saslauthd
5+
sudo sed -i 's/START=no/START="yes"/' /etc/default/saslauthd
6+
sudo cp /phongo/scripts/ubuntu/ldap/saslauthd.conf /etc/
7+
sudo service saslauthd restart
8+
9+
testsaslauthd -u bugs -p password -s mongod -f /var/run/saslauthd/mux
10+
#Show your work!
11+
ldapsearch -x -LLL -b dc=10gen,dc=me
12+
ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts
13+

scripts/ubuntu/ldap/saslauthd.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ldap_servers: ldap://192.168.112.20:389
2+
ldap_search_base: ou=Users,dc=10gen,dc=me
3+
ldap_filter: (uid=%u)

0 commit comments

Comments
 (0)