comparison development.ini @ 8886:3d7ba590f6f5

auth: only use X- headers instead of REMOTE_ADDR if explicitly told so in remote_addr_header Before, X-Forwarded-For (and others) headers would *always* be trusted blindly, also in setups without a proxy server. It would thus in some cases be possible for users to fake their IP, and thus potentially be possible to bypass IP restrictions configured in Kallithea. Fixed by making it configurable which WSGI environment variable to use for the remote address. Users can configure remote_addr_header to for example HTTP_X_FORWARDED_FOR instead of using the default REMOTE_ADDR. This change is a bit similar to what is going on in the https_fixup middleware, but is doing a bit more of what for example is happening in similar code in werkzeug/middleware/proxy_fix.py .
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 09 May 2021 22:34:02 +0200
parents fb40978c1afb
children 070b8c39736f
comparison
equal deleted inserted replaced
8885:f08fbf424898 8886:3d7ba590f6f5
109 app_instance_uuid = development-not-secret 109 app_instance_uuid = development-not-secret
110 110
111 ## cut off limit for large diffs (size in bytes) 111 ## cut off limit for large diffs (size in bytes)
112 cut_off_limit = 256000 112 cut_off_limit = 256000
113 113
114 ## WSGI environment variable to get the IP address of the client (default REMOTE_ADDR)
115 #remote_addr_variable = HTTP_X_FORWARDED_FOR
116
114 ## always pretend the client connected using HTTPS (default false) 117 ## always pretend the client connected using HTTPS (default false)
115 #force_https = true 118 #force_https = true
116 119
117 ## use Strict-Transport-Security headers (default false) 120 ## use Strict-Transport-Security headers (default false)
118 #use_htsts = true 121 #use_htsts = true