Repository navigation
ci: add CodeQL and built-package CommonJS checks - #207
TheRealAgentK wants to merge 4 commits into
Conversation
Include root development dependencies in security audits. Preserve the Node 20/22/24 matrix and verify awsHandler without require(esm). Amp-Thread-ID: https://ampcode.com/threads/T-01a20bfc-c2be-7434-a564-573321d42b27 Co-authored-by: Amp <[email protected]>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Refresh dependencies within existing manifest ranges, incorporating the updates proposed by Dependabot PRs #203 through #206. Hold glob/minimatch major overrides pending compatibility approval; the full development audit still reports 22 moderate entries. Amp-Thread-ID: https://ampcode.com/threads/T-01a20bfc-87bd-70dd-acb8-36988da00f5a Co-authored-by: Amp <[email protected]>
Pin glob 14.0.6 and minimatch 11.0.9 across development consumers and remove redundant vulnerable nested copies. Verified clean full audits and consumer compatibility on Node 20, 22 and 24. Runtime dependencies and CommonJS output are unchanged. Minimatch drops Node 18 tooling support and changes documented matching edge cases. Amp-Thread-ID: https://ampcode.com/threads/T-01a20bfc-87bd-70dd-acb8-36988da00f5a Co-authored-by: Amp <[email protected]>
Integrate PR #208 dependency commits for hosted full-development audit, CommonJS matrix and CodeQL validation. Keep both PRs draft and merge dependency remediation first. Amp-Thread-ID: T-01a20bfc-c2be-7434-a564-573321d42b27
| "raygun": "^2.2.10" | ||
| }, | ||
| "overrides": { | ||
| "glob": "14.0.6", |
There was a problem hiding this comment.
🟠 P2 — Use caret ranges for the glob and minimatch overrides
The exact pins on glob and minimatch block patch releases, so a new advisory against either version fails npm audit --include=dev on every PR until a person edits this file.
Details
I compared the lockfile on main with the lockfile at the head commit. All consumers of glob and minimatch are dev dependencies. The lockfile already makes installs reproducible, so the exact pin adds nothing to reproducibility. Its only effect is to stop patch releases. I inferred this from npm overrides behaviour and did not reproduce it.
This PR also changes the supply-chain job to npm audit --include=dev with no --audit-level. Suppose an advisory is published against [email protected], with the fix in 11.0.10. npm audit fix and Dependabot security updates cannot move past the pin. The job then fails on every PR and every push to main.
Change the two values to caret ranges. The overrides still force all six off-range consumers onto the patched majors, and patch fixes can come through:
"overrides": {
"glob": "^14.0.6",
"minimatch": "^11.0.9"
}This line comes from commit e33d6fe in #208.
Comment added by AI model Claude
| NODE | ||
| - run: npm ci --ignore-scripts | ||
| - run: npm audit --omit=dev | ||
| - run: npm audit --include=dev |
There was a problem hiding this comment.
❓ Q — Decide whether a low-severity dev-tool advisory should block every merge
This step now makes CI fail on any advisory in the full dev tree, at any severity, on every PR and every push to main.
Details
Before this change, the gate covered only the two runtime dependencies. Now it also covers tap, eslint, typescript-eslint, and all their dependencies. The PR description says the baseline had 57 affected entries. That count shows how often new advisories can appear in this tree. Each new one makes CI fail on unrelated PRs, and no code change is needed to cause it.
The strict gate is a valid choice if the team wants it, but it is a policy decision for the maintainers. The options are:
- Keep the strict gate.
- Add
--audit-level=highfor the dev tree only. - Run the full dev audit on a schedule, and keep
--omit=devon each PR.
Comment added by AI model Claude
Summary
build-mode: none, read-only repository access, andsecurity-events: writescoped to the analysis job. Scan PRs targetingmain, pushes tomain, and weekly on Tuesdays at 18:23 UTC.mainis the repository's current default branch; nodevelopbranch exists remotely.npm audit --include=dev, without suppressions or lowered thresholds. Keep the existing example audit and signature checks.--no-experimental-require-moduleand assert that its publicawsHandlerexport is a function on Node 20/22/24. This checks the built entry point rather than the TypeScript-source tests or the underlying Raygun client'sClientexport.No SDK behavior, module format, or supported Node matrix changes. Dependency remediation owns the manifest/lockfile changes temporarily included below.
Merge prerequisite and combined hosted verification
Merge dependency PR #208 first, then this PR.
To verify these security workflows against the exact remediated dependencies on GitHub, this branch temporarily includes #208's dependency commits through a normal merge of
e33d6feinto the existing CI branch. Integration head:0b71293. Both published histories are preserved; no rebase or force push was used. After #208 merges, its dependency changes will no longer be a separate diff againstmainhere.The combined diff from the original
mainbaseline (09e272797ebd79d5537004ec1ff83cae09024a3b) contains only two workflow files and rootpackage.json/package-lock.json. Relative to #208's exact head, only the two workflow files differ. The original baseline had 57 affected audit entries; the verified combined state now reports zero, without weakening the audit.Exact dependency SHA-256 values retained after integration:
package.json:f5dbd04b754001ba7c5fcdd78aa29703b80a1505bf5dd96fc8f032b6b00505dapackage-lock.json:c8c5e74f249285d72cc87b66c89b2a651cc4a5e2f721acd9cbbca8bb9951b01aDependency-remediation coordination: https://ampcode.com/threads/T-01a20bfc-87bd-70dd-acb8-36988da00f5a
Validation
actionlint1.7.12: both changed workflows pass.awsHandlerexport (ERR_ASSERTION) and an ESM-only entry point (ERR_REQUIRE_ESM).npm ls --all,git diff --check, and post-merge byte comparison against preserved verified dependency files pass.Hosted results
All reported checks passed for integration head
0b71293, including the exact dependency baseline above:npm audit --include=devexplicitly reportsfound 0 vulnerabilities; registry signatures and attestations pass (448/113). Node 20/22/24 each passed the built-package CommonJS check, all 51 unit assertions and both linters. Formatting and all 10 example-integration assertions passed; example audit and signatures passed.Scheduled scanning starts only after the workflow reaches the default branch. No release, deployment, or settings changes were performed.