Skip to content

Fix(#50): GSB API 키가 httpx INFO 로그에 노출되는 문제 - #51

Open
kite-pp wants to merge 1 commit into
developfrom
fix/gsb-httpx-key-log-leak
Open

Fix(#50): GSB API 키가 httpx INFO 로그에 노출되는 문제#51
kite-pp wants to merge 1 commit into
developfrom
fix/gsb-httpx-key-log-leak

Conversation

@kite-pp

@kite-pp kite-pp commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

📝 개요

Google Safe Browsing API 키가 httpx의 INFO 레벨 요청 로그를 통해 그대로 노출되는 문제를 수정합니다. GSB API는 키를 URL 쿼리 파라미터로 요구하는데, 저장소에 httpx 로거를 억제하는 설정이 없어 INFO 이상 로깅이 켜지는 환경(로컬 디버깅, 임시 스크립트 등)에서 키가 로그에 그대로 찍힙니다. 벤치마크 테스트 스크립트 작업 중 실제로 발견했습니다.

🔗 관련 이슈

🎯 주요 변경 사항

  • app/infrastructure/google_safe_browsing/client.py: 모듈 임포트 시점에 httpx/httpcore 로거를 WARNING 이상으로 고정. 앱 진입점(app.main)뿐 아니라 이 클라이언트를 직접 임포트하는 임시 스크립트에서도 동일하게 보호되도록 클라이언트 모듈 자체에 배치.
  • VirusTotal은 헤더 인증(x-apikey)이라 해당 없음, 별도 수정 불필요.

📸 사진

생략

✅ PR 체크리스트

  • 관련 이슈를 연결했습니다.
  • 구현 범위와 변경 이유를 설명했습니다.
  • 로컬 테스트(uvicorn 구동 또는 테스트 코드)를 통과했습니다. (215건 통과)
  • API 변경 사항이 있다면 Swagger / API 명세에 반영했습니다. (해당 없음)
  • 민감 정보(API Key, 시크릿 키 등)가 코드·로그·테스트 데이터에 포함되지 않았습니다.
  • 프론트엔드 또는 메인 백엔드(Spring)에 영향을 주는 응답 스키마 또는 Enum 변경이 있다면 팀에 공유했습니다. (해당 없음)
  • 병합(Merge) 전 작업 브랜치를 삭제하지 않았습니다.

⚠️ 별도 조치 필요

이미 노출된 GOOGLE_SAFE_BROWSING_API_KEY는 이 PR과 별개로 재발급(rotate)이 필요합니다.

Google Safe Browsing API는 키를 URL 쿼리 파라미터로 요구하는데, httpx는
INFO 레벨에서 요청 URL 전체를 그대로 로깅한다. INFO 이상 로깅이 켜지는
환경(로컬 디버깅, 임시 스크립트 등)에서 키가 로그에 그대로 노출될 수 있어,
이 클라이언트를 임포트하는 시점에 httpx/httpcore 로거를 WARNING 이상으로
고정한다.

VirusTotal은 헤더 인증(x-apikey)이라 해당 없음.
@kite-pp kite-pp added the fix Bug fixes or pathces for unintended behaviors label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kite-pp, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e094febb-aa9e-4ba1-9cdd-f075ad282767

📥 Commits

Reviewing files that changed from the base of the PR and between 00b3544 and 9389b33.

📒 Files selected for processing (1)
  • app/infrastructure/google_safe_browsing/client.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fixes or pathces for unintended behaviors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] GSB API 키가 httpx INFO 로그에 노출되는 문제

1 participant