diff --git a/infra/security/crowdsec-safeline.md b/infra/security/crowdsec-safeline.md index ea3290c..e27a8c4 100644 --- a/infra/security/crowdsec-safeline.md +++ b/infra/security/crowdsec-safeline.md @@ -1,6 +1,6 @@ --- title: CrowdSec 및 SafeLine WAF -updated: 2026-04-10 +updated: 2026-04-17 --- ## CrowdSec LAPI @@ -10,6 +10,7 @@ updated: 2026-04-10 | 위치 | jp1 Incus `crowdsec` 컨테이너 | | LAPI | `http://10.253.100.240:8080` | | 관리 | `ssh incus-jp1 "incus exec crowdsec -- cscli ..."` | +| 버전 | v1.7.7 (최신, 2026-04-17 확인) | ## 로그 수집 (Acquisition) @@ -30,7 +31,7 @@ Traefik DaemonSet (stdout JSON accessLog) | Values | `~/k8s/vector/values.yaml` | | CrowdSec 포트 | 8086 | | 인증 | `Authorization: traefik-crowdsec-log-2024` | -| 파서 | `crowdsecurity/traefik-logs` (Hub, JSON 모드) | +| 파서 | `crowdsecurity/traefik-logs` (Hub, JSON 모드). APISIX: `custom/apisix-logs` (로컬, 서울 비표준 nginx 포맷 대응) | ### APISIX → VictoriaLogs → CrowdSec (서울+오사카 통합) @@ -48,7 +49,7 @@ Traefik DaemonSet (stdout JSON accessLog) | CrowdSec acquisition | `/etc/crowdsec/acquis.d/victorialogs-apisix.yaml` (`source: victorialogs`, `mode: tail`, `query: program:apisix log_type:access`) | | 서울 Vector | K3s DaemonSet (Helm `vector/vector`), `parse_apisix` transform → `vlogs` ES sink | | 오사카 Vector | Docker `timberio/vector:0.45.0-debian`, `/etc/vector/vector.yaml`, `docker_logs` source → `parse_apisix` → `vlogs` ES sink. `location: osaka` 필드 추가 | -| 파서 | `custom/apisix-json-logs` (로컬) | +| 파서 | `custom/apisix-logs` (로컬, 서울 format: `IP - user [date] HOST "req" status bytes req_time "ref" "ua"`) | ### APISIX → log-collector → CrowdSec (sandbox-tokyo) @@ -295,6 +296,15 @@ APISIX 외부 인입 경로 (juiceshop SafeLine 통합 테스트 용도). APISIX > 옛 메모의 `waf-kr (5554681)` 는 더 이상 존재하지 않음 — `iron-kr-waf (5555224)` 로 통합·재명명됨. +## 화이트리스트 + +| 파서 | 대역 | 이유 | +|------|------|------| +| `crowdsecurity/whitelists` (Hub) | 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, ::1, 127.0.0.0/8 | RFC1918 사설 IP | +| `custom/tailscale-whitelist` (로컬) | 100.64.0.0/10 | Tailscale CGNAT | + +2026-04-17 추가: 기존에 `crowdsecurity/whitelists` 파서가 미설치 상태여서 내부 IP(192.168.9.1 OpenWrt)가 반복 밴됨. 설치 후 해결. + ## 참고 - BunnyCDN WAF 차단 시 오리진에 로그 안 옴 → CrowdSec에 미수신