<div dir="ltr">I had previously been using %a in audit.xml but when i was getting no IP, i changed everything around to what I emailed earlier.<div><br></div><div>I revisited ForwardedRequestCustomizer in jetty and it appears adding http-forwarded module wasn't working.</div><div><br></div><div>For anyone else that ever stumbles across this, here is what I did to get it working:</div><div><br></div><div>In jetty.xml in my JETTY_HOME/etc/ (might work in JETTY_BASE but didn't try) I added the below code in the httpConfig block:</div><div><div>      <Call name="addCustomizer"></div><div>        <Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer" /></Arg></div><div>     </Call></div></div><div><br></div><div>Right after the last Set name= and before </New></div><div><br></div><div>In shibboleth-idp/conf/audit.xml:</div><div>I added %a| right before the %T in the shibboleth.AuditFormattingMap block.</div><div><br></div><div>Now the idp-audit.log file has the IP of the x-forwarded-for, as well as the idp-process.log file when someone logs in or out.</div><div><br></div><div>In HAProxy, which I am using as my load balancer, I added "http-request del-header X-Forwarded-For" to the frontend block, so someone on the outside cannot spoof that header. Also make sure to put "option forwardfor" in your backend, so you get the X-Forwarded-For header passed on.</div><div><br></div><div>If there is a better way to do any of this, please let me know.</div><div><br></div><div>Thanks Scott for making me revisit the way I was doing things!</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>~Matt</div></div></div></div></div></div>
<br><div class="gmail_quote">On Tue, Mar 21, 2017 at 7:20 PM, Cantor, Scott <span dir="ltr"><<a href="mailto:cantor.2@osu.edu" target="_blank">cantor.2@osu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 3/21/17, 5:48 PM, "users on behalf of Matt Jamison" <<a href="mailto:users-bounces@shibboleth.net">users-bounces@shibboleth.net</a> on behalf of <a href="mailto:matt@tblinux.com">matt@tblinux.com</a>> wrote:<br>
<br>
>  I read up on MDC here: <a href="https://logback.qos.ch/manual/mdc.html" rel="noreferrer" target="_blank">https://logback.qos.ch/manual/<wbr>mdc.html</a> and added this piece to my shibboleth-idp/webapp/WEB-INF/<wbr>web.xml:<br>
<br>
</span>You don't need that.<br>
<span class=""><br>
> Edited shibboleth-idp/logback.xml and changed the line to be:<br>
<br>
</span>That isn't the name of the MDC variable is that carries the address. Please refer to the idP logging documentation for the MDC values.<br>
<span class=""><br>
> But I'm still not getting anything in the idp-audit.log for the IP address.<br>
<br>
</span>The audit log has a totally different design and you should log additional fields there by adjusting the audit format itself, not changing the logback file. That documentation is also explicit about the field labels for the data you want.<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Scott<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net">users-unsubscribe@shibboleth.<wbr>net</a><br>
</font></span></blockquote></div><br></div></div>