Commit db4ef7f
ci: pilot Psalm security scan, release-please, and PR title lint (#6)
Pilot of the CI tooling discussed for the ontology-provider modules, on
this repo first since it's under active review (see #5).
## What this adds
- **`security-scan.yml`** — runs Psalm's taint analysis
(`--taint-analysis`) on every PR, scoped to mirror the REDCap
consortium's stated security-scan categories (SQL, XSS, cookies,
headers, path traversal, shell, LDAP, curl/SSRF) rather than general
code quality. Findings are also uploaded as SARIF to the Security tab
via `github/codeql-action/upload-sarif`, making them eligible for
Copilot Autofix assignment.
- **`stubs/redcap-em-framework.phpstub`** — minimal method/function
*signatures* (no implementation) for the EM framework surface this
module calls, with `@psalm-taint-sink`/`@psalm-taint-escape`
annotations, so Psalm can do useful taint tracking without needing
REDCap core itself in a public CI runner. Sourced from REDCap's
published EM Framework docs, not REDCap source.
- **`release-please.yml`** — dormant until this branch reaches `main`
(it only triggers on pushes there). Uses `release-type: simple` since
`config.json` has no version field to bump; release-please owns its own
manifest.
- **`pr-title-lint.yml`** — enforces Conventional Commits on PR titles
via `pull_request_target` (safe here — only reads the title, never
checks out fork code), so release-please has something reliable to
parse.
- **`.github/dependabot.yml`** — weekly version-update PRs for
`composer` (Psalm itself) and `github-actions` (the pinned action
versions here).
## Verified before opening this PR
- Ran Psalm against the actual module code (clean) and against a
deliberately tainted throwaway file (correctly flagged `TaintedSql` via
the stubbed `query()` sink and `TaintedHtml`/`TaintedTextWithQuotes` via
`echo`), to confirm the scan detects real taint rather than silently
passing everything.
- Confirmed `--report=psalm-results.sarif` produces valid SARIF (schema
2.1.0) alongside the normal console output, not instead of it.
## Known limitation
Psalm only analyzes PHP. The module's actual JS lives embedded in PHP
heredoc strings, which no mainstream JS static analyzer (ESLint, CodeQL)
can see — that's a separate piece of follow-up work (extracting embedded
`<script>` blocks into real `.js` files), deliberately not part of this
PR.
## Still open
- Repo merge-strategy restriction to squash-only (needed for
release-please to read a clean one-commit-per-PR history) — pending, not
part of this PR.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent 18e5e76 commit db4ef7f
9 files changed
Lines changed: 3657 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments