| ... | ... | @@ -42,7 +42,6 @@ sudo nano /etc/nginx/sites-available/default |
|
|
|
```
|
|
|
|
location / {
|
|
|
|
proxy_pass http://10.166.0.2:8080;
|
|
|
|
add_header "X-XSS-Protection" "1; mode=block";
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
| ... | ... | @@ -64,11 +63,24 @@ server { |
|
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
|
|
location / {
|
|
|
|
proxy_pass http://10.166.0.2:5000;
|
|
|
|
add_header "X-XSS-Protection" "1; mode=block";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Tietoturva
|
|
|
|
|
|
|
|
Eri hyökkäyksiltä puolustautuminen onnistuu lisäämällä konfiguraatioon http-otsikkoja
|
|
|
|
|
|
|
|
default tiedosto, lisätään server sisään kohtiin 443 ja 8443:
|
|
|
|
|
|
|
|
```
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
|
|
add_header "X-XSS-Protection" "1; mode=block";
|
|
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
|
|
add_header X-Content-Type-Options nosniff;
|
|
|
|
add_header Expect-CT "enforce, max-age=300, report-uri='https://tacs-testing.cf'";
|
|
|
|
```
|
|
|
|
|
|
|
|
Palvelun saa käynnistettyä uudelleen komennolla
|
|
|
|
|
|
|
|
```bash
|
| ... | ... | |
| ... | ... | |