瀏覽代碼

[backend] mask server response header due to security vulnerabilities (#3222)

Co-authored-by: Athithyaa Selvam <aselvam@cloudera.com>
Athithyaa Selvam 2 年之前
父節點
當前提交
b957904c90
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      desktop/core/src/desktop/management/commands/rungunicornserver.py

+ 4 - 0
desktop/core/src/desktop/management/commands/rungunicornserver.py

@@ -116,6 +116,10 @@ def rungunicornserver():
     else:
       ssl_keyfile = conf.SSL_PRIVATE_KEY.get()
 
+  # Hide server name = gunicorn and mask it to apache
+  gunicorn.SERVER_SOFTWARE = 'apache'
+  os.environ['SERVER_SOFTWARE'] = gunicorn.SERVER_SOFTWARE
+
   options = {
       'accesslog': "-",
       'backlog': 2048,