Skip to content

Add security and project harness#13

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:add-project-harness
May 31, 2026
Merged

Add security and project harness#13
potiuk merged 2 commits into
apache:mainfrom
potiuk:add-project-harness

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented May 31, 2026

Adds local + CI tooling to keep the repo ASF-compliant and secure:

  • prek harness (.pre-commit-config.yaml) — pre-commit (license headers, trailing-whitespace/EOF, YAML/JSON, GitHub-workflow + dependabot schema validation), commit-msg (rejects Co-authored-by: trailers), and pre-push (MCP test suites + dependency license allowlist + zizmor).
  • Apache-2.0 license headers on all source files (js/py/sh/html), placed after shebangs and PEP-723 metadata blocks.
  • Dependency license allowlist (scripts/check-licenses.mjs) — gates npm dependencies to ASF Category-A licenses; per-project .license-allowlist-exceptions.json for vetted exceptions. Wired into CI, pre-push, and npm run licenses.
  • Tracked package-lock.json (un-ignored) for reproducible npm ci installs and stable license checks.
  • Dependabot coverage for mcp/apache-projects-mcp (release cooldowns, matching the other ecosystems).
  • CI — consolidated MCP testing into mcp-tests.yml (matrix over both servers × Node 20/22, runs tests + license check); new static-checks.yml runs prek.
  • AGENTS.md documenting repo layout, one-time setup, how to run all pre-push checks, and the ASF attribution policy: use a Generated-by: trailer naming the agent + version, never Co-authored-by.

Setup

uv tool install prek
prek install -t pre-commit -t commit-msg -t pre-push

Verified locally

  • prek run --all-files and prek run --all-files --hook-stage pre-push — all green.
  • npm ci && npm test && npm run licenses — pass for both MCP servers.
  • License allowlist negative test: a fake GPL-3.0-only dependency is rejected, naming the package.
  • commit-msg hook: rejects a Co-authored-by: message, accepts a Generated-by: one.
  • Both MCP servers still start and list their tools after the header insertion.

potiuk added 2 commits May 31, 2026 15:26
Adds local and CI tooling to keep the repo ASF-compliant and secure:

- prek (.pre-commit-config.yaml) with pre-commit / commit-msg / pre-push
  hooks: license-header insertion, trailing-whitespace/EOF/YAML/JSON checks,
  workflow + dependabot schema validation, a commit-msg hook that rejects
  Co-authored-by trailers, and a pre-push suite (tests, license allowlist,
  zizmor).
- Apache-2.0 license headers on all source files (js/py/sh/html), placed
  after shebangs and PEP-723 metadata blocks.
- Dependency license allowlist check (scripts/check-licenses.mjs) gating npm
  dependencies to ASF Category-A licenses; wired into CI and pre-push.
- Track package-lock.json files (un-ignored) for reproducible "npm ci".
- Dependabot coverage for mcp/apache-projects-mcp (cooldowns, like the others).
- Consolidate MCP CI into mcp-tests.yml (matrix over both servers x Node
  20/22, runs tests + license check); add static-checks.yml running prek.
- AGENTS.md documenting setup, the pre-push checks, and the ASF attribution
  policy (Generated-by, never Co-authored-by).

Generated-by: Claude Code 2.1.158 (Claude Opus 4.8)
The committed ponymail-mcp lock file pinned fast-uri@3.1.0 (transitive via
@modelcontextprotocol/sdk -> ajv), which dependency-review flagged as a
high-severity path-traversal / host-confusion vulnerability
(GHSA-q3j6-qgpj-74h6, GHSA-v39h-62p7-jpjc).

Refresh the lock within the existing semver ranges: fast-uri 3.1.0 -> 3.1.2
and hono 4.12.15 -> 4.12.23 (the latter also clears a moderate hono advisory).
npm audit now reports 0 vulnerabilities; tests (43/43) and the license check
pass.

Generated-by: Claude Code 2.1.158 (Claude Opus 4.8)
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented May 31, 2026

Merging.. Adding the harness detected that fast-uri@3.1.0 has been used and it had a real vulnerability. The harness now will detect this (and dependabot will keep our deps updated).

@potiuk potiuk merged commit 6dd78f4 into apache:main May 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant