muaddib-scanner 2.11.9 → 2.11.10

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/.env.example CHANGED
@@ -34,6 +34,10 @@ OSM_API_TOKEN=
34
34
  # MUADDIB_METADATA_FACTOR=0 # registry signals -> reputation multiplier
35
35
  # MUADDIB_DELTA_MODE=0 # delta scoring against prior versions
36
36
  #
37
- # Skip the npm registry fetch ENTIRELY (disables MATURE_CAP + METADATA_FACTOR
38
- # + DELTA_MODE in one shot, useful for air-gap / offline CI / perf-critical):
37
+ # Skip ALL network fetches (npm registry packument + GitHub Releases IOC
38
+ # bootstrap) in one shot. Disables MATURE_CAP + METADATA_FACTOR + DELTA_MODE
39
+ # at the per-scan level AND the first-run IOC database download. Useful for:
40
+ # - air-gap / offline CI environments
41
+ # - test runners (set automatically by tests/run-tests.js)
42
+ # - perf-critical batch scans where you've pre-warmed the IOC cache
39
43
  # MUADDIB_NO_REGISTRY_FETCH=1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muaddib-scanner",
3
- "version": "2.11.9",
3
+ "version": "2.11.10",
4
4
  "description": "Supply-chain threat detection & response for npm & PyPI/Python",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -149,6 +149,17 @@ async function ensureIOCs() {
149
149
  }
150
150
  }
151
151
 
152
+ // Offline / CI escape hatch: cache is empty/missing AND we don't want to
153
+ // hit the network. Tests and air-gapped environments use this to avoid
154
+ // 1-2s timeouts × N tests when the asset is unavailable. Same env var as
155
+ // the per-scan registry fetch hatch so a single MUADDIB_NO_REGISTRY_FETCH=1
156
+ // covers both bootstrap + per-scan paths. Important: this gate sits AFTER
157
+ // the cache check so a healthy cache still returns true even in offline
158
+ // mode (otherwise tests that pre-populate the cache would falsely fail).
159
+ if (process.env.MUADDIB_NO_REGISTRY_FETCH === '1') {
160
+ return false;
161
+ }
162
+
152
163
  // Download IOCs (messages go to stderr to avoid contaminating JSON/SARIF stdout)
153
164
  process.stderr.write('[MUADDIB] First run: downloading IOC database...\n');
154
165
  await downloadAndDecompress(IOCS_URL, IOCS_PATH);