Increase security level on production enviroment
- Lingua principale
- TypeScript
- Stelle
- 6
- Fork
- 3
- Merge medio
- 3g 17h
- PR unite (30g)
- 15
Descrizione
## Summary
Change configurations of raspberry pi, nginx and docker to increase security level on production enviroment (on raspberry). Currently, using cloudflare gives good protection, but the raspberry remains vulnerable if its public ip is discovered.
## Scope
### What is included:
- Configuration of nginx rate limiting to prevent API abuse [(see here)](https://nginx.org/en/docs/http/ngx_http_limit_req_module.html)
- Adding essential [http security headers](https://securityheaders.com/) to the nginx reverse proxy.
- using non-root user inside docker containers
- make sure that traffic from end user to cloudflare and from cloudlfare to origin server is encrypted ([edge certificates](https://developers.cloudflare.com/ssl/concepts/#ssltls-certificate))
## [Acceptance criteria](https://www.atlassian.com/work-management/project-management/acceptance-criteria)
- [ ] nginx rejects requests exceeding the defined rate limit with an http 429 status code.
- [ ] security headers are present in all outgoing responses from the reverse proxy.
- [ ] firewall drops all direct incoming traffic on ports 80/443 that does not originate from a cloudflare.
- [ ] The postgres database is unreachable from outside the docker network on prod
- [ ] traffic from cloudflare to origin server (raspberry pi) is also encrypted
- [ ] All Dockerfiles use non-root user.
## Implementation tasks list
- [ ] #PR1
- [ ] #PR2
## Notes
important context
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.