defense-mcp-server 0.9.3 → 0.9.4

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 (134) hide show
  1. package/package.json +2 -2
  2. package/build/core/auto-installer.d.ts +0 -102
  3. package/build/core/auto-installer.d.ts.map +0 -1
  4. package/build/core/backup-manager.d.ts +0 -63
  5. package/build/core/backup-manager.d.ts.map +0 -1
  6. package/build/core/changelog.d.ts +0 -119
  7. package/build/core/changelog.d.ts.map +0 -1
  8. package/build/core/command-allowlist.d.ts +0 -129
  9. package/build/core/command-allowlist.d.ts.map +0 -1
  10. package/build/core/config.d.ts +0 -107
  11. package/build/core/config.d.ts.map +0 -1
  12. package/build/core/dependency-validator.d.ts +0 -106
  13. package/build/core/dependency-validator.d.ts.map +0 -1
  14. package/build/core/distro-adapter.d.ts +0 -172
  15. package/build/core/distro-adapter.d.ts.map +0 -1
  16. package/build/core/distro.d.ts +0 -57
  17. package/build/core/distro.d.ts.map +0 -1
  18. package/build/core/encrypted-state.d.ts +0 -69
  19. package/build/core/encrypted-state.d.ts.map +0 -1
  20. package/build/core/executor.d.ts +0 -65
  21. package/build/core/executor.d.ts.map +0 -1
  22. package/build/core/installer.d.ts +0 -129
  23. package/build/core/installer.d.ts.map +0 -1
  24. package/build/core/logger.d.ts +0 -118
  25. package/build/core/logger.d.ts.map +0 -1
  26. package/build/core/metrics.d.ts +0 -74
  27. package/build/core/metrics.d.ts.map +0 -1
  28. package/build/core/metrics.js +0 -97
  29. package/build/core/output-redactor.d.ts +0 -26
  30. package/build/core/output-redactor.d.ts.map +0 -1
  31. package/build/core/pam-utils.d.ts +0 -356
  32. package/build/core/pam-utils.d.ts.map +0 -1
  33. package/build/core/parsers.d.ts +0 -191
  34. package/build/core/parsers.d.ts.map +0 -1
  35. package/build/core/policy-engine.d.ts +0 -170
  36. package/build/core/policy-engine.d.ts.map +0 -1
  37. package/build/core/preflight.d.ts +0 -157
  38. package/build/core/preflight.d.ts.map +0 -1
  39. package/build/core/privilege-manager.d.ts +0 -108
  40. package/build/core/privilege-manager.d.ts.map +0 -1
  41. package/build/core/progress.d.ts +0 -99
  42. package/build/core/progress.d.ts.map +0 -1
  43. package/build/core/rate-limiter.d.ts +0 -101
  44. package/build/core/rate-limiter.d.ts.map +0 -1
  45. package/build/core/rollback.d.ts +0 -73
  46. package/build/core/rollback.d.ts.map +0 -1
  47. package/build/core/run-command.d.ts +0 -14
  48. package/build/core/run-command.d.ts.map +0 -1
  49. package/build/core/safeguards.d.ts +0 -58
  50. package/build/core/safeguards.d.ts.map +0 -1
  51. package/build/core/sanitizer.d.ts +0 -118
  52. package/build/core/sanitizer.d.ts.map +0 -1
  53. package/build/core/secure-fs.d.ts +0 -67
  54. package/build/core/secure-fs.d.ts.map +0 -1
  55. package/build/core/spawn-safe.d.ts +0 -55
  56. package/build/core/spawn-safe.d.ts.map +0 -1
  57. package/build/core/sudo-guard.d.ts +0 -167
  58. package/build/core/sudo-guard.d.ts.map +0 -1
  59. package/build/core/sudo-session.d.ts +0 -143
  60. package/build/core/sudo-session.d.ts.map +0 -1
  61. package/build/core/third-party-installer.d.ts +0 -58
  62. package/build/core/third-party-installer.d.ts.map +0 -1
  63. package/build/core/third-party-manifest.d.ts +0 -48
  64. package/build/core/third-party-manifest.d.ts.map +0 -1
  65. package/build/core/tool-annotations.d.ts +0 -13
  66. package/build/core/tool-annotations.d.ts.map +0 -1
  67. package/build/core/tool-dependencies.d.ts +0 -60
  68. package/build/core/tool-dependencies.d.ts.map +0 -1
  69. package/build/core/tool-durations.d.ts +0 -71
  70. package/build/core/tool-durations.d.ts.map +0 -1
  71. package/build/core/tool-registry.d.ts +0 -112
  72. package/build/core/tool-registry.d.ts.map +0 -1
  73. package/build/core/tool-wrapper.d.ts +0 -73
  74. package/build/core/tool-wrapper.d.ts.map +0 -1
  75. package/build/index.d.ts +0 -3
  76. package/build/index.d.ts.map +0 -1
  77. package/build/tools/access-control.d.ts +0 -11
  78. package/build/tools/access-control.d.ts.map +0 -1
  79. package/build/tools/api-security.d.ts +0 -12
  80. package/build/tools/api-security.d.ts.map +0 -1
  81. package/build/tools/app-hardening.d.ts +0 -11
  82. package/build/tools/app-hardening.d.ts.map +0 -1
  83. package/build/tools/backup.d.ts +0 -8
  84. package/build/tools/backup.d.ts.map +0 -1
  85. package/build/tools/cloud-security.d.ts +0 -17
  86. package/build/tools/cloud-security.d.ts.map +0 -1
  87. package/build/tools/compliance.d.ts +0 -11
  88. package/build/tools/compliance.d.ts.map +0 -1
  89. package/build/tools/container-security.d.ts +0 -14
  90. package/build/tools/container-security.d.ts.map +0 -1
  91. package/build/tools/deception.d.ts +0 -13
  92. package/build/tools/deception.d.ts.map +0 -1
  93. package/build/tools/dns-security.d.ts +0 -93
  94. package/build/tools/dns-security.d.ts.map +0 -1
  95. package/build/tools/ebpf-security.d.ts +0 -15
  96. package/build/tools/ebpf-security.d.ts.map +0 -1
  97. package/build/tools/encryption.d.ts +0 -12
  98. package/build/tools/encryption.d.ts.map +0 -1
  99. package/build/tools/firewall.d.ts +0 -9
  100. package/build/tools/firewall.d.ts.map +0 -1
  101. package/build/tools/hardening.d.ts +0 -8
  102. package/build/tools/hardening.d.ts.map +0 -1
  103. package/build/tools/incident-response.d.ts +0 -11
  104. package/build/tools/incident-response.d.ts.map +0 -1
  105. package/build/tools/integrity.d.ts +0 -15
  106. package/build/tools/integrity.d.ts.map +0 -1
  107. package/build/tools/logging.d.ts +0 -21
  108. package/build/tools/logging.d.ts.map +0 -1
  109. package/build/tools/malware.d.ts +0 -10
  110. package/build/tools/malware.d.ts.map +0 -1
  111. package/build/tools/meta.d.ts +0 -13
  112. package/build/tools/meta.d.ts.map +0 -1
  113. package/build/tools/network-defense.d.ts +0 -11
  114. package/build/tools/network-defense.d.ts.map +0 -1
  115. package/build/tools/patch-management.d.ts +0 -3
  116. package/build/tools/patch-management.d.ts.map +0 -1
  117. package/build/tools/process-security.d.ts +0 -12
  118. package/build/tools/process-security.d.ts.map +0 -1
  119. package/build/tools/secrets.d.ts +0 -8
  120. package/build/tools/secrets.d.ts.map +0 -1
  121. package/build/tools/sudo-management.d.ts +0 -17
  122. package/build/tools/sudo-management.d.ts.map +0 -1
  123. package/build/tools/supply-chain-security.d.ts +0 -8
  124. package/build/tools/supply-chain-security.d.ts.map +0 -1
  125. package/build/tools/threat-intel.d.ts +0 -22
  126. package/build/tools/threat-intel.d.ts.map +0 -1
  127. package/build/tools/vulnerability-management.d.ts +0 -11
  128. package/build/tools/vulnerability-management.d.ts.map +0 -1
  129. package/build/tools/waf.d.ts +0 -12
  130. package/build/tools/waf.d.ts.map +0 -1
  131. package/build/tools/wireless-security.d.ts +0 -19
  132. package/build/tools/wireless-security.d.ts.map +0 -1
  133. package/build/tools/zero-trust-network.d.ts +0 -8
  134. package/build/tools/zero-trust-network.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "defense-mcp-server",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Defense MCP Server — 31 defensive security tools with 250+ actions for system hardening, compliance, and threat detection on Linux",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
