Skip to content

fix: EC2 GHCR 인증 방식 개선 (Docker credential helper 도입) #754

Description

@coderabbitai

배경

PR #753 (블루/그린 배포 도입) 코드 리뷰에서 발견된 보안 개선 사항입니다.

현재 dev-cd.yml 및 prod-cd.yml 워크플로우에서 SSH 세션 내 GHCR 로그인 시 echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io ... 패턴을 사용하고 있습니다. EC2 서버의 SSH 세션 로그가 활성화된 환경에서는 토큰이 로그에 기록될 수 있는 위험이 있습니다.

관련 링크

제안 개선 방향

  1. Docker credential helper 사전 구성: EC2 인스턴스에 Docker credential helper를 미리 설치·설정하여 워크플로우에서 토큰을 직접 전달하지 않는 방식으로 전환
  2. 배포 전용 PAT 관리: GHCR 접근 전용 토큰을 서버 환경 변수 또는 보호된 파일로 관리하고 echo 없이 읽어오는 방식 검토
  3. 인프라 레포 연동: solid-connection-infra의 EC2 초기화 스크립트에 credential helper 설정 포함

영향 파일

  • .github/workflows/dev-cd.yml (L141-L142)
  • .github/workflows/prod-cd.yml (L154-L155)

요청자: @Hexeong

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions