@westbayberry/dg 1.0.59 → 1.0.61

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.
Files changed (3) hide show
  1. package/dist/index.mjs +2047 -733
  2. package/package.json +1 -1
  3. package/README.md +0 -129
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@westbayberry/dg",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "Supply chain security scanner for npm and Python dependencies — 35 behavioral detectors catch zero-day attacks CVE databases miss. 99.66% catch rate on 155K packages.",
5
5
  "bin": {
6
6
  "dependency-guardian": "dist/index.mjs",
package/README.md DELETED
@@ -1,129 +0,0 @@
1
- # @westbayberry/dg
2
-
3
- Behavioral supply chain security for npm and Python. Reads what packages
4
- actually do — install hooks, credential access, network exfiltration,
5
- obfuscation — and gates risky installs before they touch your machine.
6
-
7
- **53 detectors · 95.20% npm / 93.88% PyPI catch rate on 17,874 packages · 0.44% npm / 0.29% PyPI FPR** —
8
- [published methodology](https://westbayberry.com/benchmark).
9
-
10
- ## What `dg` actually does
11
-
12
- | Surface | What it does | Default mode |
13
- |---|---|---|
14
- | `dg npm install <pkg>` | Resolves the full dependency tree (top-level + transitive) without running install scripts, scans every package, then invokes the real `npm install` only if the verdict permits. Top-level versions are pinned to the exact version we scanned. Bare `dg npm install` honors `package-lock.json` pinned versions. | **block** |
15
- | `dg pip install <pkg>` | Resolves the full pip tree via `pip install --dry-run --report=-` (pip ≥ 23.0); scans the full set before invoking real `pip install`. On older pip, transitive scan is reported as unavailable and (in block mode) the install is refused. | **block** |
16
- | `dg scan` | Read-only audit. Diffs lockfiles and reports findings. Does **not** block anything by default. | warn |
17
- | `dg hook install` | Adds a pre-commit hook that runs `dg scan --mode block` when a lockfile change is staged. Quiet when nothing is wrong. | block |
18
-
19
- For maximum protection in CI/build pipelines, add `--strict` to the install
20
- wrapper. `--strict` implies `--dg-no-scripts` and refuses any partial-coverage
21
- scan (transitive enumeration must succeed).
22
-
23
- DG only activates when you intentionally invoke it, install the hook, or
24
- run it in CI. It does not globally hijack `npm`/`pip`.
25
-
26
- ## Install
27
-
28
- ```bash
29
- npm install -g @westbayberry/dg
30
- ```
31
-
32
- Requires Node.js 18+.
33
-
34
- ## Quick Start
35
-
36
- ```bash
37
- dg login
38
- dg scan # read-only audit of the current project
39
- ```
40
-
41
- Scope-truthful output: a clean project shows
42
- `✓ Dependency Guardian checked 142 packages. No risky behavior found.`
43
- A flagged install shows only the warn/block packages with one-line
44
- reasons and a clear next step.
45
-
46
- Supports `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`,
47
- `requirements.txt`, `Pipfile.lock`, and `poetry.lock`.
48
-
49
- ## Commands
50
-
51
- ```
52
- dg scan Read-only audit of the project's lockfiles
53
- dg status Show your auth state, plan tier, and whether protection is on
54
- dg login / logout Manage authentication
55
- dg npm install <pkg> Protective install wrapper (default mode: block)
56
- dg pip install <pkg> Protective install wrapper (default mode: block)
57
- dg protect Opt this project in to auto-protection on every install
58
- dg protect off Disable opt-in protection in this project
59
- dg wrap Print the shell-alias snippet without writing a project marker
60
- dg hook install Install a git pre-commit hook that gates lockfile diffs
61
- dg hook uninstall Remove the git pre-commit hook
62
- dg publish-check Self-scan before `npm publish` / `pip upload`
63
- dg update Check for and install the latest version
64
- ```
65
-
66
- Full reference: <https://westbayberry.com/docs/cli-reference>
67
-
68
- ## Common Options
69
-
70
- | Flag | Default | Description |
71
- |------|---------|-------------|
72
- | `--mode <mode>` | `warn` for `scan`, `block` for install wrappers | `block` / `warn` / `off` |
73
- | `--details` | off | Verbose table view (the older format) |
74
- | `--explain` | off | Plain-English explanation of findings |
75
- | `--json` | off | Stable machine-readable JSON (CI) |
76
- | `--ci` | auto when `CI=1` | Deterministic output, no spinners |
77
- | `--dg-force` | off | Bypass a block (visible in output, audit-friendly) |
78
- | `--dg-no-scripts` | off | Pass `--ignore-scripts` to the real install |
79
- | `--strict` | off | Refuse partial-coverage scans + auto `--dg-no-scripts` |
80
- | `--quiet` | off | Suppress login + update nudges (still prints findings) |
81
- | `--workspace <dir>` | | Scan a specific workspace subdirectory |
82
-
83
- ## Exit Codes
84
-
85
- | Code | Meaning |
86
- |------|---------|
87
- | `0` | Pass |
88
- | `1` | Warning |
89
- | `2` | Block |
90
- | `3` | Error |
91
-
92
- ## CI
93
-
94
- ```bash
95
- npx @westbayberry/dg login
96
- npx @westbayberry/dg scan --mode block --json
97
- ```
98
-
99
- Wire exit code `2` into your pipeline to fail the build.
100
-
101
- ## Configuration
102
-
103
- Settings come from CLI flags, environment variables, or a `.dgrc.json` file in the project or home directory. CLI flags take precedence.
104
-
105
- ```json
106
- {
107
- "apiKey": "dg_...",
108
- "mode": "block"
109
- }
110
- ```
111
-
112
- ## Telemetry
113
-
114
- The CLI sends anonymous crash reports to Sentry (error message, stack trace, Node version, OS, CLI version). It never sends package names, file paths, API keys, or scan results. API keys and home directory paths are redacted before transmission.
115
-
116
- Opt out:
117
-
118
- ```bash
119
- export DG_TELEMETRY=0 # or
120
- export DO_NOT_TRACK=1
121
- ```
122
-
123
- ## Links
124
-
125
- - [Dashboard](https://westbayberry.com/dashboard)
126
- - [Documentation](https://westbayberry.com/docs) — setup walkthrough
127
- - [CLI reference](https://westbayberry.com/docs/cli-reference) — every command and flag
128
- - [Pricing](https://westbayberry.com/pricing)
129
- - [Changelog](https://github.com/WestBayBerry/dependency-guardian-action/blob/main/CHANGELOG.md)