-
Notifications
You must be signed in to change notification settings - Fork 0
[HotFix] 보안 취약점 스캐닝, 크롤링 방지 임시 조치 #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 취약점 스캐닝, 크롤링이 확인되어 임시 조치함
WalkthroughALB HTTPS 리스너의 default_action이 대상 그룹 포워드에서 고정 응답(HTTP 403, text/plain, “Access Denied: Invalid Host”)으로 변경되었습니다. 다른 리소스 변화는 없습니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant L as ALB HTTPS Listener
participant TG as Target Group
participant R as Response
rect rgb(240,248,255)
note over L: 이전(default_action = forward)
C->>L: HTTPS Request (Host Mismatch 등)
L->>TG: Forward to default target group
TG-->>L: Generate Response
L-->>C: Response (varies by TG)
end
sequenceDiagram
autonumber
participant C as Client
participant L as ALB HTTPS Listener
participant R as Response
rect rgb(245,255,250)
note over L: 현재(default_action = fixed-response)
C->>L: HTTPS Request (default action 경로)
L-->>C: HTTP 403<br/>Content-Type: text/plain<br/>Body: "Access Denied: Invalid Host"
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📄 Terraform Plan Summary🛡️ Common InfrastructureStatus: 🔄 Changes Detected 🛠️ Development EnvironmentStatus: ✅ No Changes 📋 Full Results: View in Actions |
|
/noti
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
terraform/common/alb/https-listener/main.tf (4)
8-14: 불필요한 정보 노출 최소화(메시지 바디 축소/정규화) 제안스캐너에 과한 힌트를 주지 않으려면 메시지 바디를 비우거나 일반화된 문구로 축소하는 것을 권장합니다. 미미하지만 응답 바이트 절감도 있습니다.
적용 예시:
default_action { type = "fixed-response" fixed_response { - content_type = "text/plain" - message_body = "Access Denied: Invalid Host" + content_type = "text/plain; charset=utf-8" + message_body = "" status_code = "403" } }
8-14: 상태 코드 정책 재검토(선택): 403 vs 404/421운영 정책에 따라 403 대신 404(Not Found) 또는 421(Misdirected Request)도 고려 가능합니다. 404는 존재 유무를 흐리게 하고, 421은 호스트 불일치를 더 명확히 표현합니다. 현재 403도 충분히 타당하므로 필수 변경은 아닙니다.
적용 예시(한 가지 선택):
- status_code = "403" + status_code = "404"또는
- status_code = "403" + status_code = "421"
23-27: 여러 호스트 도메인 지원을 위한 입력 스키마 확장 제안현재
values = [each.value.host_header]는 단일 호스트만 허용합니다.apex/www/내부 도메인 등 복수 호스트를 한 규칙에서 처리할 수 있도록 리스트 입력을 허용하면 관리가 단순해집니다.예시(단·복수 입력 모두 허용):
condition { host_header { - values = [each.value.host_header] + values = try(each.value.host_headers, [each.value.host_header]) } }변수 정의에서도
host_headers를list(string)로 옵션 처리해 주세요.
8-14: 운영 관점: 403 스파이크 모니터링/예외 처리 및 WAF 연계이번 변경으로 403 고정 응답이 증가합니다. 모니터링(SLO/알람)에서 4xx 급증에 대한 새로운 베이스라인/예외 규칙을 반영하고, ALB 수준에 WAF(Managed Rule) 적용도 병행 검토해 주세요. 크롤링이 재발할 때 방화벽 차단이 1차 완충이 됩니다.
- Datadog에서 403 비율/절대치에 대한 신규 모니터를 추가하거나 기존 오류율 메트릭에서 제외 처리해 주세요.
- 다중 도메인 인증서가 필요한 경우
aws_lb_listener_certificate로 추가 SAN 인증서 연결 여부도 확인 바랍니다.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
terraform/common/alb/https-listener/main.tf(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (2)
terraform/common/alb/https-listener/main.tf (2)
8-14: 기본 동작을 403 고정 응답으로 전환한 결정은 목적(Host 헤더 미일치 트래픽 차단)에 부합합니다.규칙에 매칭되지 않는 요청은 이제 대상 그룹으로 포워딩되지 않고 즉시 403을 반환합니다. 의도대로 스캐너/크롤러 트래픽 비용과 레이턴시를 줄일 수 있습니다.
- Terraform plan에서 리스너 교체 없이 in‑place 업데이트로 적용되는지 확인해 주세요. 교체(replacement) 시 순간적인 연결 리셋이 발생할 수 있습니다.
- 80포트(HTTP) 리스너가 있다면 HTTPS 리다이렉트만 허용하도록 구성되어 있는지도 함께 점검해 주세요.
8-14: https_listener 필드 정리 검토 — 사용 여부 확인 필요검증 결과: var.https_listener.type 및 var.https_listener.default_target_group_arn에 대한 참조는 검색되지 않음. 변수 선언은 남아 있음 (terraform/common/alb/https-listener/variables.tf:11). locals에서 default_target_group_arn 설정 존재 (terraform/common/alb/locals.tf:69).
- 조치: https-listener 모듈 호출부에서 해당 필드가 전달되는지 확인; 사용처가 없으면 https-listener/variables.tf에서 필드 제거 및 locals/문서 정리.
|
🎉 This PR is included in version 1.8.0-develop.13 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.8.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



✨ 개요
🧾 관련 이슈
#196
🔍 참고 사항 (선택)
Summary by CodeRabbit