<div dir="ltr"><div>Currently running Shibboleth IDP 3.3.1. I've managed to get most things working by searching the the mailing list archive and google but I'm stuck on this one.</div><div><br></div><div>I'm running Jetty 9.3.16 with HAProxy in front of it sending x-forwarded-for header.</div><div><br></div><div>I enabled the http-forwarded module in jetty, which adds the ForwardedRequestCustomizer and I uncommented jetty.httpConfig.forwardedForHeader=X-Forwarded-For.</div><div><br></div><div>I even tried manually adding the below:</div><div><Call name="addCustomizer"></div><div>   <Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer" /></Arg></div><div></Call></div><div><br></div><div>I read up on MDC here: <a href="https://logback.qos.ch/manual/mdc.html">https://logback.qos.ch/manual/mdc.html</a> and added this piece to my shibboleth-idp/webapp/WEB-INF/web.xml:</div><div><br></div><div><pre class="gmail-prettyprint gmail-source" style="padding:2px;margin-top:0px;margin-bottom:0px;background:rgb(245,245,245);font-family:courier,"ms courier new",prestige,monospace;border-top:1px solid rgb(136,136,136);border-bottom:1px solid rgb(136,136,136);color:rgb(0,0,0);font-size:medium"><span class="gmail-tag" style="color:rgb(0,0,136)"><filter></span><span class="gmail-pln"><br>  </span><span class="gmail-tag" style="color:rgb(0,0,136)"><filter-name></span><span class="gmail-pln">MDCInsertingServletFilter</span><span class="gmail-tag" style="color:rgb(0,0,136)"></filter-name></span><span class="gmail-pln"><br>  </span><span class="gmail-tag" style="color:rgb(0,0,136)"><filter-class></span><span class="gmail-pln"><br>    ch.qos.logback.classic.helpers.MDCInsertingServletFilter<br>  </span><span class="gmail-tag" style="color:rgb(0,0,136)"></filter-class></span><span class="gmail-pln"><br></span><span class="gmail-tag" style="color:rgb(0,0,136)"></filter></span><span class="gmail-pln"><br></span><span class="gmail-tag" style="color:rgb(0,0,136)"><filter-mapping></span><span class="gmail-pln"><br>  </span><span class="gmail-tag" style="color:rgb(0,0,136)"><filter-name></span><span class="gmail-pln">MDCInsertingServletFilter</span><span class="gmail-tag" style="color:rgb(0,0,136)"></filter-name></span><span class="gmail-pln"><br>  </span><span class="gmail-tag" style="color:rgb(0,0,136)"><url-pattern></span><span class="gmail-pln">/*</span><span class="gmail-tag" style="color:rgb(0,0,136)"></url-pattern></span><span class="gmail-pln"><br></span><span class="gmail-tag" style="color:rgb(0,0,136)"></filter-mapping></span><span class="gmail-pln"> </span></pre></div><div><br></div><div>Edited shibboleth-idp/logback.xml and changed the line to be:</div><div><br></div><div><Pattern>%X{req.xForwardedFor}|%X{req.remoteHost}|%msg%n</Pattern><br></div><div><br></div><div>But I'm still not getting anything in the idp-audit.log for the IP address.</div><div><br></div><div>I know the x-forwarded-for header is coming through to jetty because I'm using it to log the IPs in jetty's access log. I also have another jetty app running that is also ingesting the x-forwarded-for just fine.</div><div><br></div><div>Any help would be greatly appreciated. An example would be amazing!</div><div><br></div><div>Thanks again!</div><div><br></div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>~Matt</div></div></div></div></div></div>
</div>