@pho9ubenaa/siro 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.1]
4
+
5
+ ### Maintenance
6
+
7
+ - Update development dependencies to address known CVEs and remove deprecated `git-raw-commits`. Upgrade Knip and replace its local low-memory patch with upstream support.
8
+
9
+ - Update pinned GitHub Actions to checkout 7.0.1, setup-node 7.0.0, and pnpm/action-setup 6.0.10 after the three-day release-age window. Explicitly disable automatic Node package-manager caching in the publication job.
10
+ - Set Dependabot version-update cooldown to three days, matching pnpm's minimum release age.
11
+
12
+ ## [0.4.0]
13
+
14
+ ### Breaking Changes
15
+
16
+ - **One remediation per check**: replace binding `fix`/`fixKind` and finding `fix`/`fixable`/`manualSteps` with automatic operations or manual instructions in `remediation`. JSON output uses schema 2.
17
+ - **Explicit library configuration**: `lint` evaluates without executing repository configuration. Pass extensions inside `config`; use `loadConfig` to opt into trusted code execution. `LintCommandOptions` adds reporting to `LintOptions`.
18
+ - **Validated extension boundaries**: parsed values and `getByPath()` results are `unknown`. Rules, bindings, reporters, and configuration maps require ordinary or null-prototype objects. Path constructors reject invalid roots and parent traversal.
19
+ - **Simpler bindings and exports**: remove `fileGlob`, separate automatic/advisory binding types, `requireConfigKey.extraFix`, `KeyAssignment`, and internal implementation exports. `RuleContext.readConfig` shares parsed inputs across checks; a violation can identify an additional input file.
20
+
21
+ ### Fixes
22
+
23
+ - Keep version- and environment-dependent defaults at the configured severity until their conditions can be established.
24
+ - Align npm 12 script-policy precedence, URL restrictions, release-age values, and lockfile guidance with the cited upstream policy.
25
+ - Read Aube `strictDepBuilds` from `.npmrc`, combine it with workspace `jailBuilds`, and report and propose changes in the correct files. Correct advisory/trust defaults, paranoid overrides, and supported lockfiles.
26
+ - Honor pnpm `ignoreScripts` and Bun's boolean auto-install disable. Keep store, provenance, and frozen-install guidance within what configuration alone establishes.
27
+ - Correct npm/Aube exact-save precedence and Deno registry import checks, including tags, missing versions, partial versions, and subpaths.
28
+ - Match supported Deno and Yarn release-age formats; reject malformed ages and exclusions while preserving valid exclusions in remediation.
29
+ - Honor Deno's configured lockfile path and flag disabled or malformed lock settings. Report unsupported `deno.jsonc` explicitly.
30
+ - Reject invalid consumed manifest fields, non-mapping JSON/YAML roots, empty JSON, invalid extension results, and inaccessible or non-directory targets with actionable errors.
31
+ - Preserve severity overrides for prototype-named rules and compute exit decisions before custom reporters run. Require manual review when remediation would overwrite a settings container or leave a security bypass active.
32
+ - Validate repeated, missing, unknown, and non-boolean CLI options consistently. Match Node support against the package engine range.
33
+ - Limit the declared Node.js support range to the maintained majors exercised by CI.
34
+ - Reject cyclic YAML aliases and excessive alias expansion without repeatedly traversing unused nested anchors.
35
+
36
+ ### Refactoring
37
+
38
+ - Consolidate CLI parsing on Node's argument tokenizer and remove the direct `cac` dependency. Keep configuration validation and parsed-file caching at their input boundaries.
39
+ - Replace custom script loaders, rule scaffolding, layer restrictions, and selective hook machinery with native Node scripts and direct verification commands.
40
+ - Generate rule inputs, default severities, and version notes from live bindings. Replace the duplicated version matrix with concise policy sources and interpretation limits.
41
+ - Remove private OSS research from the public repository and replace the single-package dependency catalog with exact versions in `package.json`.
42
+ - Build before every test command so executable CLI and public API cases cannot silently skip. Run full verification in CI and before release staging; require the tag to match the package version and stage exactly one packed artifact.
43
+
44
+ ### Security and documentation
45
+
46
+ - Pin GitHub Actions to full commit SHAs, disable persisted checkout credentials, and configure Dependabot updates.
47
+ - Add security reporting guidance, a threat model, and a concrete configuration example. Clarify executable configuration, static-analysis limits, migration, and package verification.
48
+
3
49
  ## [0.3.0]
