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..89387b1 --- /dev/null +++ b/.github/workflows/security-checks.yaml @@ -0,0 +1,39 @@ +# 各リポジトリに配置する 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 コメントで通知 + # 緊急時は 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 チェックを無効化する場合 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/*"