-
Notifications
You must be signed in to change notification settings - Fork 50
Support for Http Proxy Headers #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Users can choose to log the following for http headers in the request logs: * x-forwarded-for * x-forwarded-host * x-forwarded-proto * x-custom-host This requires the environment variable `LOG_SENSITIVE_CONNECTION_DATA` to be set to `true`. If there are no headers, no fields will be added to the request logs. If there are headers, but `LOG_SENSITIVE_CONNECTION_DATA` is set to `false`(default) the values will be logged as 'redacted'.
HA-Proxy can add certain headers for terminated ssl connections [1]. These headers can be added to the request logs if environment variable LOG_SSL_HEADERS is set to be true. Otherwise no fields will be added to the request logs. [1] https://www.haproxy.com/blog/ssl-client-certificate-information-in-http-headers-and-logs/
...g-support-core/src/main/java/com/sap/hcp/cf/logging/common/request/RequestRecordBuilder.java
Show resolved
Hide resolved
Please align indentation method in your PR: RequestLoggingFilterTest.java uses spaces for indentation RequestRecordBuilder.java uses tabs |
The usual indentation should be using spaces as defined in https://github.com/SAP/cf-java-logging-support/blob/master/eclipse-formatter-settings.xml. Unfortunately, I once formatted several files using tabs. I reformatted the RequestRecordBuilder as a whole. I do not want to run the formatter over the whole repository, since this breaks file history too much for me. |
fine for me., thanks for the pointer. Just got confused by different indentation methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
cf-java-logging-support-core/beats/request-metrics/etc/fields.yml
Outdated
Show resolved
Hide resolved
cf-java-logging-support-core/beats/request-metrics/etc/fields.yml
Outdated
Show resolved
Hide resolved
cf-java-logging-support-core/beats/request-metrics/etc/fields.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: Christian Dinse <[email protected]>
This PR addresses several http headers, that may be generated by reverse proxies for incoming http requests. They are added to the request logs generated by the library, provided that certain environment variables are set. See the commit messages for details. The documentation will be changed accordingly.