diff --git a/infra/crowdsec-safeline.md b/infra/crowdsec-safeline.md index 22ae89d..9cd6029 100644 --- a/infra/crowdsec-safeline.md +++ b/infra/crowdsec-safeline.md @@ -26,6 +26,23 @@ Bouncer 목록: [[apisix]]-waf-bouncer, bunny-cdn-bouncer, cs-[[cloudflare|cf]]- - **보호 zone**: keepanker.cv, actions.it.com, ironclad.it.com, inouter.com, servidor.it.com - **Turnstile**: 5개 zone 모두 managed 모드, 168시간마다 secret key 자동 로테이션 +#### Decision 수동 추가/삭제 + +bouncer의 `lapi_key`는 **읽기 전용** (decision stream polling 전용). decision 추가/삭제는 반드시 `crowdsec` 컨테이너에서 `cscli`로 실행: + +```bash +# ban 추가 (crowdsec 컨테이너에서) +ssh incus-jp1 "incus exec crowdsec -- cscli decisions add --ip 1.2.3.4 --duration 2m --reason 'manual ban' --type ban" + +# 확인 +ssh incus-jp1 "incus exec crowdsec -- cscli decisions list --ip 1.2.3.4" + +# 삭제 +ssh incus-jp1 "incus exec crowdsec -- cscli decisions delete --ip 1.2.3.4" +``` + +bouncer 컨테이너에서 `curl POST /v1/decisions`로 직접 넣으면 등록 안 됨 — bouncer API 키 권한 제한. + #### 설정 변경 시 주의 **`sed -i` 사용 금지** — Incus 컨테이너 내에서 `sed -i`로 파일 수정 시 이전 내용이 파일 끝에 남아 YAML이 깨짐. 반드시 전체 파일을 덮어쓰는 방식으로 변경: