netbis: CF 바운서 전량 제거 (netbis-cf + netbis-cf-firewall)
This commit is contained in:
@@ -221,70 +221,7 @@ cat updated-config.yaml | ssh incus-jp1 "incus file push - cs-cf-worker-bouncer/
|
||||
ssh incus-jp1 "incus exec cs-cf-worker-bouncer -- systemctl restart crowdsec-cloudflare-worker-bouncer"
|
||||
```
|
||||
|
||||
### netbis-cf (Cloudflare Worker — Netbis 계정)
|
||||
|
||||
Kappa 계정용 `cs-cf-worker-bouncer`와 별도 컨테이너로 분리 운영. 상세: [[netbis]]
|
||||
|
||||
| 항목 | 값 |
|
||||
|------|-----|
|
||||
| 위치 | jp1 Incus `netbis-cf-bouncer` 컨테이너 (10.253.103.33) |
|
||||
| 바운서 이름 | netbis-cf |
|
||||
| 설정 | `/etc/crowdsec/bouncers/crowdsec-cloudflare-worker-bouncer.yaml` |
|
||||
| 동기화 | 10초 |
|
||||
| CF 계정 | Netbis (netbis@netbis.io, Account ID 8fcf3c7876332aba33e974cbbfdad951) |
|
||||
| 보호 zone | fall-vip.com, fall-mvp.com, fall-vip7.com, psd777.com, rss-555.com, rss-7790.com |
|
||||
| Turnstile | 6개 zone managed 모드, 168시간 secret key 로테이션 |
|
||||
| 로그 소스 | sandbox-tokyo APISIX → CrowdSec http-logger (8085/apisix-logs) |
|
||||
|
||||
### netbis-cf-firewall (Cloudflare Firewall Rule — Netbis 계정, 비용 방어)
|
||||
|
||||
`netbis-cf` Worker Bouncer와 **병행** 운영. Worker Bouncer는 Worker 실행 후 KV.get 구조라 KV read 비용이 그대로 청구됨 (2026-04 청구서 $100 중 82%가 KV read 오버). Firewall Rule 바우언서는 CF 엣지 단계에서 IP를 차단 — Worker가 실행되지 않아 Worker/KV 비용 0. Worker Bouncer는 Turnstile/정교한 챌린지용으로 계속 사용.
|
||||
|
||||
| 항목 | 값 |
|
||||
|------|-----|
|
||||
| 위치 | jp1 Incus `netbis-cf-bouncer` 컨테이너 (10.253.103.33, Worker Bouncer와 동일 컨테이너) |
|
||||
| 패키지 | `crowdsec-cloudflare-bouncer` v0.3.0 (crowdsec apt repo) |
|
||||
| 바운서 이름 | `netbis-cf-firewall` (cscli 등록) |
|
||||
| 설정 | `/etc/crowdsec/bouncers/crowdsec-cloudflare-bouncer.yaml` (mode 600) |
|
||||
| 동기화 | LAPI 10초, CF 업데이트 30초 |
|
||||
| CF 계정 | Netbis (netbis@netbis.io, Account ID 8fcf3c7876332aba33e974cbbfdad951) |
|
||||
| CF 인증 | scoped API token `crowdsec-cloudflare-bouncer-netbis` (Vault `secret/cloud/cloudflare-netbis` `api_token` 필드). 권한: Account Rule Lists Write + Account Settings Read + Zone Firewall Services Write + Zone WAF Write + Zone Read (All zones of account). 발급 주체: global_api_key 경유 CF API |
|
||||
| IP List | `crowdsec` (CF Rule Lists, account scope) — ip_list_prefix 설정 |
|
||||
| IP List 용량 | 10000 (Free/Pro 공통 상한, `total_ip_list_capacity`) |
|
||||
| 보호 zone | fall-vip.com, fall-mvp.com, fall-vip7.com, psd777.com, rss-555.com, rss-7790.com (6) |
|
||||
| Action | `block` (단일) — 모든 zone, default_action 동일 |
|
||||
| Firewall Rule | 각 zone 당 1건 (6건 자동 생성, `ip.src in $crowdsec` 조건) |
|
||||
| 로그 | `/var/log/crowdsec-cloudflare-bouncer.log` (log_mode: file) |
|
||||
|
||||
### 바우언서 역할 분담 (Netbis)
|
||||
|
||||
```
|
||||
LAPI (jp1 crowdsec) → 두 바우언서 병행 구독
|
||||
├─ netbis-cf (Worker Bouncer) → CF Worker + KV (정교한 차단·captcha·Turnstile)
|
||||
└─ netbis-cf-firewall (FW Bouncer) → CF Rule List + Firewall Rule (엣지 즉시 차단, Worker 실행 없음)
|
||||
```
|
||||
|
||||
Firewall Rule이 먼저 평가되어 차단되면 Worker는 아예 실행되지 않아 KV 비용 미발생. Worker까지 도달한 요청에 대해서만 captcha/Turnstile 플로우 적용.
|
||||
|
||||
### 운영 주의
|
||||
|
||||
- IP 용량 초과 시 바우언서 로그에 `N IPs won't be inserted/kept to avoid exceeding IP list limit` 경고. LAPI 전체 decision 수가 10000 초과면 일부 IP는 CF에 반영 안 됨 (바우언서가 우선순위로 선별)
|
||||
- CF Rule Lists items API는 레이트리밋 존재 (에러 10040). 바우언서는 자동 재시도로 다음 사이클에서 처리
|
||||
- scoped API token 권한 부족으로 CF Rulesets API 403 발생 시 `Account Rulesets:Edit` 추가 후 재발급 필요
|
||||
|
||||
### 적용 / 재기동
|
||||
|
||||
```bash
|
||||
# config 전체 푸시 (sed -i 금지)
|
||||
cat updated-config.yaml | ssh incus-jp1 'incus exec netbis-cf-bouncer -- tee /etc/crowdsec/bouncers/crowdsec-cloudflare-bouncer.yaml >/dev/null'
|
||||
ssh incus-jp1 'incus exec netbis-cf-bouncer -- systemctl restart crowdsec-cloudflare-bouncer'
|
||||
|
||||
# 상태
|
||||
ssh incus-jp1 'incus exec netbis-cf-bouncer -- systemctl status crowdsec-cloudflare-bouncer'
|
||||
ssh incus-jp1 'incus exec netbis-cf-bouncer -- tail -f /var/log/crowdsec-cloudflare-bouncer.log'
|
||||
```
|
||||
|
||||
도입 이력: [[../../history/2026-04-23-netbis-firewall-bouncer-migration|history]]
|
||||
> **Netbis CF 바운서 전량 제거 (2026-04-23)** — Worker Bouncer (`netbis-cf`) + Firewall Rule Bouncer (`netbis-cf-firewall`) 모두 폐기. Worker/KV 비용 구조 + CF IP List 10k 한도의 이중 한계로 두 방식 모두 비용 대비 효과 불충분 판단. 컨테이너·패키지·LAPI 엔트리·CF 리소스(Worker/KV/Routes/Turnstile/Rule List/Firewall Rules)·API 토큰 모두 삭제. 상세: [[../../history/2026-04-23-netbis-bouncer-removal|history]]
|
||||
|
||||
### bunny-cdn-bouncer (BunnyCDN Edge Script)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user