From 255f78373d6d00f553143845e1cfc5bdb1cb517e Mon Sep 17 00:00:00 2001 From: kaitoyama Date: Fri, 24 Jul 2026 23:59:56 +0900 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20gha-security=20=E3=81=AE=E3=82=BB?= =?UTF-8?q?=E3=82=AD=E3=83=A5=E3=83=AA=E3=83=86=E3=82=A3=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E5=B0=8E=E5=85=A5=20+=20digest=20=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=20+=20cooldown=20=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - security-checks.yaml: pin-support / pin-check / cooldown-check (PR 時) - docker-compose.yml: mariadb:11 を digest 固定 (以後 Dependabot が追従) - dependabot.yml: github-actions / docker / npm を cooldown 付きで自動更新 - pnpm-workspace.yaml: minimumReleaseAge 7日 (手元 install にも cooldown) Co-Authored-By: Claude Fable 5 --- .github/dependabot.yml | 23 ++++++++++++++++ .github/workflows/security-checks.yaml | 37 ++++++++++++++++++++++++++ docker-compose.yml | 2 +- pnpm-workspace.yaml | 6 +++++ 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/security-checks.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..49e4693 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,23 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + cooldown: + default-days: 3 + + - package-ecosystem: docker + directory: / + schedule: + interval: weekly + cooldown: + default-days: 3 + + - package-ecosystem: npm + directory: / + schedule: + interval: weekly + cooldown: + default-days: 7 + semver-major-days: 14 diff --git a/.github/workflows/security-checks.yaml b/.github/workflows/security-checks.yaml new file mode 100644 index 0000000..d10a61f --- /dev/null +++ b/.github/workflows/security-checks.yaml @@ -0,0 +1,37 @@ +# 各リポジトリに配置する caller ワークフロー(PR 時のセキュリティチェック一式)。 +# .github/workflows/security-checks.yaml として配置する。 +name: security-checks + +on: + pull_request: + +permissions: + contents: read + +jobs: + # 未固定の action / イメージ参照を検出し、修正を suggestion で提案する + pin-support: + permissions: + contents: read + pull-requests: write + uses: traPtitech/gha-security/.github/workflows/pin-support.yaml@main + with: + mode: suggest # commit にすると PR ブランチへ直接修正コミットを push する(要 contents: write) + + # 未固定の参照があれば fail(導入直後は required check にせず様子見を推奨) + pin-check: + permissions: + contents: read + uses: traPtitech/gha-security/.github/workflows/pin-check.yaml@main + + # 公開から日が浅い依存バージョンの混入を検出して fail + # 緊急時は PR に `cooldown-override` ラベルを付けるとスキップされる + # 不要な job はまるごと削除してよい(各機能は独立してオン/オフ可能) + cooldown-check: + permissions: + contents: read + uses: traPtitech/gha-security/.github/workflows/cooldown-check.yaml@main + # with: + # npm-min-age-days: 0 # npm チェックを無効化する場合 + # go-min-age-days: 0 # Go チェックを無効化する場合 + # actions-min-age-days: 0 # actions チェックを無効化する場合 diff --git a/docker-compose.yml b/docker-compose.yml index 41838a1..831eeb6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: mariadb: - image: mariadb:11 + image: mariadb:11@sha256:efb4959ef2c835cd735dbc388eb9ad6aab0c78dd64febcd51bc17481111890c4 restart: unless-stopped ports: - "3306:3306" diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 286cf7f..50647ff 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,9 @@ packages: - apps/* - packages/* + +# サプライチェーン対策: 公開から 7 日未満のバージョンを install しない +# (https://github.com/traPtitech/gha-security 参照。不要になったら削除してよい) +minimumReleaseAge: 10080 +minimumReleaseAgeExclude: + - "@traptitech/*" From f175447420927ad8ce545a05250cb66b78f3e344 Mon Sep 17 00:00:00 2001 From: kaitoyama Date: Sat, 25 Jul 2026 00:11:07 +0900 Subject: [PATCH 2/2] =?UTF-8?q?ci:=20cooldown-check=20=E3=81=AE=20PR=20?= =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E9=80=9A=E7=9F=A5=E3=82=92?= =?UTF-8?q?=E6=9C=89=E5=8A=B9=E5=8C=96=20(pull-requests:=20write)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .github/workflows/security-checks.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/security-checks.yaml b/.github/workflows/security-checks.yaml index d10a61f..89387b1 100644 --- a/.github/workflows/security-checks.yaml +++ b/.github/workflows/security-checks.yaml @@ -24,14 +24,16 @@ jobs: contents: read uses: traPtitech/gha-security/.github/workflows/pin-check.yaml@main - # 公開から日が浅い依存バージョンの混入を検出して fail + # 公開から日が浅い依存バージョンの混入を検出して fail し、違反内容を PR コメントで通知 # 緊急時は PR に `cooldown-override` ラベルを付けるとスキップされる # 不要な job はまるごと削除してよい(各機能は独立してオン/オフ可能) cooldown-check: permissions: contents: read + pull-requests: write # 違反の PR コメント投稿用(pr-comment: false なら read のみで可) uses: traPtitech/gha-security/.github/workflows/cooldown-check.yaml@main # with: + # pr-comment: false # PR コメント通知を無効化する場合 # npm-min-age-days: 0 # npm チェックを無効化する場合 # go-min-age-days: 0 # Go チェックを無効化する場合 # actions-min-age-days: 0 # actions チェックを無効化する場合