Skip to content

fix(ci): 워크플로 공급망·권한 하드닝 - #25

Merged
Bori-github merged 1 commit into
mainfrom
fix/workflow-hardening
Jul 17, 2026
Merged

fix(ci): 워크플로 공급망·권한 하드닝#25
Bori-github merged 1 commit into
mainfrom
fix/workflow-hardening

Conversation

@Bori-github

@Bori-github Bori-github commented Jul 17, 2026

Copy link
Copy Markdown
Owner

📝 작업 내용

이번 스택이 만든 문제가 아니라 기존 워크플로의 문제이나, 성격이 같아 한 브랜치로 묶습니다.

deploy-zpl-viewer

  • pnpm dlx vercelpnpm dlx vercel@56.3.1
    매 배포마다 핀 없는 최신 CLI를 받아 프로덕션 토큰을 바로 넘기고 있었습니다. 락파일도 무결성 검사도 거치지 않는 경로입니다.
  • --token= 인자 → VERCEL_TOKEN env
    인자로 주면 러너의 process argv에 남아 같은 러너의 다른 프로세스에서 보입니다.
    CLI가 env를 읽는 것은 실제로 확인했습니다: The token provided via VERCEL_TOKEN environment variable is not valid
  • permissions: contents: read 추가

deploy-docs

최상위 permissions에서 pages: write·id-token: write 제거 (contents: read만). deploy 잡이 이미 자체 선언하고 있어 최상위 grant는 build 잡의 폭발 반경만 넓혔습니다. build는 pnpm install로 서드파티 lifecycle 스크립트를 실행하는 잡이라, id-token: write가 있으면 그 코드가 설정된 클라우드 신뢰 정책에 대해 OIDC 토큰을 발급할 수 있었습니다.

publish-npm-zpl-core, publish-npm-react-zpl

permissions: contents: read 추가. NPM_TOKEN을 든 잡의 GITHUB_TOKEN 범위를 레포 기본값에 맡기지 않습니다.

release-drafter

@v6@6a93d829887aa2e0748befe2e808c66c0ec6e4c7 (v6.4.0). contents: write를 부여받는 서드파티 액션을 가변 태그로 참조하고 있었습니다. 태그가 재지정되면 레포 쓰기 권한이 임의 코드로 넘어갑니다.

🔍 변경 범위

  • 기타 — 워크플로 5개

📚 추가 정보

머지 후 결과: 7개 워크플로 전부 명시적 권한을 갖고, contents: write는 실제로 필요한 둘(release-drafter, release)만 남습니다.

포함하지 않은 항목 (레포 설정이라 별도 판단 필요):
publish 워크플로의 NPM_TOKENworkflow_dispatch임의 ref에서 environment 게이트 없이 도달 가능합니다. protected environment를 만드는 건 GitHub 설정 변경이라 제외했습니다.

스택 6/6 (마지막)

🤖 Generated with Claude Code

@Bori-github Bori-github added the fix Bug fix — corrects broken behavior label Jul 17, 2026
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
zpl-viewer Ignored Ignored Preview Jul 17, 2026 7:27am

@Bori-github Bori-github self-assigned this Jul 17, 2026
@Bori-github
Bori-github force-pushed the ci/release-automation branch from 85e87ad to b1ed97d Compare July 17, 2026 07:16
@Bori-github
Bori-github force-pushed the fix/workflow-hardening branch from 1c1778c to 6bf9f12 Compare July 17, 2026 07:16
@Bori-github
Bori-github force-pushed the ci/release-automation branch from b1ed97d to a760cf4 Compare July 17, 2026 07:21
@Bori-github
Bori-github force-pushed the fix/workflow-hardening branch from 6bf9f12 to 0e482f1 Compare July 17, 2026 07:21
@Bori-github
Bori-github force-pushed the ci/release-automation branch from a760cf4 to ce1de6b Compare July 17, 2026 07:23
@Bori-github
Bori-github force-pushed the fix/workflow-hardening branch from 0e482f1 to fea0f70 Compare July 17, 2026 07:23
@Bori-github
Bori-github force-pushed the ci/release-automation branch from ce1de6b to b74864e Compare July 17, 2026 07:23
@Bori-github
Bori-github force-pushed the fix/workflow-hardening branch from fea0f70 to 619f662 Compare July 17, 2026 07:23
@Bori-github
Bori-github force-pushed the ci/release-automation branch from b74864e to efd2f89 Compare July 17, 2026 07:25
@Bori-github
Bori-github force-pushed the fix/workflow-hardening branch from 619f662 to 9ef8be1 Compare July 17, 2026 07:25
이번 스택이 만든 문제가 아니라 기존 워크플로의 문제이나, 성격이 같아
한 브랜치로 묶는다.

deploy-zpl-viewer:
- `pnpm dlx vercel` → `pnpm dlx vercel@56.3.1`
  매 배포마다 핀 없는 최신 CLI를 받아 프로덕션 토큰을 바로 넘기고 있었다.
  락파일도 무결성 검사도 거치지 않는 경로였음
- `--token=` 인자 → VERCEL_TOKEN env
  인자로 주면 러너의 process argv에 남는다. CLI가 env를 읽는 것은
  실제로 확인함 ("The token provided via VERCEL_TOKEN environment variable...")
- permissions: contents: read 추가

deploy-docs:
- 최상위 permissions에서 pages: write·id-token: write 제거 (contents: read만)
  deploy 잡이 이미 자체 선언하고 있어 최상위 grant는 build 잡의 폭발 반경만
  넓혔다. build는 pnpm install로 서드파티 lifecycle 스크립트를 실행하는 잡이라
  id-token: write가 있으면 그 코드가 OIDC 토큰을 발급할 수 있었다

publish-npm-zpl-core, publish-npm-react-zpl:
- permissions: contents: read 추가. NPM_TOKEN을 든 잡의 GITHUB_TOKEN 범위를
  레포 기본값에 맡기지 않는다

release-drafter:
- @v6 → @6a93d829887aa2e0748befe2e808c66c0ec6e4c7 (v6.4.0)
  contents: write를 부여받는 서드파티 액션을 가변 태그로 참조하고 있었다.
  태그가 재지정되면 레포 쓰기 권한이 임의 코드로 넘어간다

남은 항목(별도 판단 필요):
- publish 워크플로의 NPM_TOKEN을 protected environment 뒤로 옮기는 건
  레포 설정 변경이라 포함하지 않음

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Bori-github
Bori-github force-pushed the fix/workflow-hardening branch from 9ef8be1 to 930e617 Compare July 17, 2026 07:27
@Bori-github
Bori-github changed the base branch from ci/release-automation to main July 17, 2026 07:27
@Bori-github
Bori-github merged commit 3793dc4 into main Jul 17, 2026
4 checks passed
@Bori-github
Bori-github deleted the fix/workflow-hardening branch July 17, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix — corrects broken behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant