@theoptimalpartner/npm-security-kit 1.0.2 → 2.0.0-beta.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 +44 -125
- package/LICENSE +1 -1
- package/README.md +127 -426
- package/bin/npm-security-kit.js +12 -0
- package/package.json +17 -34
- package/src/checks/dockerfile.js +217 -0
- package/src/checks/index.js +10 -0
- package/src/checks/install-scripts.js +77 -0
- package/src/checks/malware.js +61 -0
- package/src/checks/node-version.js +234 -0
- package/src/checks/npm-policy.js +121 -0
- package/src/checks/vulnerabilities.js +79 -0
- package/src/cli.js +117 -0
- package/src/context.js +147 -0
- package/src/init.js +236 -0
- package/src/lib/allow-scripts.js +61 -0
- package/src/lib/audit.js +80 -0
- package/src/lib/diff.js +54 -0
- package/src/lib/dockerfile.js +74 -0
- package/src/lib/json-lines.js +12 -0
- package/src/lib/lockfile.js +48 -0
- package/src/lib/node-calendar.js +73 -0
- package/src/lib/npmrc.js +93 -0
- package/src/lib/semver.js +74 -0
- package/src/policy.js +36 -0
- package/src/report.js +68 -0
- package/src/run.js +35 -0
- package/src/version.js +3 -0
- package/EXAMPLES.md +0 -528
- package/QUICK_START.md +0 -291
- package/bin/check.js +0 -30
- package/bin/install.js +0 -36
- package/bin/install.sh +0 -318
- package/src/index.js +0 -71
- package/template/.github/dependabot.yml +0 -63
- package/template/.github/workflows/security-audit.yml +0 -218
- package/template/.security/config.json +0 -94
- package/template/.security/malicious-packages-blacklist.json +0 -259
- package/template/scripts/check-malicious-packages.sh +0 -118
- package/template/scripts/security-check.sh +0 -166
package/CHANGELOG.md
CHANGED
|
@@ -1,127 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- Project configuration file (`.security/config.json`)
|
|
48
|
-
- Comprehensive documentation:
|
|
49
|
-
- README.md - Full package documentation
|
|
50
|
-
- QUICK_START.md - 3-minute installation guide
|
|
51
|
-
- EXAMPLES.md - 12 real-world usage scenarios
|
|
52
|
-
- PUBLISHING.md - Guide for package publication
|
|
53
|
-
- Automatic npm scripts injection into `package.json`:
|
|
54
|
-
- `security:check-malicious`
|
|
55
|
-
- `security:check`
|
|
56
|
-
- `security:audit`
|
|
57
|
-
- `security:audit:fix`
|
|
58
|
-
- `security:outdated`
|
|
59
|
-
- `security:licenses`
|
|
60
|
-
- `security:full`
|
|
61
|
-
- SECURITY.md template for projects
|
|
62
|
-
- Support for both new and existing projects
|
|
63
|
-
- Update mode (`--update` flag) to preserve existing configurations
|
|
64
|
-
|
|
65
|
-
### Security
|
|
66
|
-
- Protection against 175+ known malicious packages
|
|
67
|
-
- Automated weekly security scans via GitHub Actions
|
|
68
|
-
- Pre-deployment security checks
|
|
69
|
-
- Vulnerability detection and auto-fix capabilities
|
|
70
|
-
|
|
71
|
-
## [0.0.0] - 2025-10-20
|
|
72
|
-
|
|
73
|
-
### Development
|
|
74
|
-
- Project structure created
|
|
75
|
-
- Template files developed
|
|
76
|
-
- Initial testing in auth-service, jwt-auth-package, and auth-react-client projects
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## Version History Summary
|
|
81
|
-
|
|
82
|
-
- **1.0.1** - Bug fix for installation paths
|
|
83
|
-
- **1.0.0** - Initial public release
|
|
84
|
-
- **0.0.0** - Development phase
|
|
85
|
-
|
|
86
|
-
## Upgrade Guide
|
|
87
|
-
|
|
88
|
-
### From 1.0.0 to 1.0.1
|
|
89
|
-
|
|
90
|
-
No breaking changes. Simply update the package:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
npm update @theoptimalpartner/npm-security-kit
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
If you want to refresh your security files:
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
bash ./node_modules/@theoptimalpartner/npm-security-kit/bin/install.sh --update
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Links
|
|
103
|
-
|
|
104
|
-
- [npm Package](https://www.npmjs.com/package/@theoptimalpartner/npm-security-kit)
|
|
105
|
-
- [Bitbucket Repository](https://bitbucket.org/RoutingUC/npm-security-kit)
|
|
106
|
-
- [Socket.dev - Original Research](https://socket.dev)
|
|
107
|
-
|
|
108
|
-
## Contributing
|
|
109
|
-
|
|
110
|
-
When making changes that affect the public API or user experience:
|
|
111
|
-
|
|
112
|
-
1. Update this CHANGELOG.md following Keep a Changelog format
|
|
113
|
-
2. Categorize changes as:
|
|
114
|
-
- **Added** - New features
|
|
115
|
-
- **Changed** - Changes in existing functionality
|
|
116
|
-
- **Deprecated** - Soon-to-be removed features
|
|
117
|
-
- **Removed** - Removed features
|
|
118
|
-
- **Fixed** - Bug fixes
|
|
119
|
-
- **Security** - Security improvements
|
|
120
|
-
3. Use semantic versioning:
|
|
121
|
-
- MAJOR - Breaking changes
|
|
122
|
-
- MINOR - New features (backwards compatible)
|
|
123
|
-
- PATCH - Bug fixes (backwards compatible)
|
|
124
|
-
|
|
125
|
-
## Reporting Issues
|
|
126
|
-
|
|
127
|
-
If you discover a security vulnerability or malicious package not in our blacklist, please report it immediately at the Bitbucket repository issues page.
|
|
3
|
+
Cambios del paquete `@theoptimalpartner/npm-security-kit`. Formato basado en
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/es-ES/1.1.0/); versiones con [SemVer](https://semver.org/lang/es/).
|
|
5
|
+
|
|
6
|
+
## [2.0.0] - sin publicar
|
|
7
|
+
|
|
8
|
+
Reescritura completa. La v2 es una CLI de Node sin dependencias que corre en el pipeline **antes de `npm ci`**.
|
|
9
|
+
Sale primero como beta (`2.0.0-beta.N`), con el dist-tag `beta`. Desde la `2.0.0-beta.1`, el step del pipeline y
|
|
10
|
+
`init` usan `npx --yes --min-release-age=0`: `npx` no aplica `min-release-age-exclude` y, sin el flag, una versión
|
|
11
|
+
nueva del kit no se puede usar hasta cumplir 7 días.
|
|
12
|
+
|
|
13
|
+
### BREAKING
|
|
14
|
+
|
|
15
|
+
- Un solo comando, `npm-security-kit`, con los subcomandos `check` e `init`. Se quitan los `bin`
|
|
16
|
+
`npm-security-install`, `npm-security-check`, `npm-security-setup-husky` y `npm-security-integrate-pipeline`.
|
|
17
|
+
- Se quita la blacklist de 175 paquetes, `src/index.js` (`isMalicious`, `matchesMaliciousPattern`) y
|
|
18
|
+
`.security/config.json`: los advisories del registro de npm ya cubren esos paquetes, y la lista solo miraba las
|
|
19
|
+
dependencias directas, después de instalar.
|
|
20
|
+
- Se quitan `check-malicious-packages.sh` y `security-check.sh` (se cortaba en el paso 2), husky y sus hooks, la
|
|
21
|
+
plantilla de `bitbucket-pipelines.yml` (pisaba el pipeline del proyecto) y el `SECURITY.md` generado.
|
|
22
|
+
- Se quitan AUTOMATION_GUIDE, QUICK_START, EXAMPLES, NPM_SECURITY_KIT_SUMMARY y NPM_SECURITY_PROTOCOL. Quedan
|
|
23
|
+
el README (uso) y este CHANGELOG.
|
|
24
|
+
- Requiere Node ≥ 18.3.
|
|
25
|
+
|
|
26
|
+
### Agregado
|
|
27
|
+
|
|
28
|
+
- `check`: malware (CWE-506) en todo el árbol y con cualquier severidad; vulnerabilidades `critical` en producción;
|
|
29
|
+
versión de Node contra el calendario de nodejs.org; claves del `.npmrc`, `engines.npm`, npm en uso y lockfile;
|
|
30
|
+
install scripts contra `allowScripts`; Dockerfiles que instalan sin el `.npmrc`. Salida en texto o `--json`,
|
|
31
|
+
exit 0/1/2.
|
|
32
|
+
- `init`: completa `.npmrc` y `engines` sin borrar nada, lista los install scripts por aprobar y muestra el step
|
|
33
|
+
del pipeline y los cambios de los Dockerfiles. `--dry-run` muestra el diff.
|
|
34
|
+
- Override de install scripts por repo con `npm_config_strict_allow_scripts=false`.
|
|
35
|
+
|
|
36
|
+
### Cómo migrar desde la 1.x
|
|
37
|
+
|
|
38
|
+
1. Borrar lo que instaló la v1, si no se usa para otra cosa: `.security/`, `scripts/check-malicious-packages.sh`,
|
|
39
|
+
`scripts/security-check.sh`, `.husky/` (y el `"prepare": "husky install"`), los scripts `security:*` del
|
|
40
|
+
`package.json` y el `SECURITY.md` generado.
|
|
41
|
+
2. Si la v1 reemplazó el `bitbucket-pipelines.yml`, recuperar el del repo desde git.
|
|
42
|
+
3. Correr `npx --yes --min-release-age=0 @theoptimalpartner/npm-security-kit@2.0.0 init` y seguir los pasos que imprime (README).
|
|
43
|
+
|
|
44
|
+
## [1.0.2] y anteriores
|
|
45
|
+
|
|
46
|
+
Versiones 1.x, sin mantenimiento desde la 2.0.0. Para migrar, ver arriba.
|
package/LICENSE
CHANGED