Açıklama Yok

nginx.conf 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. # IRIS Source Code
  2. # Copyright (C) 2021 - Airbus CyberSecurity (SAS)
  3. # ir@cyberactionlab.net
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU Lesser General Public
  7. # License as published by the Free Software Foundation; either
  8. # version 3 of the License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # Lesser General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Lesser General Public License
  16. # along with this program; if not, write to the Free Software Foundation,
  17. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. worker_processes auto;
  19. pid /var/run/nginx.pid;
  20. events {
  21. worker_connections 1024;
  22. }
  23. http {
  24. map $request_uri $csp_header {
  25. default "default-src 'self' https://analytics.dfir-iris.org; script-src 'self' 'unsafe-inline' https://analytics.dfir-iris.org; style-src 'self' 'unsafe-inline'; img-src 'self' data:;";
  26. }
  27. include /etc/nginx/mime.types;
  28. default_type application/octet-stream;
  29. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  30. '$status $body_bytes_sent "$http_referer" '
  31. '"$http_user_agent" "$http_x_forwarded_for"';
  32. access_log /var/log/nginx/access.log main;
  33. error_log /var/log/nginx/error.log debug;
  34. server_tokens off;
  35. sendfile on;
  36. tcp_nopush on;
  37. tcp_nodelay on;
  38. types_hash_max_size 2048;
  39. types_hash_bucket_size 128;
  40. proxy_headers_hash_max_size 2048;
  41. proxy_headers_hash_bucket_size 128;
  42. proxy_buffering on;
  43. proxy_buffers 8 16k;
  44. proxy_buffer_size 4k;
  45. client_header_buffer_size 2k;
  46. large_client_header_buffers 8 64k;
  47. client_body_buffer_size 64k;
  48. client_max_body_size 100M;
  49. reset_timedout_connection on;
  50. keepalive_timeout 90s;
  51. client_body_timeout 90s;
  52. send_timeout 90s;
  53. client_header_timeout 90s;
  54. fastcgi_read_timeout 90s;
  55. # WORKING TIMEOUT FOR PROXY CONF
  56. proxy_read_timeout 90s;
  57. uwsgi_read_timeout 90s;
  58. gzip off;
  59. gzip_disable "MSIE [1-6]\.";
  60. # FORWARD CLIENT IDENTITY TO SERVER
  61. proxy_set_header HOST $http_host;
  62. proxy_set_header X-Forwarded-Proto $scheme;
  63. proxy_set_header X-Real-IP $remote_addr;
  64. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  65. # FULLY DISABLE SERVER CACHE
  66. add_header Last-Modified $date_gmt;
  67. add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
  68. if_modified_since off;
  69. expires off;
  70. etag off;
  71. proxy_no_cache 1;
  72. proxy_cache_bypass 1;
  73. # SSL CONF, STRONG CIPHERS ONLY
  74. ssl_protocols TLSv1.2 TLSv1.3;
  75. ssl_prefer_server_ciphers on;
  76. ssl_certificate /www/certs/${CERT_FILENAME};
  77. ssl_certificate_key /www/certs/${KEY_FILENAME};
  78. ssl_ecdh_curve secp521r1:secp384r1:prime256v1;
  79. ssl_buffer_size 4k;
  80. # DISABLE SSL SESSION CACHE
  81. ssl_session_tickets off;
  82. ssl_session_cache none;
  83. access_log /var/log/nginx/audit_platform_access.log main;
  84. error_log /var/log/nginx/audit_platform_error.log debug;
  85. server {
  86. listen ${INTERFACE_HTTPS_PORT} ssl;
  87. server_name ${SERVER_NAME};
  88. root /www/data;
  89. index index.html;
  90. error_page 500 502 503 504 /50x.html;
  91. add_header Content-Security-Policy $csp_header;
  92. # SECURITY HEADERS
  93. add_header X-XSS-Protection "1; mode=block";
  94. add_header X-Frame-Options DENY;
  95. add_header X-Content-Type-Options nosniff;
  96. # max-age = 31536000s = 1 year
  97. add_header Strict-Transport-Security "max-age=31536000: includeSubDomains" always;
  98. add_header Front-End-Https on;
  99. location / {
  100. proxy_pass http://${IRIS_UPSTREAM_SERVER}:${IRIS_UPSTREAM_PORT};
  101. location ~ ^/(manage/templates/add|manage/cases/upload_files) {
  102. keepalive_timeout 10m;
  103. client_body_timeout 10m;
  104. send_timeout 10m;
  105. proxy_read_timeout 10m;
  106. client_max_body_size 0M;
  107. proxy_request_buffering off;
  108. proxy_pass http://${IRIS_UPSTREAM_SERVER}:${IRIS_UPSTREAM_PORT};
  109. }
  110. location ~ ^/(datastore/file/add|datastore/file/add-interactive) {
  111. keepalive_timeout 10m;
  112. client_body_timeout 10m;
  113. send_timeout 10m;
  114. proxy_read_timeout 10m;
  115. client_max_body_size 0M;
  116. proxy_request_buffering off;
  117. proxy_pass http://${IRIS_UPSTREAM_SERVER}:${IRIS_UPSTREAM_PORT};
  118. }
  119. }
  120. location /socket.io {
  121. proxy_set_header Host $http_host;
  122. proxy_set_header X-Real-IP $remote_addr;
  123. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  124. proxy_set_header X-Forwarded-Proto $scheme;
  125. proxy_http_version 1.1;
  126. proxy_buffering off;
  127. proxy_set_header Upgrade $http_upgrade;
  128. proxy_set_header Connection "Upgrade";
  129. proxy_pass http://${IRIS_UPSTREAM_SERVER}:${IRIS_UPSTREAM_PORT}/socket.io;
  130. }
  131. location = /50x.html {
  132. root /usr/share/nginx/html;
  133. }
  134. }
  135. }