Commit 3469b02
authored
UN-3124 [FIX] : Add security headers and HTTP method restrictions to nginx (#1726)
* feat: Add security headers and HTTP method restrictions to nginx
- Add X-Content-Type-Options header to prevent MIME sniffing
- Add X-Frame-Options header to prevent clickjacking
- Add X-XSS-Protection header for XSS protection
- Add Referrer-Policy header for referrer control
- Disable TRACE and TRACK HTTP methods
- Limit allowed HTTP methods to GET, HEAD, POST in location block
* fix: Remove deprecated X-XSS-Protection header
X-XSS-Protection is deprecated and ignored by modern browsers.
Chrome removed support in 2019. Content-Security-Policy (CSP)
is the recommended replacement for XSS protection.
* fix: Limit HTTP methods to GET and HEAD only
Static file serving only requires GET and HEAD methods.
POST is not needed as API calls go directly to the backend.1 parent 8ddb575 commit 3469b02
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
50 | 64 | | |
51 | 65 | | |
| 66 | + | |
52 | 67 | | |
53 | 68 | | |
0 commit comments