hackmyagent 0.11.7 → 0.11.9
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/README.md +8 -16
- package/dist/cli.js +229 -21
- package/dist/cli.js.map +1 -1
- package/dist/hardening/index.d.ts +1 -1
- package/dist/hardening/index.d.ts.map +1 -1
- package/dist/hardening/scanner.d.ts +75 -0
- package/dist/hardening/scanner.d.ts.map +1 -1
- package/dist/hardening/scanner.js +1202 -232
- package/dist/hardening/scanner.js.map +1 -1
- package/dist/hardening/security-check.d.ts +3 -1
- package/dist/hardening/security-check.d.ts.map +1 -1
- package/dist/hardening/taxonomy.d.ts.map +1 -1
- package/dist/hardening/taxonomy.js +16 -0
- package/dist/hardening/taxonomy.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/registry/client.d.ts +26 -0
- package/dist/registry/client.d.ts.map +1 -1
- package/dist/registry/client.js +63 -0
- package/dist/registry/client.js.map +1 -1
- package/dist/registry/index.d.ts +2 -2
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +2 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/publish.d.ts +11 -0
- package/dist/registry/publish.d.ts.map +1 -1
- package/dist/registry/publish.js +62 -0
- package/dist/registry/publish.js.map +1 -1
- package/dist/semantic/integration/finding-adapter.d.ts +1 -0
- package/dist/semantic/integration/finding-adapter.d.ts.map +1 -1
- package/dist/semantic/integration/finding-adapter.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Hardening module
|
|
3
3
|
*/
|
|
4
4
|
export { HardeningScanner } from './scanner';
|
|
5
|
-
export type { ScanOptions } from './scanner';
|
|
5
|
+
export type { ScanOptions, ScanDepth } from './scanner';
|
|
6
6
|
export type { SecurityCheck, CheckResult, FixResult, SecurityFinding, ScanResult, Severity, } from './security-check';
|
|
7
7
|
export { getAttackClass, enrichWithTaxonomy } from './taxonomy';
|
|
8
8
|
export { NemoClawScanner, NEMOCLAW_CATEGORIES } from './nemoclaw-scanner';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hardening/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hardening/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAExD,YAAY,EACV,aAAa,EACb,WAAW,EACX,SAAS,EACT,eAAe,EACf,UAAU,EACV,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC"}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Scans for security issues and optionally auto-fixes them
|
|
4
4
|
*/
|
|
5
5
|
import type { ScanResult } from './security-check';
|
|
6
|
+
/** Scan depth for CAAT tiered scanning */
|
|
7
|
+
export type ScanDepth = 'quick' | 'standard' | 'deep';
|
|
6
8
|
export interface ScanOptions {
|
|
7
9
|
targetDir: string;
|
|
8
10
|
autoFix?: boolean;
|
|
@@ -14,6 +16,13 @@ export interface ScanOptions {
|
|
|
14
16
|
ignorePaths?: string[];
|
|
15
17
|
/** Enable Layer 3 LLM analysis (requires ANTHROPIC_API_KEY in CLI mode) */
|
|
16
18
|
deep?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* CAAT scan depth tier:
|
|
21
|
+
* quick — config checks, credential detection, basic file analysis only (Tier 4)
|
|
22
|
+
* standard — all hardening checks + dependency audit (default, Tier 2-3)
|
|
23
|
+
* deep — everything + LLM semantic analysis + attack simulation (Tier 1)
|
|
24
|
+
*/
|
|
25
|
+
scanDepth?: ScanDepth;
|
|
17
26
|
/** Progress callback for long-running operations */
|
|
18
27
|
onProgress?: (message: string) => void;
|
|
19
28
|
/** CLI command prefix for fix messages (default: 'hackmyagent') */
|
|
@@ -230,6 +239,72 @@ export declare class HardeningScanner {
|
|
|
230
239
|
* by web servers. Distinct from CRED-001 which checks config files.
|
|
231
240
|
*/
|
|
232
241
|
private checkWebServedCredentials;
|
|
242
|
+
/**
|
|
243
|
+
* CODEINJ-001: exec() with template literal interpolation
|
|
244
|
+
* Detects shell injection via exec/execSync called with template literals.
|
|
245
|
+
*/
|
|
246
|
+
private checkCodeInjection;
|
|
247
|
+
/**
|
|
248
|
+
* INSTALL-001: curl|sh without checksum in shell scripts
|
|
249
|
+
* Detects piped-to-shell install patterns in .sh files.
|
|
250
|
+
*/
|
|
251
|
+
private checkInstallScripts;
|
|
252
|
+
/**
|
|
253
|
+
* CLIPASS-001: Credentials passed as CLI arguments
|
|
254
|
+
* Detects --token, --password, --api-key, --secret followed by variable interpolation.
|
|
255
|
+
*/
|
|
256
|
+
private checkCLICredentialPassthrough;
|
|
257
|
+
/**
|
|
258
|
+
* INTEGRITY-001: Digest/hash verification bypass on falsy value
|
|
259
|
+
* Detects patterns like `if (digest &&` or `if (hash &&` where empty value skips check.
|
|
260
|
+
*/
|
|
261
|
+
private checkIntegrityBypass;
|
|
262
|
+
/**
|
|
263
|
+
* TOCTOU-001: Verify then use without atomic operation
|
|
264
|
+
* Detects files that verify and then execute on the same path without atomicity.
|
|
265
|
+
*/
|
|
266
|
+
private checkTOCTOU;
|
|
267
|
+
/**
|
|
268
|
+
* TMPPATH-001: Hardcoded /tmp paths without mktemp
|
|
269
|
+
* Detects writes to /tmp/ with hardcoded paths in shell scripts.
|
|
270
|
+
*/
|
|
271
|
+
private checkTmpPaths;
|
|
272
|
+
/**
|
|
273
|
+
* DOCKERINJ-001: Docker exec with variable interpolation
|
|
274
|
+
* Detects docker exec commands with unquoted variable expansion.
|
|
275
|
+
*/
|
|
276
|
+
private checkDockerInjection;
|
|
277
|
+
/**
|
|
278
|
+
* ENVLEAK-001: process.env spread to child process
|
|
279
|
+
* Detects passing all environment variables (including secrets) to child processes.
|
|
280
|
+
*/
|
|
281
|
+
private checkEnvLeak;
|
|
282
|
+
/**
|
|
283
|
+
* SANDBOX-005: Messaging API pre-allowed in sandbox policy
|
|
284
|
+
* Detects pre-allowed URLs for messaging services in sandbox policies.
|
|
285
|
+
*/
|
|
286
|
+
private checkSandboxMessaging;
|
|
287
|
+
/**
|
|
288
|
+
* WEBEXPOSE-001: CLAUDE.md in web-served directories
|
|
289
|
+
* WEBEXPOSE-002: .env files in web-served directories
|
|
290
|
+
* WEBEXPOSE-003: Sensitive config files in web-served directories
|
|
291
|
+
*/
|
|
292
|
+
private checkWebExposedFiles;
|
|
293
|
+
/**
|
|
294
|
+
* SOUL-OVERRIDE-001: Skill content can override SOUL.md
|
|
295
|
+
* Checks if SKILL.md and SOUL.md are loaded into the same prompt context without trust boundaries.
|
|
296
|
+
*/
|
|
297
|
+
private checkSoulOverride;
|
|
298
|
+
/**
|
|
299
|
+
* MEM-006: Memory store without input sanitization
|
|
300
|
+
* Detects memory/persistence plugins that store user-provided text without sanitization.
|
|
301
|
+
*/
|
|
302
|
+
private checkMemoryStoreSanitization;
|
|
303
|
+
/**
|
|
304
|
+
* AGENT-CRED-001: No credential output protection in system prompt
|
|
305
|
+
* Checks system prompts that mention exec/shell but lack credential protection instructions.
|
|
306
|
+
*/
|
|
307
|
+
private checkAgentCredentialProtection;
|
|
233
308
|
/** Helper: recursively find files in web-served directories */
|
|
234
309
|
private findWebFiles;
|
|
235
310
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/hardening/scanner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,UAAU,EAA0C,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/hardening/scanner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,UAAU,EAA0C,MAAM,kBAAkB,CAAC;AAwG3F,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,oDAAoD;IACpD,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAoID,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAiB;IAEhC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CA2BlC;IAEF;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAM7B;;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