Security hardening: Move creds to .env, enable stream logs, rate limits
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -15,3 +15,6 @@ archive/
|
|||||||
|
|
||||||
# OS specific
|
# OS specific
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
# Secrets
|
||||||
|
.env
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ services:
|
|||||||
container_name: home-service-proxy
|
container_name: home-service-proxy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8097:80" # 외부 접속용 포트 (8096과 구분)
|
- "8097:80" # 외부 접속용 포트 (8096과 구분)
|
||||||
- "8443:443" # HTTPS
|
- "8443:443" # HTTPS
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx-ssl.conf:/etc/nginx/nginx.conf:ro
|
- ./nginx-ssl.conf:/etc/nginx/nginx.conf:ro
|
||||||
- ./security.conf:/etc/nginx/conf.d/security.conf:ro
|
- ./security.conf:/etc/nginx/conf.d/security.conf:ro
|
||||||
- ./fail2ban-log:/var/log/nginx
|
- ./fail2ban-log:/var/log/nginx
|
||||||
- ./ssl-certs:/etc/nginx/ssl:ro # SSL 인증서 (선택)
|
- ./ssl-certs:/etc/nginx/ssl:ro # SSL 인증서 (선택)
|
||||||
- ./archive:/etc/nginx/ssl/archive:ro # 시놀로지 와일드카드 인증서
|
- ./archive:/etc/nginx/ssl/archive:ro # 시놀로지 와일드카드 인증서
|
||||||
networks:
|
networks:
|
||||||
- home-service-proxy-net
|
- home-service-proxy-net
|
||||||
|
|
||||||
@@ -37,14 +37,14 @@ services:
|
|||||||
|
|
||||||
# OmniFocus 전용 WebDAV 서버
|
# OmniFocus 전용 WebDAV 서버
|
||||||
webdav:
|
webdav:
|
||||||
image: hacdias/webdav:latest # ARM64 지원
|
image: hacdias/webdav:latest # ARM64 지원
|
||||||
container_name: omnifocus-webdav
|
container_name: omnifocus-webdav
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8090:80" # 내부 WebDAV 포트
|
- "8090:80" # 내부 WebDAV 포트
|
||||||
environment:
|
environment:
|
||||||
- WEBDAV_USERNAME=omnifocus
|
- WEBDAV_USERNAME=${WEBDAV_USERNAME}
|
||||||
- WEBDAV_PASSWORD=7mK9pL3xR8nQ2wE
|
- WEBDAV_PASSWORD=${WEBDAV_PASSWORD}
|
||||||
- TZ=Asia/Seoul
|
- TZ=Asia/Seoul
|
||||||
volumes:
|
volumes:
|
||||||
- ./omnifocus-data:/srv
|
- ./omnifocus-data:/srv
|
||||||
@@ -54,7 +54,3 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
home-service-proxy-net:
|
home-service-proxy-net:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,3 +40,4 @@ logpath = /var/log/nginx/access.log
|
|||||||
maxretry = 3
|
maxretry = 3
|
||||||
bantime = 1800 # 30분 차단
|
bantime = 1800 # 30분 차단
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ events {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stream {
|
stream {
|
||||||
|
log_format basic '$remote_addr [$time_local] '
|
||||||
|
'$protocol $status $bytes_sent $bytes_received '
|
||||||
|
'$session_time';
|
||||||
|
access_log /var/log/nginx/stream.log basic;
|
||||||
|
|
||||||
upstream mac_screen_sharing {
|
upstream mac_screen_sharing {
|
||||||
server 192.168.1.122:5900;
|
server 192.168.1.122:5900;
|
||||||
}
|
}
|
||||||
@@ -263,7 +268,7 @@ http {
|
|||||||
ssl_session_timeout 10m;
|
ssl_session_timeout 10m;
|
||||||
|
|
||||||
# 보안 제한 (WebDAV용 - 파일 업로드 고려)
|
# 보안 제한 (WebDAV용 - 파일 업로드 고려)
|
||||||
# limit_req zone=webdav burst=200 nodelay;
|
limit_req zone=webdav burst=200 nodelay;
|
||||||
limit_conn perip 50;
|
limit_conn perip 50;
|
||||||
limit_conn perserver 200;
|
limit_conn perserver 200;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user