Conversation
Summary of ChangesHello @Yoonchulchung, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 데모 데이 이전에 발생했던 보안 문제에 대응하기 위해 HAProxy에 보안 설정을 추가하는 것을 목표로 합니다. Cloudflare 적용에도 불구하고 발생했던 비정상적인 접근 요청과 SSH 포트 스캐닝 공격에 대비하여, Fail2ban, iptables 관리, IP 블랙리스트 관리 등 다양한 보안 강화 조치가 HAProxy 구성에 통합되었습니다. 이는 서버의 전반적인 보안 수준을 향상시키고 잠재적인 위협으로부터 시스템을 보호하는 데 기여합니다. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This PR introduces important security settings to HAProxy, including Fail2ban, rate limiting, and various security headers, which are good changes to address the mentioned security issues. However, a high-severity issue was identified: hardcoded credentials for the HAProxy statistics page. This should be remediated by using environment variables. Overall, the changes are positive, but ensure the hardcoded credentials are addressed for improved security.
| stats refresh 5s | ||
| stats show-legends | ||
| stats show-node | ||
| stats auth admin:realmatch2026! |
There was a problem hiding this comment.
The HAProxy statistics page is configured with a hardcoded username and password (admin:realmatch2026!). Hardcoding credentials in configuration files committed to version control is a major security risk, exposing them to anyone with repository access. This could allow an attacker to monitor backend server health, view traffic, and potentially disable/enable servers, leading to denial of service. Additionally, line 71 (stats admin if TRUE) grants administrative privileges to any authenticated user. It is critical to replace these hardcoded credentials with environment variables or other secure injection methods.
stats auth ${STATS_USER}:${STATS_PASSWORD}
| @@ -0,0 +1,8 @@ | |||
| [haproxy-attack] | |||
| enabled = true | |||
| filter = haproxy-attack | |||
There was a problem hiding this comment.
| 단순 매칭을 넘어, | ||
|
|
||
| > 👉 **데이터 기반 분석 + 협업 프로세스 통합 관리** | ||
| > **태그 기반 매칭 + 채팅 기반 협엽 진행** |
| failregex = ^\s*<HOST>:\d+\s+\[.*\]\s+\S+\s+\S+\s+\S+\s+403\s | ||
| ^\s*<HOST>:\d+\s+\[.*\]\s+\S+\s+\S+\s+\S+\s+429\s | ||
| ^\s*<HOST>:\d+\s+\[.*\]\s+\S+\s+\S+\s+\S+\s+\d+\s.*"(GET|POST|PUT|DELETE|HEAD|OPTIONS)\s+.*(\.php|cgi-bin|\.env|wp-admin|wp-login|\.git|shell|passwd|\.asp) |
There was a problem hiding this comment.
현재 취약점 스캔을 위한 정규식이 너무 광범위하여 정상적인 요청을 차단할 오탐(false positive)의 가능성이 있습니다. 예를 들어, URL 파라미터에 .git과 같은 문자열이 포함된 경우에도 차단될 수 있습니다. 요청 경로(path)에 대해서만 패턴을 검사하고, 요청 문자열의 끝을 명확히 하는 등 정규식을 좀 더 정교하게 수정하여 오탐을 줄이는 것을 권장합니다.
failregex = ^\s*<HOST>:\d+\s+\[.*\]\s+\S+\s+\S+\s+\S+\s+403\s
^\s*<HOST>:\d+\s+\[.*\]\s+\S+\s+\S+\s+\S+\s+429\s
^\s*<HOST>:\d+\s+\[.*\]\s+\S+\s+\S+\s+\S+\s+\d+\s.*"(?:GET|POST|PUT|DELETE|HEAD|OPTIONS)\s+[^\"]*?(\.php|/cgi-bin|/\.env|/wp-admin|/wp-login|/\.git|/shell|/passwd|/\.asp)[^\"]*"
| http-response set-header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" | ||
| http-response set-header X-Frame-Options "SAMEORIGIN" | ||
| http-response set-header X-Content-Type-Options "nosniff" | ||
| http-response set-header X-XSS-Protection "1; mode=block" |
Summary
데모 데이 전에 발생했던 보안 문제를 대응하고자 서버에만 적용했던 보안설정 파일을 dev 브랜치에 올릴려고 합니다.
Cloudflare를 적용했음에도, 무차별적으로 SSH 포트가 건드리거나, 443 및 80 포트로 비정상적인 접근 요청을 하는 공격들이 존재했습니다. HAProxy에 적용했던 보안 설정을 공유하고자 합니다.
Changes
Type of Change
Related Issues
#407