voxpupuli / puppet-jira

Atlassian JIRA Puppet Module
https://forge.puppet.com/puppet/jira
Apache License 2.0
62 stars 144 forks source link

Please allow adding properties to server.xml that would add the clients' real ip address to jira access logs when running behind a proxy server #305

Closed jfabales closed 3 years ago

jfabales commented 5 years ago

Hi wonderful team, This is not an issue but more of a request. When jira is running behind a proxy server, the client ip address reflected in the jira access logs is all coming from the localhost ip. It would be better to have the clients' real ip addresses inside jira access logs specially when you feed the logs into logstash or filebeat. The configuration needed should be added to the server.xml file, please see example below:

            <Valve 
                className="org.apache.catalina.valves.RemoteIpValve"
                internalProxies="<proxy server ip addresses e.g. 10\.10\.10\.10|127\.0\.0\.1" />
            <Valve className="org.apache.catalina.valves.AccessLogValve" requestAttributesEnabled="true"
                   pattern="%a %{jira.request.id}r %{jira.request.username}r %t &quot;%m %U%q %H&quot; %s %b %D &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot; &quot;%{jira.request.assession.id}r&quot;"/>
        </Engine>

The required changes are:

Hoping this change is considered. Thanks!

oranenj commented 3 years ago

Hi,

this use case should already be possible to accomplish slightly differently with the master branch; see the $tomcat_accesslog_enable_xforwarded_for parameter