@@ -8,7 +8,7 @@
8
8
  "defense-mcp-server": "build/index.js"
9
9
  },
10
10
  "files": [
11
- "build/",
11
+ "build/**/*.js",
12
12
  "README.md",
13
13
  "CHANGELOG.md",
14
14
  "LICENSE",
@@ -1,102 +0,0 @@
1
- /**
2
- * AutoInstaller — multi-package-manager automatic dependency resolver.
3
- *
4
- * Handles installation of missing dependencies across system package managers
5
- * (apt, dnf, yum, pacman, apk, zypper, brew), pip, and npm. This module is
6
- * part of the pre-flight validation pipeline and is invoked when
7
- * `DEFENSE_MCP_AUTO_INSTALL=true`.
8
- *
9
- * Design constraints:
10
- * - Uses `execFileSafe` from `spawn-safe.ts` (NOT the executor) to avoid
11
- * circular dependencies with `sudo-session`. spawn-safe enforces the
12
- * command allowlist and `shell: false` automatically.
13
- * - Every `execFileSafe` call is wrapped in try/catch — install failures
14
- * must NEVER crash the server.
15
- * - Logs exclusively to stderr (`console.error`) because the MCP server
16
- * uses stdio for JSON-RPC transport.
17
- *
18
- * @module auto-installer
19
- */
20
- import type { ToolManifest } from "./tool-registry.js";
21
- export interface InstallAttempt {
22
- dependency: string;
23
- type: "binary" | "python-module" | "npm-package" | "library" | "file";
24
- method: "system-package" | "pip" | "npm" | "cargo" | "go-install" | "binary-download" | "build-from-source" | "vendored" | "skipped";
25
- success: boolean;
26
- message: string;
27
- duration?: number;
28
- }
29
- export interface AutoInstallResult {
30
- attempted: InstallAttempt[];
31
- allResolved: boolean;
32
- unresolvedDependencies: string[];
33
- }
34
- /**
35
- * Validate that a package name contains only safe characters.
36
- * Allowed: alphanumeric, hyphens, dots, plus signs, colons (for arch qualifiers).
37
- * No shell metacharacters, no path separators, no spaces.
38
- * Max length: 128 characters.
39
- */
40
- export declare function validatePackageName(name: string): boolean;
41
- export declare class AutoInstaller {
42
- private static _instance;
43
- private distroCache;
44
- /** Get or create the singleton instance. */
45
- static instance(): AutoInstaller;
46
- /**
47
- * Reset the singleton (for testing).
48
- * @internal
49
- */
50
- static resetInstance(): void;
51
- /** Check if auto-install is enabled via config. */
52
- isEnabled(): boolean;
53
- /**
54
- * Resolve all missing dependencies for a tool manifest.
55
- *
56
- * If auto-install is disabled, returns all dependencies as unresolved
57
- * with method `'skipped'`.
58
- */
59
- resolveAll(manifest: ToolManifest, missingBinaries: string[], missingPython?: string[], missingNpm?: string[], missingLibraries?: string[]): Promise<AutoInstallResult>;
60
- /**
61
- * Install a system binary via the detected package manager.
62
- *
63
- * 1. Look up binary in DEFENSIVE_TOOLS for distro-specific package name
64
- * 2. If not found, try binary name directly as package name
65
- * 3. Verify with `which <binary>` after install
66
- */
67
- installBinary(binary: string): Promise<InstallAttempt>;
68
- /**
69
- * Install a Python module via pip.
70
- *
71
- * 1. Check if pip3 or pip exists
72
- * 2. Try user-site install first (no sudo)
73
- * 3. If that fails, try with sudo
74
- * 4. Verify with `python3 -c "import <module>"`
75
- */
76
- installPythonModule(module: string): Promise<InstallAttempt>;
77
- /**
78
- * Install an npm package globally.
79
- *
80
- * 1. Check if npm exists
81
- * 2. Run `npm install -g <package>` with sudo if needed
82
- * 3. Verify by checking if the package provides an expected binary
83
- */
84
- installNpmPackage(pkg: string): Promise<InstallAttempt>;
85
- /**
86
- * Install a system library (development headers).
87
- *
88
- * 1. Determine dev package name based on distro family
89
- * 2. Try installing the first candidate that works
90
- * 3. Verify with `ldconfig -p | grep <lib>` or `pkg-config --exists <lib>`
91
- */
92
- installLibrary(lib: string): Promise<InstallAttempt>;
93
- /**
94
- * Get (and cache) the detected distro info.
95
- */
96
- private getDistro;
97
- /**
98
- * Verify a library is available via ldconfig or pkg-config.
99
- */
100
- private verifyLibrary;
101
- }
102
- //# sourceMappingURL=auto-installer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auto-installer.d.ts","sourceRoot":"","sources":["../../src/core/auto-installer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASvD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,GAAG,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;IACtE,MAAM,EACF,gBAAgB,GAChB,KAAK,GACL,KAAK,GACL,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,mBAAmB,GACnB,UAAU,GACV,SAAS,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,sBAAsB,EAAE,MAAM,EAAE,CAAC;CAClC;AA0FD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAoOD,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAA8B;IACtD,OAAO,CAAC,WAAW,CAA2B;IAE9C,4CAA4C;IAC5C,MAAM,CAAC,QAAQ,IAAI,aAAa;IAahC;;;OAGG;IACH,MAAM,CAAC,aAAa,IAAI,IAAI;IAI5B,mDAAmD;IACnD,SAAS,IAAI,OAAO;IAIpB;;;;;OAKG;IACG,UAAU,CACd,QAAQ,EAAE,YAAY,EACtB,eAAe,EAAE,MAAM,EAAE,EACzB,aAAa,CAAC,EAAE,MAAM,EAAE,EACxB,UAAU,CAAC,EAAE,MAAM,EAAE,EACrB,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAC1B,OAAO,CAAC,iBAAiB,CAAC;IA6G7B;;;;;;OAMG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAsP5D;;;;;;;OAOG;IACG,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAgHlE;;;;;;OAMG;IACG,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IA8G7D;;;;;;OAMG;IACG,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAwG1D;;OAEG;YACW,SAAS;IAOvB;;OAEG;IACH,OAAO,CAAC,aAAa;CAmBtB"}
@@ -1,63 +0,0 @@
1
- /**
2
- * BackupManager — manages file backups with manifest tracking.
3
- *
4
- * Backups are stored under ~/.defense-mcp/backups/ with timestamped filenames.
5
- * A manifest.json tracks all backups for listing and restore operations.
6
- */
7
- export interface BackupEntry {
8
- id: string;
9
- originalPath: string;
10
- backupPath: string;
11
- timestamp: string;
12
- sizeBytes: number;
13
- }
14
- export interface BackupManifest {
15
- version: 1;
16
- backups: BackupEntry[];
17
- }
18
- /**
19
- * Validate that a backup path is safe:
20
- * 1. No `..` traversal sequences
21
- * 2. Normalized via path.resolve()
22
- * 3. Resolved path is within the backup base directory
23
- * 4. Not a symlink (prevent symlink attacks)
24
- *
25
- * @param filePath The path to validate
26
- * @param baseDir The backup base directory that paths must stay within
27
- * @throws {Error} If the path fails validation
28
- */
29
- export declare function validateBackupPath(filePath: string, baseDir: string): void;
30
- export declare class BackupManager {
31
- private readonly backupDir;
32
- private readonly manifestPath;
33
- constructor(backupDir?: string);
34
- /** Ensure backup directory exists. */
35
- private ensureDir;
36
- /** Read manifest from disk with migration from old format. */
37
- private readManifest;
38
- /** Write manifest to disk. */
39
- private writeManifest;
40
- /**
41
- * Create a backup of a file (synchronous).
42
- * @returns The BackupEntry with id and backupPath.
43
- */
44
- backupSync(filePath: string): BackupEntry;
45
- /**
46
- * Create a backup of a file.
47
- * @returns The backup ID.
48
- */
49
- backup(filePath: string): Promise<string>;
50
- /**
51
- * Restore a file from backup by ID.
52
- */
53
- restore(backupId: string): Promise<void>;
54
- /**
55
- * List all backup entries.
56
- */
57
- listBackups(): Promise<BackupEntry[]>;
58
- /**
59
- * Remove backups older than the specified number of days.
60
- */
61
- pruneOldBackups(daysOld: number): Promise<void>;
62
- }
63
- //# sourceMappingURL=backup-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"backup-manager.d.ts","sourceRoot":"","sources":["../../src/core/backup-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAUD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAiC1E;AAID,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAE1B,SAAS,CAAC,EAAE,MAAM;IAK9B,sCAAsC;IACtC,OAAO,CAAC,SAAS;IAIjB,8DAA8D;IAC9D,OAAO,CAAC,YAAY;IAepB,8BAA8B;IAC9B,OAAO,CAAC,aAAa;IAKrB;;;OAGG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAyCzC;;;OAGG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/C;;OAEG;IACG,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB9C;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAO3C;;OAEG;IACG,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAiCtD"}
@@ -1,119 +0,0 @@
1
- /**
2
- * A single changelog entry recording a defensive action taken.
3
- */
4
- export interface ChangeEntry {
5
- /** Unique identifier (UUID v4) */
6
- id: string;
7
- /** ISO 8601 timestamp */
8
- timestamp: string;
9
- /** Tool that performed the action */
10
- tool: string;
11
- /** Description of the action */
12
- action: string;
13
- /** Target of the action (file, service, etc.) */
14
- target: string;
15
- /** State before the change */
16
- before?: string;
17
- /** State after the change */
18
- after?: string;
19
- /** Path to backup file if one was created */
20
- backupPath?: string;
21
- /** Whether this was a dry-run (no actual changes) */
22
- dryRun: boolean;
23
- /** Whether the action succeeded */
24
- success: boolean;
25
- /** Error message if the action failed */
26
- error?: string;
27
- /** Command to undo this change */
28
- rollbackCommand?: string;
29
- /** OS username who made the change (auto-populated) */
30
- user?: string;
31
- /** MCP session identifier (if available) */
32
- sessionId?: string;
33
- /**
34
- * SHA-256 hash-chain value.
35
- *
36
- * For the first entry: SHA-256 of the entry's core fields with previousHash="genesis".
37
- * For subsequent entries: SHA-256 of the entry's core fields concatenated with
38
- * the previous entry's hash. This creates a tamper-evident chain — modifying or
39
- * deleting any entry breaks the chain, which is detectable via `verifyChangelog()`.
40
- *
41
- * Auto-populated by `logChange()`. Not present in legacy entries.
42
- */
43
- hash?: string;
44
- }
45
- /**
46
- * Versioned changelog state file format.
47
- * Old files stored a bare array; new files use this envelope.
48
- */
49
- export interface ChangelogState {
50
- version: 1;
51
- entries: ChangeEntry[];
52
- }
53
- /**
54
- * Compute the SHA-256 hash-chain value for a changelog entry.
55
- *
56
- * The hash is computed over the entry's immutable fields (id, timestamp, tool,
57
- * action, target, dryRun, success) concatenated with the previous entry's hash.
58
- * This creates a tamper-evident chain.
59
- *
60
- * @param entry - The entry to hash (hash field is excluded from the computation)
61
- * @param previousHash - Hash of the previous entry, or "genesis" for the first entry
62
- * @returns SHA-256 hex digest
63
- */
64
- export declare function computeEntryHash(entry: ChangeEntry, previousHash: string): string;
65
- /**
66
- * Verify the integrity of the changelog hash chain.
67
- *
68
- * Walks all entries with `hash` fields and checks that each hash matches
69
- * the recomputed value from the previous entry's hash. Legacy entries
70
- * without `hash` fields are skipped.
71
- *
72
- * @returns Object with `valid` boolean and details of any broken links
73
- */
74
- export declare function verifyChangelog(): {
75
- valid: boolean;
76
- totalEntries: number;
77
- hashedEntries: number;
78
- brokenLinks: Array<{
79
- index: number;
80
- entryId: string;
81
- expected: string;
82
- actual: string;
83
- }>;
84
- };
85
- /**
86
- * Creates a new ChangeEntry with auto-generated id and timestamp.
87
- */
88
- export declare function createChangeEntry(partial: Omit<ChangeEntry, "id" | "timestamp" | "user">): ChangeEntry;
89
- /**
90
- * Appends a change entry to the changelog JSON file.
91
- * Creates the file and parent directories if they don't exist.
92
- * Rotates old entries when the file exceeds MAX_CHANGELOG_ENTRIES.
93
- * Computes and attaches a hash-chain value for tamper evidence.
94
- * Fails silently (logs to stderr) to avoid disrupting tool execution.
95
- */
96
- export declare function logChange(entry: ChangeEntry): void;
97
- /**
98
- * Reads changelog entries, newest first.
99
- * Returns empty array on any error.
100
- *
101
- * @param limit Maximum number of entries to return (default: all)
102
- */
103
- export declare function getChangelog(limit?: number): ChangeEntry[];
104
- /**
105
- * Creates a backup copy of a file using the unified BackupManager.
106
- * The backup is tracked in the manifest at ~/.defense-mcp/backups/manifest.json.
107
- *
108
- * @param filePath Absolute path to the file to back up
109
- * @returns Path to the backup file
110
- */
111
- export declare function backupFile(filePath: string): string;
112
- /**
113
- * Restores a file from a backup.
114
- *
115
- * @param backupPath Path to the backup file
116
- * @param originalPath Path to restore the file to
117
- */
118
- export declare function restoreFile(backupPath: string, originalPath: string): void;
119
- //# sourceMappingURL=changelog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/core/changelog.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAcjF;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1F,CAuCA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,WAAW,GAAG,MAAM,CAAC,GACtD,WAAW,CAOb;AA2BD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAiClD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,CAmB1D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKnD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAU1E"}
@@ -1,129 +0,0 @@
1
- /**
2
- * Command Allowlist — security control that restricts which binaries the
3
- * MCP server may execute.
4
- *
5
- * Every command passed to `executeCommand()` (and the bypass modules that
6
- * use `execFileSync` / `spawn` directly) MUST be present in this allowlist.
7
- * Bare command names are resolved to absolute paths at startup, eliminating
8
- * PATH-manipulation attacks when running under sudo.
9
- *
10
- * Design constraints:
11
- * - **No circular dependencies**: only imports from `node:fs` (no executor,
12
- * no sudo-session, no tool-registry).
13
- * - Uses `fs.existsSync` for path resolution — never shells out to `which`.
14
- * - Candidate paths are checked in order; the first match wins.
15
- * - Unresolvable binaries are logged as warnings but don't block startup
16
- * (not every system has every tool installed).
17
- *
18
- * @module command-allowlist
19
- */
20
- export interface AllowlistEntry {
21
- /** Bare binary name, e.g. "iptables" */
22
- binary: string;
23
- /** Ordered candidate absolute paths on Linux */
24
- candidates: string[];
25
- /** Filled at startup after resolution; `undefined` if not found on disk */
26
- resolvedPath?: string;
27
- /** Which distro package should own this binary (for integrity verification) */
28
- expectedPackage?: string;
29
- /** Inode number recorded at startup for TOCTOU detection (CORE-007) */
30
- resolvedInode?: number;
31
- }
32
- /** Result of a binary ownership verification check */
33
- export interface BinaryVerificationResult {
34
- binary: string;
35
- path: string;
36
- verified: boolean;
37
- owner?: string;
38
- message: string;
39
- }
40
- /**
41
- * Initialize the allowlist by resolving candidate paths on the current system.
42
- *
43
- * For each allowlisted binary, checks which candidate paths actually exist
44
- * on disk and caches the first match. This should be called once at server
45
- * startup, before any tool registration.
46
- *
47
- * Binaries that cannot be found are logged as warnings but do not prevent
48
- * startup — not every system has every tool installed.
49
- */
50
- export declare function initializeAllowlist(): void;
51
- /**
52
- * Resolve a bare command name to its absolute path via the allowlist.
53
- *
54
- * @param command - Bare binary name (e.g. `"iptables"`)
55
- * @returns The absolute path to the binary (e.g. `"/usr/sbin/iptables"`)
56
- * @throws {Error} If the command is not in the allowlist or cannot be found
57
- */
58
- export declare function resolveCommand(command: string): string;
59
- /**
60
- * Check whether a bare command name is in the allowlist (without resolving).
61
- *
62
- * @param command - Bare binary name or absolute path
63
- * @returns `true` if the command is allowlisted
64
- */
65
- export declare function isAllowlisted(command: string): boolean;
66
- /**
67
- * Resolve a sudo command and its target binary.
68
- *
69
- * When `command` is `"sudo"`, this function:
70
- * 1. Resolves `sudo` itself to its absolute path
71
- * 2. Finds the actual binary in the args array (skipping sudo flags like `-S`, `-p`, `-A`, `-k`, `-n`, `-v`)
72
- * 3. Resolves that binary against the allowlist
73
- * 4. Returns the resolved sudo path, the index of the target binary in args, and its resolved path
74
- *
75
- * @param args - The args array passed to sudo
76
- * @returns Object with resolved paths and the index of the target command in args
77
- * @throws {Error} If sudo or the target command is not allowlisted
78
- */
79
- export declare function resolveSudoCommand(args: string[]): {
80
- sudoPath: string;
81
- targetIndex: number;
82
- targetPath: string;
83
- };
84
- /**
85
- * Returns the full allowlist for inspection/debugging.
86
- * Each entry includes resolution status.
87
- */
88
- export declare function getAllowlistEntries(): ReadonlyArray<Readonly<AllowlistEntry>>;
89
- /**
90
- * Returns whether the allowlist has been initialized.
91
- */
92
- export declare function isInitialized(): boolean;
93
- /**
94
- * Returns whether runtime path verification is currently enabled.
95
- */
96
- export declare function isRuntimePathVerificationEnabled(): boolean;
97
- /**
98
- * Enable or disable runtime path verification.
99
- * Useful for testing or performance-sensitive environments.
100
- */
101
- export declare function setRuntimePathVerification(enabled: boolean): void;
102
- /**
103
- * Returns the critical binary package mappings for inspection/testing.
104
- */
105
- export declare function getCriticalBinaryPackages(): Readonly<Record<string, string[]>>;
106
- /**
107
- * Verify that a resolved binary is owned by its expected system package.
108
- *
109
- * Uses `dpkg -S` on Debian/Ubuntu, `rpm -qf` on RHEL/Fedora,
110
- * or `pacman -Qo` on Arch to determine the owning package.
111
- *
112
- * @param binaryPath - Absolute path to the binary
113
- * @param expectedPackage - Optional expected package name; if omitted, only ownership is checked
114
- * @returns Verification result with owner info and status
115
- */
116
- export declare function verifyBinaryOwnership(binaryPath: string, expectedPackage?: string): BinaryVerificationResult;
117
- /**
118
- * Verify all resolved critical binaries against their expected packages.
119
- *
120
- * Runs after `initializeAllowlist()` and logs warnings for any binaries
121
- * that can't be verified or are owned by unexpected packages.
122
- *
123
- * All verifications run in parallel for faster startup.
124
- * This is best-effort — it never throws or blocks startup.
125
- *
126
- * @returns Array of verification results for all critical binaries that were resolved
127
- */
128
- export declare function verifyAllBinaries(): Promise<BinaryVerificationResult[]>;
129
- //# sourceMappingURL=command-allowlist.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-allowlist.d.ts","sourceRoot":"","sources":["../../src/core/command-allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAeH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,sDAAsD;AACtD,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAsXD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAwD1C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAiEtD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CActD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,CA6CA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAE7E;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;GAEG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAE1D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEjE;AA4DD;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAE9E;AAeD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,GACvB,wBAAwB,CA6G1B;AAiHD;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC,CA6C7E"}
@@ -1,107 +0,0 @@
1
- /**
2
- * Known defensive tools that support per-tool timeout overrides
3
- * via DEFENSE_MCP_TIMEOUT_<TOOL> environment variables.
4
- */
5
- export declare const KNOWN_TOOLS: readonly ["lynis", "aide", "clamav", "oscap", "snort", "suricata", "rkhunter", "chkrootkit", "tcpdump", "auditd", "nmap", "fail2ban-client", "debsums", "yara"];
6
- export type KnownTool = (typeof KNOWN_TOOLS)[number];
7
- /**
8
- * Configuration interface for the Defense MCP Server.
9
- * All values are derived from environment variables with sensible defaults.
10
- */
11
- export interface DefenseConfig {
12
- /** Default command timeout in milliseconds */
13
- defaultTimeout: number;
14
- /** Maximum output buffer size in bytes */
15
- maxBuffer: number;
16
- /** Directories allowed for file operations */
17
- allowedDirs: string[];
18
- /** Logging level */
19
- logLevel: "debug" | "info" | "warn" | "error";
20
- /**
21
- * SECURITY (CICD-014): Dry-run mode — when true, modifying operations preview
22
- * commands without executing them. Defaults to `true` so the server operates
23
- * in a safe, read-only mode until explicitly opted out via
24
- * DEFENSE_MCP_DRY_RUN=false. This prevents accidental system modifications.
25
- */
26
- dryRun: boolean;
27
- /** Path to the changelog JSON file */
28
- changelogPath: string;
29
- /** Directory for file backups */
30
- backupDir: string;
31
- /**
32
- * SECURITY (CICD-014): Whether to create backups before modifying files.
33
- * Defaults to `true` — every file modification is backed up first so that
34
- * changes can be rolled back if needed. Disable only in CI/test environments
35
- * via DEFENSE_MCP_BACKUP_ENABLED=false.
36
- */
37
- backupEnabled: boolean;
38
- /** Whether to auto-install missing tools */
39
- autoInstall: boolean;
40
- /** Paths protected from modification */
41
- protectedPaths: string[];
42
- /**
43
- * SECURITY (CICD-014): Whether to require confirmation for destructive
44
- * actions. Defaults to `true` — the server will request explicit confirmation
45
- * before executing operations that modify system state. Disable only when
46
- * running automated/unattended workflows via
47
- * DEFENSE_MCP_REQUIRE_CONFIRMATION=false.
48
- */
49
- requireConfirmation: boolean;
50
- /** Directory for quarantined files */
51
- quarantineDir: string;
52
- /** Directory for policy files */
53
- policyDir: string;
54
- /** Per-tool timeout overrides in milliseconds */
55
- toolTimeouts: Partial<Record<KnownTool, number>>;
56
- /** Sudo session timeout in milliseconds (default: 15 minutes) */
57
- sudoSessionTimeout: number;
58
- /** Command execution timeout in ms (falls back to defaultTimeout; env: DEFENSE_MCP_COMMAND_TIMEOUT) */
59
- commandTimeout: number;
60
- /** Network operation timeout in ms (default: 30s; env: DEFENSE_MCP_NETWORK_TIMEOUT) */
61
- networkTimeout: number;
62
- /**
63
- * SECURITY: Redact sensitive data (passwords, tokens, keys) from command
64
- * output before returning to the LLM. Defaults to `true`.
65
- * Env: DEFENSE_MCP_REDACT_OUTPUT (set to "false" to disable)
66
- */
67
- redactOutput: boolean;
68
- /**
69
- * When true, only register tools with readOnlyHint: true annotations.
70
- * Env: DEFENSE_MCP_READ_ONLY (default: false)
71
- */
72
- readOnly: boolean;
73
- /**
74
- * Comma-separated list of tool names to register. Empty means all tools.
75
- * Env: DEFENSE_MCP_ALLOWED_TOOLS (default: "")
76
- */
77
- allowedTools: string[];
78
- }
79
- /**
80
- * Returns the current configuration by reading environment variables.
81
- * Results are cached for 5 seconds to avoid redundant env-var parsing
82
- * across the 3–5 calls per tool invocation.
83
- */
84
- export declare function getConfig(): DefenseConfig;
85
- /**
86
- * Invalidate the config cache, forcing the next `getConfig()` call to
87
- * re-read environment variables. Useful for tests.
88
- */
89
- export declare function invalidateConfigCache(): void;
90
- /**
91
- * Returns the effective timeout for a given tool in milliseconds.
92
- * Checks per-tool overrides first, then falls back to the default timeout.
93
- */
94
- export declare function getToolTimeout(toolName: string, config?: DefenseConfig): number;
95
- /**
96
- * Returns the effective timeout for a specific tool action in milliseconds.
97
- *
98
- * Resolution order:
99
- * 1. Per-tool env override (DEFENSE_MCP_TIMEOUT_<TOOL>)
100
- * 2. Duration database recommended timeout for the specific action
101
- * 3. Default timeout from config
102
- *
103
- * This ensures long-running tools (ClamAV, rkhunter, AIDE) get appropriate
104
- * timeouts automatically without requiring env var configuration.
105
- */
106
- export declare function getActionTimeout(toolName: string, action: string, config?: DefenseConfig): number;
107
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,WAAW,iKAed,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,oBAAoB;IACpB,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC9C;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB,4CAA4C;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,wCAAwC;IACxC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;;OAMG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,iEAAiE;IACjE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uGAAuG;IACvG,cAAc,EAAE,MAAM,CAAC;IACvB,uFAAuF;IACvF,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAmGD;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAQzC;AA8FD;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,aAAa,GACrB,MAAM,CAIR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,aAAa,GACrB,MAAM,CAkBR"}
@@ -1,106 +0,0 @@
1
- /**
2
- * Dependency Validator for Defense MCP Server.
3
- *
4
- * Provides three key capabilities:
5
- * 1. **Startup validation** — checks all tool dependencies when the server starts
6
- * and auto-installs missing ones if DEFENSE_MCP_AUTO_INSTALL=true
7
- * 2. **Runtime dependency check** — `ensureDependencies()` can be called before
8
- * any tool execution to verify (and optionally install) required binaries
9
- * 3. **Dependency status cache** — avoids redundant `which` calls by caching
10
- * binary availability results with a configurable TTL
11
- */
12
- /**
13
- * Result of a startup validation run.
14
- */
15
- export interface ValidationReport {
16
- /** Total unique binaries checked */
17
- totalChecked: number;
18
- /** Binaries that are available */
19
- available: string[];
20
- /** Binaries that are missing */
21
- missing: string[];
22
- /** Binaries that were auto-installed */
23
- installed: string[];
24
- /** Binaries that failed to install */
25
- installFailed: Array<{
26
- binary: string;
27
- error: string;
28
- }>;
29
- /** Critical tools with missing dependencies */
30
- criticalMissing: Array<{
31
- toolName: string;
32
- missingBinaries: string[];
33
- }>;
34
- /** Duration of the validation in milliseconds */
35
- durationMs: number;
36
- /** Whether auto-install was enabled */
37
- autoInstallEnabled: boolean;
38
- }
39
- /**
40
- * Result of ensuring dependencies for a specific tool.
41
- */
42
- export interface EnsureResult {
43
- /** Whether all required dependencies are satisfied */
44
- satisfied: boolean;
45
- /** Missing required binaries (empty if satisfied) */
46
- missingRequired: string[];
47
- /** Missing optional binaries */
48
- missingOptional: string[];
49
- /** Binaries that were auto-installed during this check */
50
- autoInstalled: string[];
51
- /** Errors from auto-install attempts */
52
- installErrors: Array<{
53
- binary: string;
54
- error: string;
55
- }>;
56
- }
57
- /**
58
- * Clears the entire binary cache.
59
- */
60
- export declare function clearDependencyCache(): void;
61
- /**
62
- * Validates all tool dependencies at server startup.
63
- *
64
- * This function:
65
- * 1. Collects all unique binaries required across all tools
66
- * 2. Checks each binary's availability
67
- * 3. If autoInstall is enabled, installs missing binaries
68
- * 4. Reports critical tools with missing dependencies
69
- *
70
- * @returns A detailed validation report
71
- */
72
- export declare function validateAllDependencies(): Promise<ValidationReport>;
73
- /**
74
- * Ensures all dependencies for a specific MCP tool are satisfied.
75
- *
76
- * Call this at the start of any tool handler to verify its binaries are present.
77
- * If autoInstall is enabled, missing binaries will be installed on-the-fly.
78
- *
79
- * @param toolName The MCP tool name (e.g. "ids_rkhunter_scan")
80
- * @returns EnsureResult with satisfaction status and details
81
- *
82
- * @example
83
- * ```ts
84
- * const deps = await ensureDependencies("ids_rkhunter_scan");
85
- * if (!deps.satisfied) {
86
- * return {
87
- * content: [createErrorContent(
88
- * `Missing required tools: ${deps.missingRequired.join(", ")}. ` +
89
- * `Install with: sudo apt install ${deps.missingRequired.join(" ")}`
90
- * )],
91
- * isError: true,
92
- * };
93
- * }
94
- * ```
95
- */
96
- export declare function ensureDependencies(toolName: string): Promise<EnsureResult>;
97
- /**
98
- * Quick check if a single binary is available (cached).
99
- * Does NOT auto-install. Use for lightweight pre-flight checks.
100
- */
101
- export declare function isBinaryInstalled(binary: string): Promise<boolean>;
102
- /**
103
- * Formats a ValidationReport into a human-readable string for logging.
104
- */
105
- export declare function formatValidationReport(report: ValidationReport): string;
106
- //# sourceMappingURL=dependency-validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependency-validator.d.ts","sourceRoot":"","sources":["../../src/core/dependency-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA6BH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gCAAgC;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,wCAAwC;IACxC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sCAAsC;IACtC,aAAa,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,+CAA+C;IAC/C,eAAe,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACxE,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,SAAS,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,gCAAgC;IAChC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,0DAA0D;IAC1D,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,wCAAwC;IACxC,aAAa,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzD;AAsCD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AA+CD;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAsJzE;AAID;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC,CA0EvB;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAIxE;AAID;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAmDvE"}