BunnyCDN 엣지 스크립트 보안 구성 문서화 (국가 차단 + CrowdSec + 캡차)

This commit is contained in:
kappa
2026-03-23 14:26:14 +09:00
parent c23aae07e5
commit 3e100e5755

View File

@@ -1,6 +1,6 @@
--- ---
title: BunnyCDN Reference title: BunnyCDN Reference
updated: 2026-03-12 updated: 2026-03-23
tags: [cdn, bunnycdn, infrastructure, reference] tags: [cdn, bunnycdn, infrastructure, reference]
--- ---
@@ -598,6 +598,39 @@ Origin Shield는 CDN 엣지 PoP와 Origin 사이의 **2차 캐싱 레이어**.
--- ---
## 15. 엣지 스크립트 보안 (CrowdSec + 국가 차단)
### 구성
- 스크립트: `crowdsec-bouncer-middleware` (ID: 64811)
- 연결된 Pull Zone: inouter (5316471), actions (5330178)
- 관리: cfb-manager (K3s tools ns)
### 동작 순서
```
요청 → BunnyCDN 엣지
1. 국가 차단 (Cdn-RequestCountryCode 헤더)
- 차단: US,CA,GB,DE,FR,IT,ES,NL,BE,AT,CH,SE,NO,DK,FI,PL,CZ,PT,IE,RO,HU,BG,HR,SK,SI,LT,LV,EE,LU,MT,CY,GR,IS,UA,RU,BY
- 차단 시 403 반환
2. CrowdSec bloom filter (악성 IP 판별)
- bloom filter에 hit → 캡차 또는 403
- cfb-manager가 주기적으로 bloom filter 업데이트
3. 캡차 (Cloudflare Turnstile)
- bloom hit된 IP에게 캡차 제시
- 통과 시 4시간 허용 (DB + 쿠키)
4. 정상 → Origin으로 전달
```
### 주의사항
- BunnyCDN Traffic Manager 국가 차단은 사용하지 않음 (Let's Encrypt/Origin Shield 문제 유발)
- 엣지 스크립트의 국가 차단은 `Cdn-RequestCountryCode` 헤더 기반이라 내부 요청에 영향 없음
- Free SSL 발급: 국가 차단이 엣지 스크립트에 있으므로 Let's Encrypt 검증 통과 가능
### Pull Zone 설정
- Origin: HTTPS (서울 220.120.65.245, 오사카 172.233.93.180)
- VerifyOriginSSL: false
- 국가 차단(BlockedCountries): 비어있음 (엣지 스크립트에서 처리)
- Origin Shield: 비활성화
## 참고 링크 ## 참고 링크
- [API Reference](https://docs.bunny.net/reference/bunnynet-api-overview) - [API Reference](https://docs.bunny.net/reference/bunnynet-api-overview)