Repository navigation
chore: add npm supply-chain hardening #23
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: npm | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| cooldown: | ||
| default-days: 7 | ||
| semver-major-days: 7 | ||
| semver-minor-days: 7 | ||
| semver-patch-days: 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ignore-scripts=true | ||
| min-release-age=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npmMinimalAgeGate: "3d" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🌐 Web query:
What are the valid configuration options in Yarn .yarnrc.yml file for controlling npm package installation and release age?💡 Result:
Valid Yarn.yarnrc.yml configuration keys for controlling npm package installation and “release age” (as of Yarn Berry / Yarn 2+): 1) Controlling npm package installation (npm-related install behavior) - npmAlwaysAuth: enables always sending auth when accessing npm registries. [1] - npmAuditRegistry: set the registry used for npm audit (npm security audit). [1] - npmPublishAccess: set publish access (e.g., public/restricted) for npm publishes. [1] - npmAuditExcludePackages: exclude packages from npm audit. [1] - npmPublishRegistry: registry used for npm publishes. [1] - npmRegistries: configure additional npm registries. [1] - npmRegistryServer: set the npm registry server. [1] - npmScopes: configure per-scope npm settings (including per-scope npmRegistryServer and auth). [1] - Example structure (scope-specific): npmScopes: my-scope: npmRegistryServer: "https://..." npmAuthToken: ${auth-token} npmAlwaysAuth: true (The key npmScopes itself is documented; the per-scope fields are covered under that section.) [1][2] 2) Controlling “release age” (minimum time since npm publish before Yarn will install) - npmMinimalAgeGate: numeric minimum age gate in minutes. When set > 0, Yarn blocks installation of versions that are younger than this threshold; 0 disables the gate. [3][4] - There was also work to set a default (e.g. 3 days = 4320 minutes) and allow opting out by setting npmMinimalAgeGate: 0. [5] - npmPreapprovedPackages: array of package descriptors and/or package name glob patterns to exclude from all package gates (i.e., allowlist/bypass for the gates, including the age gate). [1] Notes / limits: - The official Yarn config reference page lists many keys in.yarnrc.yml, including npm* and npmScopes as shown above. [1] - Yarn’s release-age gate is implemented under the npm resolver and is controlled by npmMinimalAgeGate plus the allowlist-style exclusions in npmPreapprovedPackages. [4] If you want, tell me your Yarn version (e.g., 4.10 vs 4.2) and whether you want the gate applied globally or only for certain npm scopes, and I can suggest a concrete.yarnrc.yml snippet using only supported keys.
Citations:
minimumReleaseAgeoption similar to pnpm yarnpkg/berry#6899npmMinimalAgeGateandnpmPreapprovedPackagesconfig options yarnpkg/berry#6901Fix
npmMinimalAgeGatevalue format: use numeric minutes, not string "3d".npmMinimalAgeGateis a valid Yarn configuration option that enforces a minimum age gate on npm packages. However, the value must be numeric (representing minutes), not a string. The intended 3-day gate should be set to4320(3 days × 24 hours × 60 minutes), not"3d". Without the correct numeric format, Yarn will fail to enforce this security control.🤖 Prompt for AI Agents