@theoptimalpartner/npm-security-kit 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/bin/install.sh +26 -32
  2. package/package.json +4 -4
package/bin/install.sh CHANGED
@@ -108,28 +108,17 @@ echo ""
108
108
  # Copy security files
109
109
  echo "Installing security files..."
110
110
 
111
+ # Template directory
112
+ TEMPLATE_DIR="$SCRIPT_DIR/../template"
113
+
111
114
  # 1. Blacklist
112
- if [ -f "$SCRIPT_DIR/template/.security/malicious-packages-blacklist.json" ]; then
113
- cp "$SCRIPT_DIR/template/.security/malicious-packages-blacklist.json" .security/
115
+ if [ -f "$TEMPLATE_DIR/.security/malicious-packages-blacklist.json" ]; then
116
+ cp "$TEMPLATE_DIR/.security/malicious-packages-blacklist.json" .security/
114
117
  echo -e "${GREEN} ✓ Blacklist installed${NC}"
115
118
  else
116
- # Fallback: copy from auth-service if available
117
- if [ -f "$SCRIPT_DIR/../auth-service/.security/malicious-packages-blacklist.json" ]; then
118
- cp "$SCRIPT_DIR/../auth-service/.security/malicious-packages-blacklist.json" .security/
119
- echo -e "${GREEN} ✓ Blacklist installed (from auth-service)${NC}"
120
- else
121
- echo -e "${YELLOW} ⚠ Blacklist not found, creating empty template${NC}"
122
- cat > .security/malicious-packages-blacklist.json <<'EOF'
123
- {
124
- "lastUpdated": "2025-10-20",
125
- "source": "Socket.dev",
126
- "blacklistedPackages": [],
127
- "patterns": [],
128
- "maliciousDomains": [],
129
- "suspiciousNpmAccounts": []
130
- }
131
- EOF
132
- fi
119
+ echo -e "${RED} ✗ Error: Blacklist template not found${NC}"
120
+ echo -e "${YELLOW} Expected: $TEMPLATE_DIR/.security/malicious-packages-blacklist.json${NC}"
121
+ exit 1
133
122
  fi
134
123
 
135
124
  # 2. Config
@@ -157,35 +146,40 @@ else
157
146
  fi
158
147
 
159
148
  # 3. Scripts
160
- if [ -f "$SCRIPT_DIR/template/scripts/check-malicious-packages.sh" ]; then
161
- cp "$SCRIPT_DIR/template/scripts/check-malicious-packages.sh" scripts/
149
+ if [ -f "$TEMPLATE_DIR/scripts/check-malicious-packages.sh" ]; then
150
+ cp "$TEMPLATE_DIR/scripts/check-malicious-packages.sh" scripts/
151
+ chmod +x scripts/check-malicious-packages.sh
162
152
  else
163
- cp "$SCRIPT_DIR/../auth-service/scripts/check-malicious-packages.sh" scripts/
153
+ echo -e "${RED} ✗ Error: check-malicious-packages.sh not found${NC}"
154
+ exit 1
164
155
  fi
165
156
 
166
- if [ -f "$SCRIPT_DIR/template/scripts/security-check.sh" ]; then
167
- cp "$SCRIPT_DIR/template/scripts/security-check.sh" scripts/
157
+ if [ -f "$TEMPLATE_DIR/scripts/security-check.sh" ]; then
158
+ cp "$TEMPLATE_DIR/scripts/security-check.sh" scripts/
159
+ chmod +x scripts/security-check.sh
168
160
  else
169
- cp "$SCRIPT_DIR/../auth-service/scripts/security-check.sh" scripts/
161
+ echo -e "${RED} ✗ Error: security-check.sh not found${NC}"
162
+ exit 1
170
163
  fi
171
164
 
172
- chmod +x scripts/*.sh
173
165
  echo -e "${GREEN} ✓ Scripts installed${NC}"
174
166
 
175
167
  # 4. GitHub Actions
176
- if [ -f "$SCRIPT_DIR/template/.github/workflows/security-audit.yml" ]; then
177
- cp "$SCRIPT_DIR/template/.github/workflows/security-audit.yml" .github/workflows/
168
+ if [ -f "$TEMPLATE_DIR/.github/workflows/security-audit.yml" ]; then
169
+ cp "$TEMPLATE_DIR/.github/workflows/security-audit.yml" .github/workflows/
178
170
  else
179
- cp "$SCRIPT_DIR/../auth-service/.github/workflows/security-audit.yml" .github/workflows/
171
+ echo -e "${RED} ✗ Error: security-audit.yml not found${NC}"
172
+ exit 1
180
173
  fi
181
174
 
182
175
  echo -e "${GREEN} ✓ GitHub Actions workflow installed${NC}"
183
176
 
184
177
  # 5. Dependabot
185
- if [ -f "$SCRIPT_DIR/template/.github/dependabot.yml" ]; then
186
- cp "$SCRIPT_DIR/template/.github/dependabot.yml" .github/
178
+ if [ -f "$TEMPLATE_DIR/.github/dependabot.yml" ]; then
179
+ cp "$TEMPLATE_DIR/.github/dependabot.yml" .github/
187
180
  else
188
- cp "$SCRIPT_DIR/../auth-service/.github/dependabot.yml" .github/
181
+ echo -e "${RED} ✗ Error: dependabot.yml not found${NC}"
182
+ exit 1
189
183
  fi
190
184
 
191
185
  echo -e "${GREEN} ✓ Dependabot config installed${NC}"
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@theoptimalpartner/npm-security-kit",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Portable security kit to protect Node.js/npm projects against malicious packages and vulnerabilities",
5
5
  "main": "src/index.js",
6
6
  "bin": {
7
- "npm-security-install": "./bin/install.js",
8
- "npm-security-check": "./bin/check.js"
7
+ "npm-security-install": "bin/install.js",
8
+ "npm-security-check": "bin/check.js"
9
9
  },
10
10
  "scripts": {
11
11
  "test": "echo \"No tests specified - package verified with npm pack\"",
@@ -28,7 +28,7 @@
28
28
  "license": "MIT",
29
29
  "repository": {
30
30
  "type": "git",
31
- "url": "https://bitbucket.org/RoutingUC/npm-security-kit.git"
31
+ "url": "git+https://bitbucket.org/RoutingUC/npm-security-kit.git"
32
32
  },
33
33
  "engines": {
34
34
  "node": ">=14.0.0",