<div class="gmail_quote">On Tue, Mar 23, 2010 at 7:06 AM, Mike Loosbrock <span dir="ltr"><<a href="mailto:mloosbro@bnet.bethel.edu">mloosbro@bnet.bethel.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Excerpts from Alan DeKok's message of Mon Mar 22 11:48:40 -0500 2010:<br>
<div class="im">> Mike Loosbrock wrote:<br>
><br>
> > I thought about getting the user's groups by fetching the multi-<br>
> > valued 'memberOf' attribute from AD and then copying it to the<br>
> > control list via ldap.attrmap. But I don't see any way to then<br>
> > make rlm_sql use that attribute in an authorization query (at<br>
> > least in any sort of useful manner).<br>
><br>
> If it's an attribute, the SQL module can use it. See "man unlang" for<br>
> how attributes are addressed.<br>
><br>
> SELECT ... from ... where %{control:My-Attr...}<br>
<br>
</div>You're right, though I forgot to mention I want to support multiple group<br>
memberships. Building upon your idea, could I do something like this:<br>
<br>
1.) Populate the usergroup table with one record for each group I want to<br>
support. (This lets me prioritize the groups).<br>
<br>
2.) Use rlm_ldap to fetch group membership via the 'memberOf' AD attribute.<br>
<br>
3.) Use ldap.attrmap to map 'memberOf' to control:My-Groups.<br>
<br>
3.) Use a custom perl module to build a SQL query string that simply<br>
returns a record for each group in control:My-Groups. In pseudo-code:<br>
control:My-Query =<br>
SELECT groupname<br>
FROM ${usergroup_table}<br>
WHERE groupname IN ( '%{My-Groups[0]', '%{My-Groups[1]}', ... )<br>
ORDER BY priority<br>
<br>
4.) In rlm_sql, set group_membership_query = "%{control:My-Query}".<br>
<br>
Are steps 3 and 4 really as dirty and wrong as they look? What kind of<br>
performance hit am I looking at?<br></blockquote><div><br>This is the way we do it.<br><br><a href="http://lists.freeradius.org/mailman/htdig/freeradius-users/2009-November/msg00001.html">http://lists.freeradius.org/mailman/htdig/freeradius-users/2009-November/msg00001.html</a><br>
<br>Then everything is driven out of LDAP (eDirectory, but AD should work just the same) without extending the schema.<br><br>And then to do the "security" you use the postauth_users to say which LDAP group you need to be to allow you to access which Hostgroup and get what attributes in the Access-Accept response. With the last line in the postauth_users being "access-reject" since it hadn't matched any of the groups beforehand.<br>
<br>Easy!<br><br></div></div>