Эх сурвалжийг харах

HUE-4454 [security] Disclosure of Web Server Information

Prakash Ranade 9 жил өмнө
parent
commit
9f52773

+ 3 - 1
desktop/core/src/desktop/lib/wsgiserver.py

@@ -1523,7 +1523,9 @@ class CherryPyWSGIServer(object):
     nodelay = True
     nodelay = True
     
     
     ConnectionClass = HTTPConnection
     ConnectionClass = HTTPConnection
-    environ = {}
+    environ = {
+        "SERVER_SOFTWARE": os.getenv('SERVER_SOFTWARE')
+    }
     
     
     # Paths to certificate and private key files
     # Paths to certificate and private key files
     ssl_certificate = None
     ssl_certificate = None

+ 2 - 0
desktop/core/src/desktop/settings.py

@@ -467,6 +467,8 @@ SKIP_SOUTH_TESTS = True
 # Set up environment variable so Kerberos libraries look at our private
 # Set up environment variable so Kerberos libraries look at our private
 # ticket cache
 # ticket cache
 os.environ['KRB5CCNAME'] = desktop.conf.KERBEROS.CCACHE_PATH.get()
 os.environ['KRB5CCNAME'] = desktop.conf.KERBEROS.CCACHE_PATH.get()
+if not os.getenv('SERVER_SOFTWARE'):
+  os.environ['SERVER_SOFTWARE'] = 'apache'
 
 
 # If Hue is configured to use a CACERTS truststore, make sure that the
 # If Hue is configured to use a CACERTS truststore, make sure that the
 # REQUESTS_CA_BUNDLE is set so that we can use it when we make external requests.
 # REQUESTS_CA_BUNDLE is set so that we can use it when we make external requests.