since I also would have appreciated a more helpful example in rundeck docs, I give my contribution to this topic in the hope that it could save a bit of time to someone else in the same situation
In my company we use MS Active Directory as LDAP server, and normally we don't base authorization features on LDAP groups.
In fact other OSS tools in our chain (such as Jenkins and Artifactory) use LDAP just for authentication purpose. Authorization is normally fully delegated to the tool itself. Not in the case of Rundeck though...
Said that, I finally solved the problem as follows.
In my rundeck RPM installation I created a /etc/rundeck/jaas-multiauth-loginmodule.conf file like this:
multiauth {
com.dtolabs.rundeck.jetty.jaas.JettyCachingLdapLoginModule sufficient
debug="true"
contextFactory="com.sun.jndi.ldap.LdapCtxFactory"
bindPassword="mybinduserpassword"
authenticationMethod="simple"
forceBindingLogin="true"
userBaseDn="dc=myadserver,dc=domain,dc=it"
userRdnAttribute="displayName"
userIdAttribute="sAMAccountName"
userPasswordAttribute="pwdLastSet"
userObjectClass="Person"
roleBaseDn="dc=myadserver,dc=domain,dc=it"
roleNameAttribute="cn"
roleMemberAttribute="member"
roleObjectClass="group"
cacheDurationMillis="300000"
reportStatistics="true";
org.mortbay.jetty.plus.jaas.spi.PropertyFileLoginModule required
debug="true"
file="/etc/rundeck/realm.properties";
};
I updated the RDECK_JVM setting in /etc/rundeck/profile file accordingly:
export RDECK_JVM="-Djava.security.auth.login.config=/etc/rundeck/jaas-multiauth-loginmodule.conf \
-Dloginmodule.name=multiauth \
-Drdeck.config=/etc/rundeck \
-Drdeck.base=/var/lib/rundeck \
-Drundeck.server.configDir=/etc/rundeck \
-Dserver.datastore.path=/var/lib/rundeck/data \
-Drundeck.server.serverDir=/var/lib/rundeck \
-Drdeck.projects=/var/rundeck/projects \
-Drdeck.runlogs=/var/lib/rundeck/logs \
-Drundeck.config.location=/etc/rundeck/rundeck-config.properties \
-Djava.io.tmpdir=$RUNDECK_TEMPDIR"
and I modified the /etc/rundeck/admin.aclpolicy file adding an LDAP group (named 'MyLDAPGroup') my LDAP user is member of, like this
description: Admin, all access.
context:
project: '.*' # all projects
for:
resource:
- allow: '*' # allow read/create all kinds
adhoc:
- allow: '*' # allow read/running/killing adhoc jobs
job:
- allow: '*' # allow read/write/delete/run/kill of all jobs
node:
- allow: '*' # allow read/run for all nodes
by:
group: [admin,MyLDAPGroup]
---
description: Admin, all access.
context:
application: 'rundeck'
for:
resource:
- allow: '*' # allow create of projects
project:
- allow: '*' # allow view/admin of all projects
by:
group: [admin, MyLDAPGroup]
Hope this can help
Bye
Marco