Improve security documentation based on Context7 review

aws-ses-setup.md:
- Add SPF records for email authentication
- Add DMARC policy configuration
- Add bounce/complaint handling with SNS
- Add DNS verification commands

n8n-setup-guide.md:
- Use official Docker registry (docker.n8n.io)
- Add N8N_ENCRYPTION_KEY requirement
- Add N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS
- Add N8N_PUBLIC_API_DISABLED option
- Add security headers to nginx config
- Add healthcheck configuration

gitea-setup.md:
- Add password policy (MIN_PASSWORD_LENGTH, PASSWORD_COMPLEXITY)
- Add argon2 password hashing
- Add DISABLE_GIT_HOOKS for security
- Add Docker Secrets configuration
- Add file-based secret management (SECRET_KEY_URI)
- Add REVERSE_PROXY_TRUSTED_PROXIES setting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-01-16 00:45:40 +09:00
parent 49fe96775a
commit bafc79c81b
3 changed files with 245 additions and 11 deletions

View File

@@ -82,7 +82,12 @@ GITEA_ROOT_URL=https://your-domain.com
GITEA_HTTP_PORT=3000
GITEA_SSH_PORT=2222
# Security (automatically generated)
# Security - 파일 기반 Secret 권장 (환경변수 노출 방지)
# docker-compose에서 secrets 사용 시:
# GITEA__security__SECRET_KEY__FILE=/run/secrets/gitea_secret_key
# GITEA__security__INTERNAL_TOKEN__FILE=/run/secrets/gitea_internal_token
# 환경변수 방식 (개발용)
GITEA_SECRET_KEY=your_secret_key
GITEA_INTERNAL_TOKEN=your_internal_token
@@ -95,6 +100,75 @@ GITEA_ADMIN_EMAIL=admin@your-domain.com
GITEA_ADMIN_PASSWORD=secure_password
```
### 보안 강화 설정 (app.ini)
프로덕션 환경에서 아래 설정을 `app.ini` 또는 환경변수로 추가:
```ini
[security]
; 비밀번호 정책 강화
MIN_PASSWORD_LENGTH = 10
PASSWORD_COMPLEXITY = lower,upper,digit
PASSWORD_HASH_ALGO = argon2
; Git Hooks 비활성화 (보안 강화)
DISABLE_GIT_HOOKS = true
; 리버스 프록시 신뢰 설정
REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128
; Secret 파일 기반 관리 (권장)
SECRET_KEY_URI = file:/etc/gitea/secret_key
INTERNAL_TOKEN_URI = file:/etc/gitea/internal_token
[service]
; 회원가입 비활성화 (필요시)
DISABLE_REGISTRATION = true
; 로그인 필수
REQUIRE_SIGNIN_VIEW = true
; 이메일 비공개 기본값
DEFAULT_KEEP_EMAIL_PRIVATE = true
[repository.signing]
; 커밋 서명 설정
SIGNING_KEY = default
INITIAL_COMMIT = always
```
### Docker Secrets 사용 (프로덕션 권장)
```yaml
# docker-compose.yml
services:
gitea:
image: gitea/gitea:latest-rootless
environment:
- GITEA__security__SECRET_KEY__FILE=/run/secrets/gitea_secret_key
- GITEA__security__INTERNAL_TOKEN__FILE=/run/secrets/gitea_internal_token
- GITEA__database__PASSWD__FILE=/run/secrets/db_password
secrets:
- gitea_secret_key
- gitea_internal_token
- db_password
secrets:
gitea_secret_key:
file: ./secrets/secret_key
gitea_internal_token:
file: ./secrets/internal_token
db_password:
file: ./secrets/db_password
```
```bash
# Secret 파일 생성
mkdir -p secrets
openssl rand -base64 32 > secrets/secret_key
openssl rand -base64 32 > secrets/internal_token
openssl rand -base64 24 > secrets/db_password
chmod 600 secrets/*
```
### Advanced Configuration
For advanced settings, modify: