-
Notifications
You must be signed in to change notification settings - Fork 48
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
Only allow x-trusted-proxy header to be valid for so long #574
base: devel
Are you sure you want to change the base?
Only allow x-trusted-proxy header to be valid for so long #574
Conversation
Quality Gate passedIssues Measures |
@@ -42,6 +44,15 @@ def validate_x_trusted_proxy_header(header_value: str, ignore_cache=False) -> bo | |||
logger.warning("Failed to validate x-trusted-proxy-header, malformed, expected value to contain a -") | |||
return False | |||
|
|||
# Validate that the header has been cut within the last 300ms (by default) | |||
try: | |||
if time.time_ns() - int(timestamp) > get_setting('trusted_header_timeout_in_ns', 300000000): |
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.
This requires that the clocks from the proxy server and the local server (using this auth class) are synced. I just want to have that in writing here.
5e9c507
to
9b48da6
Compare
Quality Gate passedIssues Measures |
No description provided.