Add CodeQL and dependency scanning so a malicious or vulnerable dependency is caught

オープン 初心者向け
#242 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
半日
初心者へのやさしさ
62/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
github-actions, javascript, python, typescript

調査の方向性

まず .github/workflows/ci.yml を確認して既存のジョブ構成を把握し、JavaScript/TypeScript と Python を対象とする .github/workflows/codeql.yml を追加します。さらに、リポジトリルートの npm と apps/genAI の pip を対象とする .github/dependabot.yml を追加します。continue-on-error を true に設定した pnpm audit --audit-level=high のステップを追加します。完了条件は、CodeQL がプルリクエスト時と毎週実行されること、Dependabot が両方のエコシステムで設定されていること、そして既存の検出結果を抑制するのではなく PR 内でトリアージすることです。

索引モデルが issue の本文から書いたものです。

説明

Backend first issue enhancement help wanted

CI checks that the code builds, type-checks, passes tests and contains no committed secrets. It does not look at the code for vulnerabilities, and it does not look at dependencies at all.

What is missing:

$ ls .github/dependabot.yml          # none
$ grep -l codeql .github/workflows/  # none
$ grep -c "pnpm audit" .github/workflows/ci.yml   # 0
Why it matters

This is a public repo taking pull requests from people nobody has met, and pnpm-lock.yaml is part of the diff. A PR that adds one transitive dependency is visually indistinguishable from a PR that adds one transitive dependency with a postinstall script.

Nothing currently reads dependency changes, and nothing scans the source for the patterns that usually indicate a problem — a shell call built from user input, a path joined from a request parameter, a comparison that leaks timing.

What to add

CodeQL — GitHub runs it free on public repos and it understands both JavaScript/TypeScript and Python, so it covers all five services. Add .github/workflows/codeql.yml from the starter workflow, running on pull requests and on a weekly schedule. Weekly matters: a rule added after your PR merged still finds the bug.

Dependabot — .github/dependabot.yml with an ecosystem entry for npm at the repo root and for pip in apps/genAI. Security updates and a modest weekly cadence for version updates; grouping dev dependencies into one PR keeps the noise down.

A dependency audit step in CI — pnpm audit --audit-level=high. Start it as continue-on-error: true to see the existing noise rather than blocking every PR on day one, and open a follow-up to make it a gate once it is clean.

Worth thinking about
  • CodeQL will probably find things on the first run. Triage them in the PR rather than suppressing the lot — the point is to look.
  • pnpm audit on a monorepo this size will report transitive advisories you cannot fix directly. Being explicit about which ones are accepted, and why, is more useful than a blanket ignore.
  • A lockfile-diff check — flagging a PR that changes pnpm-lock.yaml without changing any package.json — would catch the specific case above. Nice to have rather than essential.
Definition of done
  • CodeQL runs on every pull request and weekly
  • Dependabot opens security updates for npm and pip
  • CI reports high-severity dependency advisories
  • Existing findings are triaged, not suppressed wholesale

Good backend issue. Mostly configuration rather than code, but the triage at the end is where the real work is — and it is a genuinely useful thing to have done.

主要言語
TypeScript
スター
21
フォーク
7
平均マージ
7時間 54分
マージ済み PR(30日)
28

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TheCodeHeist-Coder/Rexial のほかの issue

TheCodeHeist-Coder/Rexial の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。