Conversation
| release: | ||
| types: | ||
| - published |
There was a problem hiding this comment.
[確認メモ]
publicにする想定でみたとき、このワークフローをトリガーできるのはこのリポジトリのwrite権限以上を持つ人のみ

参考 https://docs.github.com/ja/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization#permissions-for-each-role
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - run: 'echo "TODO: automate deployment"' | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| scope: '@chatwork' | ||
| - run: npm ci | ||
| - run: npm publish --provenance --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
There was a problem hiding this comment.
There was a problem hiding this comment.
[確認メモ]
secretsの危険性として、pull request target を使ったワークフローで secrets を参照することができる。
そのため、攻撃者が任意のタイミングでワークフローが実行できる可能性がある。
また、pull request targetではワークフローを改ざんして実行はできないという制限がつくことで参照できる。
本件はreleaseで動作するワークフローなので、攻撃者によって参照する手段はいまのところなさそうである。
There was a problem hiding this comment.
[確認]
https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
自分の方でも合わせて確認しましたが @eiel と同様の意見です。
chore: fix workflow for security
GitHub上でリリースをした際、自動で npm にパッケージを公開するようにする。