Skip to content
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

[HOLD] Only allow x-trusted-proxy header to be valid for so long #574

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

john-westcott-iv
Copy link
Member

No description provided.

Copy link

sonarcloud bot commented Aug 19, 2024

@john-westcott-iv john-westcott-iv added the Ready for review This PR is ready for review either initially or comments have been address label Aug 20, 2024
@@ -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):
Copy link
Member

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.

@john-westcott-iv john-westcott-iv changed the title Only allow x-trusted-proxy header to be valid for so long [HOLD] Only allow x-trusted-proxy header to be valid for so long Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:jwt_consumer Ready for review This PR is ready for review either initially or comments have been address
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants