Skip to content

[Feat] 분석 결과 콜백 처리 API 구현 - #48

Merged
boogiewooki02 merged 6 commits into
SeCause:developfrom
boogiewooki02:develop
Sep 2, 2026
Merged

boogiewooki02 merged 6 commits into
SeCause:developfrom
boogiewooki02:develop

Conversation

@boogiewooki02

@boogiewooki02 boogiewooki02 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

‼️ 관련 이슈

close #47


🔎 개요

FastAPI 분석 서버에서 비동기 분석 완료 후 호출하는 성공/실패 콜백 API를 추가했습니다.


📝 작업 내용

  • 분석 실패 콜백 API 추가
    • POST /internal/analysis/callback/failure
    • 실패 사유 저장 및 FAILED 상태 처리
  • 분석 성공 콜백 API 추가
    • POST /internal/analysis/callback/success
    • COMPLETED 상태 처리
    • findings 결과 저장
  • 성공 콜백 결과 저장 로직 구현
  • 콜백 재시도 대비 멱등 처리 추가
  • 콜백 동시 처리 방지를 위한 pessimistic lock 조회 추가
  • 콜백 경로 JWT 제외 처리
    • /internal/analysis/callback/**

👀 참고 사항

  • 콜백 API는 FastAPI worker가 JWT 없이 호출할 수 있도록 했습니다.
  • tool=INFRA는 InfraVulnerability, 그 외 SEMGREP, CODEQL은 CodeVulnerability로 저장합니다.

✅ 체크리스트

  • label, milestone, assignees, reviewers 등을 지정했습니다.
  • 성능 개선/최적화 관련 내용이 있는지 확인했습니다.
  • 변경 사항에 대한 테스트를 했습니다.
  • 테스트 시 사용한 로그를 삭제했습니다.

💬 고민사항 및 리뷰 요구사항 (Optional)

현재는 내부 콜백 api 호출에 jwt 인증을 제외한 상태인데, 운영 배포 전 내부 토큰 방식 도입 여부를 함께 검토하면 좋겠습니다.

@boogiewooki02 boogiewooki02 self-assigned this Sep 2, 2026
@boogiewooki02 boogiewooki02 added the ✨ FEAT New feature or request label Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 6246d221-90a5-429b-9825-9d26dc6927ad


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.

@dldusgh318 dldusgh318 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다! 수고하셨습니다~

Summary summary
) {

public record Finding(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] finding은 앞으로도 쓰일 일 많을 거 같아서 따로 파일로 만들어도 될 거 같습니다

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 별도의 record 파일로 분리하겠습니다.

"/swagger-ui/**",
"/api-docs/**",
"/v3/api-docs/**",
"/internal/analysis/callback/**",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] 콜백 API가 익명 사용자에게 공개되어있는 거 같습니다! 혹시 따로 막아두셨을까요?

별도의 분석 서버 인증 필터(HMAC 서명+timestamp 권장, 최소한 전용 shared secret)를 추가하고 이 matcher는 해당 인증을 통과한 요청만 허용하는 설정 추가하면 좋을 거 같아요

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 이번 PR 내에서 shared secret 검증 인터셉터 추가하는 방식으로 구현해두겠습니다.

return "INFRA".equalsIgnoreCase(tool);
}

// FastAPI severity 문자열 변환, INFO/알 수 없는 값은 LOW 처리

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P5] 미지원 값은 INVALID_PAYLOAD 등의 상태로 기록해두는 게 어떨까요? 추후 운영하면서 해당 상태의 값들을 분석하고, 로직을 디벨롭시키는 방향으로 가는 게 좋을 거 같습니다

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFO는 FastAPI 스펙에 포함된 값이라 Spring Severity 제약에 맞춰 LOW로 매핑하고, 그 외 미지원 severity 값은 INVALID_PAYLOAD로 실패하도록 수정하겠습니다.

@boogiewooki02
boogiewooki02 merged commit 7be37a7 into SeCause:develop Sep 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ FEAT New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 분석 결과 콜백 처리 API 구현

2 participants