4
50
 
5
51
  ### Features
@@ -52,36 +98,7 @@ Initial public release. 27 rules across 6 package managers (npm, pnpm, yarn, bun
52
98
  - **`--pm` flag**: target a specific package manager.
53
99
  - **`--json` flag**: shortcut for `--reporter json`.
54
100
 
55
- ### Rules added
56
-
57
- - `advisory-check` — aube `security.advisoryCheck`
58
- - `approved-git-repos` — yarn `npmScopes.*.approvedGitRepos`
59
- - `audit-suppression` — yarn `npmAuditExclude`
60
- - `block-auto-install` — pnpm `autoInstallPeers`, aube `peerDependencies.autoInstall`
61
- - `block-exotic-subdeps` — aube `blockExoticSubdeps`
62
- - `bun-security-scanner` — bun `install.security`
63
- - `checksum-verification` — pnpm `verifyStoreIntegrity`, aube `checksumVerification`
64
- - `commit-lockfile` — npm `lockfileVersion` (lockfile committed to git)
65
- - `dependency-overrides` — pnpm `pnpm.overrides`, aube `overrides`
66
- - `disable-lifecycle-scripts` — npm `ignore-scripts`, pnpm `strictDepBuilds`, yarn `enableScripts`, bun `install.ignoreScripts`, deno `deno.json#/tasks`, aube `jailBuilds`
67
- - `enforce-strict-ssl` — npm/yarn/pnpm/bun/aube `strict-ssl`
68
- - `files-field` — npm `files` in package.json
69
- - `frozen-lockfile` — npm `ci` enforcement, pnpm `frozen-lockfile`, yarn `freezeLockfile`, aube `preferFrozenLockfile`
70
- - `frozen-store` — pnpm `store.frozen`
71
- - `hardened-mode` — yarn `enableHardenedMode`
72
- - `minimum-release-age` — pnpm `fetchRetries`, aube `minimumReleaseAge`
73
- - `named-registries` — pnpm `registries.*.registry`
74
- - `paranoid-mode` — aube `paranoid`
75
- - `patched-dependencies` — pnpm `patchedDependencies`
76
- - `pin-exact-versions` — npm `save-exact`, pnpm `save-exact`, deno `deno.json#/imports`
77
- - `provenance` — npm/pnpm `publishConfig.provenance`
78
- - `publish-access` — npm/pnpm `publishConfig.access`
79
- - `publishable` — package.json `private`
80
- - `store-server` — pnpm `store.server`
81
- - `strict-allow-scripts` — aube `strictAllowScripts`
82
- - `strict-release-age` — aube `strictReleaseAge`
83
- - `strict-store-integrity` — pnpm `store.integrity`
84
- - `trust-policy` — aube `trustPolicy`
101
+ Earlier implementations remain available in the release tags. See the [rule reference](docs/rules.md) for current policies.
85
102
 
86
103
  ### Tooling
87
104
 
package/README.md CHANGED
@@ -4,36 +4,52 @@
4
4
  [![npm](https://img.shields.io/npm/v/@pho9ubenaa/siro)](https://www.npmjs.com/package/@pho9ubenaa/siro)
5
5
  [![license](https://img.shields.io/github/license/pHo9UBenaA/siro)](https://github.com/pHo9UBenaA/siro/blob/main/LICENSE)
6
6
 
7
- > Security best-practices linter for the npm ecosystem — npm, pnpm, yarn, bun, deno, aube.
7
+ > Security best-practices linter for the npm ecosystem — npm, pnpm, yarn, bun, deno, [aube](https://github.com/aubepkg/aube).
8
8
 
9
9
  [Getting started](docs/getting-started.md) ·
10
10
  [Rules](docs/rules.md) ·
11
11
  [Comparison](docs/comparison.md) ·
12
12
  [Configuration](docs/configuration.md)
13
13
 
14
- `siro` **lints** repos for supply-chain risks, graded `error` / `warn` / `info`,
15
- and emits machine-readable remediation so an editor or agent skill
16
- can apply the fixes.
14
+ `siro` is **inspired by** the community-maintained [npm security best practices](https://github.com/bodadotsh/npm-security-best-practices)
15
+ and turns those recommendations into something you can run: it **lints** repos for supply-chain risks,
16
+ graded `error` / `warn` / `info`, and emits machine-readable remediation so an editor or agent skill
17
+ can apply the fixes. The rule selection and severities reflect siro's own opinions; it is not
18
+ affiliated with the upstream doc.
17
19
 
18
20
  ```sh
19
- npx @pho9ubenaa/siro lint
20
- npx @pho9ubenaa/siro lint --reporter json # machine-readable output with fix ops (see docs/json-output.md)
21
+ npx @pho9ubenaa/siro lint # report best-practice violations in the current repo
22
+ npx @pho9ubenaa/siro lint --reporter json # machine-readable remediation (see docs/json-output.md)
21
23
  ```
22
24
 
25
+ ## A concrete example
26
+
27
+ For maintainers and CI owners, siro makes package-manager policy gaps visible during review. For example, change an unsafe npm script setting:
28
+
29
+ ```diff
30
+ # .npmrc
31
+ -ignore-scripts=false
32
+ +ignore-scripts=true
33
+ ```
34
+
35
+ Run `siro lint --pm npm --project-type application` before and after the edit. The `disable-lifecycle-scripts` error clears when this setting is enabled; other findings remain until addressed. Review required build scripts before changing their execution policy.
36
+
37
+ The CLI reads `siro.config.*` as executable code. Review repository configuration before running it, particularly in CI. See the [threat model](docs/threat-model.md) and [security reporting policy](SECURITY.md).
38
+
23
39
  ## Features
24
40
 
25
- - **27 rules across 6 managers.** Covering lifecycle scripts, version pinning, lockfiles
41
+ - **Rules across six managers.** 27 rules covering lifecycle scripts, version pinning, lockfiles
26
42
  (`commit`/`frozen`), release age, publish provenance, `files`/`publishConfig`, SSL enforcement,
27
43
  checksum verification, exotic subdependency blocking, audit suppression review, store integrity,
28
44
  Bun's security scanner API, and Yarn 4's hardened-mode — each mapped to the right setting per
29
45
  package manager (`.npmrc`, `pnpm-workspace.yaml`, `.yarnrc.yml`, `bunfig.toml`, `deno.json`,
30
46
  `aube-workspace.yaml`, `package.json`).
31
- - **PM-aware severities.** When a manager's documented default already satisfies a rule (e.g.
32
- Yarn's `enableScripts: false`, aube's `preferFrozenLockfile: true`), the finding is demoted
33
- to `info` so CI noise stays proportional to real risk.
34
- - **Machine-readable remediation.** Every finding carries `fix` operations or `manualSteps` in the
35
- JSON output — hand it to an agent skill or editor plugin that edits the files and re-runs
36
- `siro lint` until it exits `0`. See [JSON output](docs/json-output.md).
47
+ - **PM-aware severities.** When a manager's documented default satisfies a rule across every
48
+ supported version and target environment, the finding is demoted to `info`. Installed versions
49
+ and CI conditions are not checked, so defaults that depend on either retain the rule's severity.
50
+ - **Machine-readable remediation.** A finding can carry automatic key operations or manual
51
+ instructions. Review proposed changes and rerun the linter after editing.
52
+ See [docs/json-output.md](docs/json-output.md).
37
53
  - **Lint with severities.** `error` fails CI by default; `--severity warn` tightens the gate.
38
54
  - **Reporters.** `pretty` (default), `json` for CI, `github` for PR annotations; register your own.
39
55
  - **Configurable.** Drop a `siro.config.ts` to disable rules, override severities, restrict PMs,
@@ -44,50 +60,44 @@ See the [rule reference](docs/rules.md) for what each check does and why, and th
44
60
 
45
61
  ## Versioning policy
46
62
 
47
- `siro` is **version-agnostic**: it never inspects the actual version of npm / pnpm / yarn / bun /
48
- deno your project is running. Every rule is written against the **latest stable major** of each
49
- manager — that's the configuration surface we lint and the defaults we trust.
50
-
51
- When a rule's binding knows that a key was introduced or had its default tightened in a specific
52
- version, the finding's message carries a `(available since pnpm 10.16.0; default safe since pnpm 11.0.0 (1440 minutes))`
53
- suffix as documentation — but siro does not branch on it. If your project pins an older PM, the
54
- right move is usually to upgrade; the lint output stays the same either way.
55
-
56
- See [version matrix](docs/version-matrix.md) for the per-rule × per-PM version table
57
- that backs those suffixes.
63
+ siro evaluates the recorded policy snapshot in [docs/policy-sources.md](docs/policy-sources.md).
64
+ It detects package-manager names, not effective runtime versions. Version annotations describe
65
+ verified upstream facts. A version-dependent safe-default annotation prevents an unverified
66
+ severity downgrade; it does not prove that the current version satisfies the rule. See
67
+ [configuration](docs/configuration.md) for defaults, applicability, and limits.
58
68
 
59
69
  ## Usage
60
70
 
61
71
  ```
62
72
  siro <lint|check> [path] [options]
63
73
 
64
- --pm <npm|pnpm|yarn|bun|deno|aube> Target a specific package manager (auto-detected; required if detection finds nothing)
65
- --project-type <application|package> Select application or published-package policy (default auto)
66
- --reporter <pretty|json|github> Output format (default pretty)
67
- --severity <error|warn|info> Show and fail on findings at or above this level
68
- --json Shortcut for --reporter json
69
- --version, --help
74
+ --pm <npm|pnpm|yarn|bun|deno|aube> Target a specific package manager (auto-detected; required if detection finds nothing)
75
+ --project-type <application|package> Select application or published-package policy (default auto)
76
+ --reporter <pretty|json|github> Output format (default pretty)
77
+ --severity <error|warn|info> Show and fail on findings at or above this level
78
+ --json Shortcut for --reporter json
79
+ --version, --help
70
80
  ```
71
81
 
72
82
  `check` is an alias of `lint` (same flags, same exit codes) — provided so `siro check` reads naturally in CI scripts.
73
83
 
74
- Exit codes: `0` clean · `1` findings at/above threshold · `2` usage error · `70` uncaught exception (a siro bug or a throwing reporter/custom rule).
84
+ Exit codes: `0` no findings at/above threshold · `1` findings at/above threshold · `2` usage or configuration error · `70` uncaught exception (a siro bug or a throwing reporter/custom rule).
75
85
 
76
86
  ## How is this different from `npm audit` / `osv-scanner`?
77
87
 
78
88
  Different layer of the supply-chain pipeline; you want both.
79
89
 
80
- | Tool | What it checks | Where the data comes from |
81
- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
82
- | `npm audit` · osv-scanner · Snyk · Dependabot | **Known CVEs** in your installed dependency tree | GHSA / OSV.dev / vendor feeds |
83
- | `siro` | **Your install pipeline's configuration** — postinstall scripts, version ranges, lockfile policy, publish provenance, files allow-list, etc. | Static analysis of `.npmrc`, `pnpm-workspace.yaml`, `.yarnrc.yml`, `bunfig.toml`, `deno.json`, `aube-workspace.yaml`, `package.json` |
90
+ | Tool | What it checks | Where the data comes from |
91
+ | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
92
+ | `npm audit` · [osv-scanner](https://github.com/google/osv-scanner) · Snyk · Dependabot | **Known CVEs** in your installed dependency tree | GHSA / OSV.dev / vendor feeds |
93
+ | `siro` | **Your install pipeline's configuration** — postinstall scripts, version ranges, lockfile policy, publish provenance, files allow-list, etc. | Static analysis of `.npmrc`, `pnpm-workspace.yaml`, `.yarnrc.yml`, `bunfig.toml`, `deno.json`, `aube-workspace.yaml`, `package.json` |
84
94
 
85
- `npm audit` tells you "this dependency has a known vulnerability". `siro` tells you "even if a brand-new vulnerability lands tomorrow, your install settings can't trust it without review". Run both in CI.
95
+ `npm audit` reports known vulnerabilities. `siro` reports supported configuration gaps that can increase exposure to malicious dependencies. Neither a clean result nor a cooldown window guarantees safety. Run both in CI.
86
96
 
87
97
  ## Contributing
88
98
 
89
99
  Adding a rule or a package manager is a localized change — see
90
- [contributing guide](docs/contributing.md).
100
+ [docs/contributing.md](docs/contributing.md).
91
101
 
92
102
  ## License
93
103