<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 15, 2017 at 6:31 PM, Rob Crittenden <span dir="ltr"><<a href="mailto:rcritten@redhat.com" target="_blank">rcritten@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">Andrei Ivanov wrote:<br>
> Hi,<br>
> I'm trying to access the SSL_CLIENT_SAN_IPAddr variables that mod_nss<br>
> should expose, from a Lua authorization script.<br>
> The problem is that it doesn't seem to work :-(<br>
><br>
> Following a suggestion from the users group, I used some RewriteRule to<br>
> expose variables and some are visible, but the client SAN IP addresses<br>
> are not:<br>
><br>
> LuaScope thread<br>
> LuaAuthzProvider remote_ip_in_client_san<br>
> /etc/httpd/authz/authz_check_<wbr>remote_ip_in_client_san.lua<br>
> authz_check_remote_ip_in_<wbr>client_san<br>
> RewriteEngine On<br>
> RewriteRule .* - [E=sanip:%{SSL:SSL_CLIENT_SAN_<wbr>IPAddr_0}]<br>
> RewriteRule .* - [E=c_verify:%{SSL:SSL_CLIENT_<wbr>VERIFY}]<br>
> RewriteRule .* - [E=c_s_dn:%{SSL:SSL_CLIENT_S_<wbr>DN}]<br>
> RewriteRule .* - [E=ssl_ver_if:%{SSL:SSL_<wbr>VERSION_INTERFACE}]<br>
> RewriteRule .* - [E=ssl_ver_lib:%{SSL:SSL_<wbr>VERSION_LIBRARY}]<br>
> <Location /><br>
> Require remote_ip_in_client_san<br>
> #NSSRequire %{REMOTE_ADDR} in %{SSL_CLIENT_SAN_IPaddr}<br>
> #Require expr "%{REMOTE_ADDR} in %{SSL_CLIENT_SAN_IPaddr}"<br>
> </Location><br>
><br>
> The generated log:<br>
> [Wed Feb 15 13:14:07.653866 2017] ssl ver if: mod_nss/1.0.14<br>
> [Wed Feb 15 13:14:07.653871 2017] ssl ver lib: NSS/3.21 Basic ECC<br>
> [Wed Feb 15 13:14:07.653876 2017] client verify: SUCCESS<br>
> [Wed Feb 15 13:14:07.653881 2017] client DN:<br>
> CN=client-with-subjectAltName-<wbr>with-IPs<br>
> [Wed Feb 15 13:14:07.653886 2017] sanip:<br>
><br>
> Initially I hoped that mod_nss would expose all the SAN IP addresses as<br>
> an array (SSL_CLIENT_SAN_IPAddr), but now I've read that it actually<br>
> should create a variable for each, with a suffix<br>
> (SSL_CLIENT_SAN_IPAddr_0), but that doesn't seem to be available either.<br>
><br>
> What am I doing wrong?<br>
> Please help.<br>
<br>
</div></div>Are the variables case-sensitive with rewrite rules? IF so you have a<br>
typo, IPAddr vs IPaddr.<br>
<br>
As far as I can tell the variable should be available.<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
rob<br>
<br>
</font></span></blockquote></div><br><div>I've also tried with SSL_CLIENT_SAN_IPaddr_0, as the source code seems to be using it (as oposed to the documentation), still no luck :-(<br></div>I've checked with SSL_CLIENT_SAN_Email_0 and that works, so it might be an IP address type issue (?)</div></div>