-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: reorganize tests into __tests__/ and harden supply chain security #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8b78039
85efd1c
b886cbd
20989de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| use flake | ||
| watch_file flake.lock |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: OpenSSF Scorecard | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: "0 0 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| analysis: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| security-events: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin all GitHub Actions to commit hashes. Three action references are unpinned and violate security best practices:
Unpinned tags and versions are mutable and vulnerable to supply-chain attacks (tag hijacking, compromised releases). All actions must be pinned to specific commit hashes. 🔒 Proposed fix: Pin all actions to commit hashes- - uses: actions/checkout@v4
+ - uses: actions/checkout@44c85305e41dfe471331e387f004d221add66d31 # v4.1.1
- - uses: ossf/scorecard-action@v2.4.0
+ - uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914a587 # v2.4.0
- uses: github/codeql-action/upload-sarif@v3
+ uses: github/codeql-action/upload-sarif@cdcdbbfb34304309f8c18fe68d3a021711ae8f642 # v3.1.1(Verify commit hashes at each action's GitHub releases page) Also applies to: 26-26, 33-33 🧰 Tools🪛 zizmor (1.25.2)[error] 22-22: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: ossf/scorecard-action@v2.4.0 | ||
| with: | ||
| results_file: results.sarif | ||
| results_format: sarif | ||
| publish_results: true | ||
|
|
||
| - name: Upload Scorecard SARIF result | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Security Policy | ||
|
|
||
| ## Reporting a Vulnerability | ||
|
|
||
| If you discover a security vulnerability in subtrack, please report it privately. | ||
|
|
||
| **Do not** report security vulnerabilities via public GitHub issues. | ||
|
|
||
| Instead, send a description of the issue (including steps to reproduce, affected versions, and any relevant code context) to one of the following: | ||
|
|
||
| - Open a **private security advisory** at: https://github.com/nazozokc/subtrack/security/advisories/new | ||
| - Email: **nazozokc@icloud.com** | ||
|
|
||
| You should receive a response within **48 hours**. If you don't hear back, follow up via the advisory thread. | ||
|
|
||
| ## Scope | ||
|
|
||
| This policy covers the `subtrack` npm package and the `subtrack-monorepo` at https://github.com/nazozokc/subtrack. | ||
|
|
||
| The following are **out of scope**: | ||
| - The documentation site under `docs/` | ||
| - Third-party dependencies (report those to the respective maintainers) | ||
| - Theoretical vulnerabilities without a practical exploit path | ||
|
|
||
| ## What to Expect | ||
|
|
||
| - I will acknowledge receipt of your report within 48 hours | ||
| - I will investigate and provide a timeline for a fix | ||
| - Once a fix is ready, I will release a patch and credit you in the release notes (unless you prefer to remain anonymous) | ||
|
|
||
| ## Supported Versions | ||
|
|
||
| | Version | Supported | | ||
| |---------|-----------| | ||
| | >= 4.x | ✅ Active | | ||
| | < 4.x | ❌ No longer supported | | ||
|
|
||
| ## Supply Chain Security | ||
|
|
||
| subtrack takes supply chain security seriously: | ||
|
|
||
| - **Provenance attestation**: All npm releases use `pnpm publish --provenance` (SLSA Level 1+) | ||
| - **Dependency review**: Every pull request is scanned for new vulnerabilities via GitHub's dependency review action | ||
| - **Renovate bot**: Dependencies are updated with a 7-day minimum release age to detect malicious releases before they reach this project | ||
| - **Lockfile**: A `pnpm-lock.yaml` is committed and verified with `--frozen-lockfile` in CI | ||
| - **Limited build scripts**: Only `esbuild` is permitted to run postinstall scripts (`pnpm.onlyBuiltDependencies`) | ||
| - **CodeQL**: Static analysis runs on every push and PR | ||
| - **pnpm audit**: Runs in CI to catch known vulnerabilities | ||
| - **OpenSSF Scorecard**: Automated supply chain health assessment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin GitHub Actions to commit hashes.
The
actions/checkout@v4reference on line 22 is unpinned. Per GitHub security best practices and the requirements flagged by static analysis, all action references must be pinned to a specific commit hash (not a tag or branch) to prevent supply-chain attacks and ensure reproducible workflows.While the lockfile verification (lines 25–26) and audit logic (lines 36–37) are sound, the unpinned action undermines the security hardening intent of this PR.
🔒 Proposed fix: Pin action to commit hash
(Verify the latest v4.x commit hash at https://github.com/actions/checkout/releases)
Also applies to: 25-37
🤖 Prompt for AI Agents
Source: Linters/SAST tools