Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ jobs:
COOKIE_SECURE=${{ secrets.COOKIE_SECURE }}
COOKIE_SAME_SITE=${{ secrets.COOKIE_SAME_SITE }}
COOKIE_DOMAIN=${{ secrets.COOKIE_DOMAIN }}
NCP_ACCESS_KEY=${{ secrets.NCP_ACCESS_KEY }}
NCP_SECRET_KEY=${{ secrets.NCP_SECRET_KEY }}
NCP_BUCKET_NAME=${{ secrets.NCP_BUCKET_NAME }}
EOF

# 서버 내부 Docker Registry 로그인
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ services:
COOKIE_SECURE: ${COOKIE_SECURE}
COOKIE_SAME_SITE: ${COOKIE_SAME_SITE}
COOKIE_DOMAIN: ${COOKIE_DOMAIN}
NCP_ACCESS_KEY: ${NCP_ACCESS_KEY}
NCP_SECRET_KEY: ${NCP_SECRET_KEY}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-medium medium

NCP_SECRET_KEY와 같은 보안 민감 정보를 환경 변수로 직접 노출하는 것은 보안상 위험할 수 있습니다. 프로세스 목록이나 로그 등을 통해 유출될 가능성이 있으므로, 향후 Docker Secrets나 외부 Secret 관리 솔루션 도입을 고려해 보시기 바랍니다.

NCP_BUCKET_NAME: ${NCP_BUCKET_NAME}
Comment on lines +82 to +84
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

운영 환경에서는 NCP 액세스 키와 버킷 이름과 같은 필수 설정이 누락되지 않도록 보장하는 것이 중요합니다. 리포지토리 규칙에 따라 YAML 설정 파일에서 환경 변수를 사용해야 하며, ${VARIABLE:?error} 구문을 활용하면 환경 변수가 설정되지 않았을 때 배포 단계에서 에러를 발생시켜 잘못된 설정으로 애플리케이션이 실행되는 것을 방지할 수 있습니다.

      NCP_ACCESS_KEY: ${NCP_ACCESS_KEY:?NCP_ACCESS_KEY must be set}
      NCP_SECRET_KEY: ${NCP_SECRET_KEY:?NCP_SECRET_KEY must be set}
      NCP_BUCKET_NAME: ${NCP_BUCKET_NAME:?NCP_BUCKET_NAME must be set}
References
  1. 환경별 설정 시 YAML 파일에서 주석 처리 대신 기본값이 포함된 환경 변수를 사용해야 합니다.

depends_on:
db:
condition: service_healthy
Expand Down
Loading