@icoretech/warden-mcp 0.2.45 → 0.2.46

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 CHANGED
@@ -284,10 +284,13 @@ you expose it.
284
284
  - **Protect `/metricsz` if needed** - it is unauthenticated for scraper
285
285
  compatibility and exposes runtime/session counters
286
286
 
287
- Redacted fields include login passwords, TOTP seeds/codes, card numbers and
288
- codes, identity SSNs/passport/license numbers, hidden custom fields, SSH private
289
- keys stored through the secure-note convention, signed attachment URLs, and
290
- password history entries.
287
+ Redacted fields include item notes (including secure-note bodies), login
288
+ passwords, TOTP seeds/codes, card numbers and codes, identity
289
+ SSNs/passport/license numbers, hidden custom fields, native SSH private keys
290
+ and those stored through the secure-note convention, signed attachment URLs,
291
+ and password history entries. Public SSH keys and fingerprints remain visible.
292
+ Returning notes or private keys requires `reveal: true`; `NOREVEAL` and
293
+ `KEYCHAIN_NOREVEAL` force them to stay redacted.
291
294
 
292
295
  ## Configuration
293
296
 
@@ -406,8 +409,9 @@ against a local Vaultwarden instance before a CLI bump should ship.
406
409
 
407
410
  - `bw list items --search`, and therefore `keychain_search_items`, does not
408
411
  reliably search inside custom field values
409
- - SSH keys are stored as secure notes with standard fields until `bw` supports
410
- native SSH key item creation
412
+ - `keychain_create_ssh_key` creates secure notes with standard SSH key fields;
413
+ native SSH key items are recognized by `keychain_search_items` and supported
414
+ by `keychain_get_item`
411
415
  - high-risk `bw` features such as export/import are intentionally not exposed
412
416
  - Vaultwarden report pages are not mirrored as MCP tools; the current
413
417
  report-like helper is `keychain_get_exposed`
@@ -1,4 +1,4 @@
1
- import { mkdir, readFile, rm, stat, writeFile } from 'node:fs/promises';
1
+ import { chmod, mkdir, open, readFile, rm, stat, writeFile, } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  import { runBw } from './bwCli.js';
4
4
  const PROCESS_LOCK_WAIT_MS = 100;
@@ -83,6 +83,7 @@ export class BwSessionStorage {
83
83
  }
84
84
  async readSession() {
85
85
  try {
86
+ await chmod(this.sessionStatePath, 0o600);
86
87
  const raw = await readFile(this.sessionStatePath, 'utf8');
87
88
  const parsed = JSON.parse(raw);
88
89
  if (parsed.version !== 1 ||
@@ -109,7 +110,14 @@ export class BwSessionStorage {
109
110
  validatedAt: now,
110
111
  };
111
112
  await mkdir(this.appDataDir, { recursive: true });
112
- await writeFile(this.sessionStatePath, JSON.stringify(state), 'utf8');
113
+ const file = await open(this.sessionStatePath, 'w', 0o600);
114
+ try {
115
+ await file.chmod(0o600);
116
+ await file.writeFile(JSON.stringify(state), 'utf8');
117
+ }
118
+ finally {
119
+ await file.close();
120
+ }
113
121
  }
114
122
  async clearSession() {
115
123
  await rm(this.sessionStatePath, { force: true }).catch(() => { });
@@ -13,6 +13,7 @@ const ITEM_TYPE = {
13
13
  note: 2,
14
14
  card: 3,
15
15
  identity: 4,
16
+ ssh_key: 5,
16
17
  };
17
18
  const URI_MATCH = {
18
19
  domain: 0,
@@ -100,11 +101,15 @@ function kindFromItem(item) {
100
101
  return 'card';
101
102
  if (type === ITEM_TYPE.identity)
102
103
  return 'identity';
104
+ if (type === ITEM_TYPE.ssh_key)
105
+ return 'ssh_key';
103
106
  if (type === ITEM_TYPE.note)
104
107
  return isSshKeyItem(item) ? 'ssh_key' : 'note';
105
108
  return 'note';
106
109
  }
107
110
  function isSshKeyItem(item) {
111
+ if (item.type === ITEM_TYPE.ssh_key)
112
+ return true;
108
113
  if (item.type !== ITEM_TYPE.note)
109
114
  return false;
110
115
  const fields = item.fields;
@@ -20,6 +20,13 @@ export function redactItem(item) {
20
20
  if (!item || typeof item !== 'object')
21
21
  return item;
22
22
  const clone = deepClone(item);
23
+ if (typeof clone.notes === 'string')
24
+ clone.notes = REDACTED;
25
+ if (clone.sshKey && typeof clone.sshKey === 'object') {
26
+ const sshKey = clone.sshKey;
27
+ if (typeof sshKey.privateKey === 'string')
28
+ sshKey.privateKey = REDACTED;
29
+ }
23
30
  // login.password / login.totp
24
31
  if (clone.login && typeof clone.login === 'object') {
25
32
  const login = clone.login;
@@ -1004,7 +1004,7 @@ export function registerTools(server, deps) {
1004
1004
  });
1005
1005
  registerTool(`${deps.toolPrefix}.get_item`, {
1006
1006
  title: 'Get Item',
1007
- description: `Get the full vault item by stable item id. Secret fields and signed attachment URLs are redacted by default; pass reveal=true only when the caller is allowed to receive secrets. When attachments are present, use ${publicPrefix}get_attachment with this item id plus the listed attachment id or filename to download file bytes. If an expected recently-added attachment is missing, run ${publicPrefix}sync and call ${publicPrefix}get_item again before retrying.`,
1007
+ description: `Get the full vault item by stable item id. Secret fields (including item notes and SSH private keys) and signed attachment URLs are redacted by default; pass reveal=true only when the caller is allowed to receive secrets, and NOREVEAL can still force redaction. When attachments are present, use ${publicPrefix}get_attachment with this item id plus the listed attachment id or filename to download file bytes. If an expected recently-added attachment is missing, run ${publicPrefix}sync and call ${publicPrefix}get_item again before retrying.`,
1008
1008
  annotations: { readOnlyHint: true },
1009
1009
  inputSchema: {
1010
1010
  id: stableObjectIdSchema,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@icoretech/warden-mcp",
4
- "version": "0.2.45",
4
+ "version": "0.2.46",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "Vaultwarden/Bitwarden MCP server backed by Bitwarden CLI (bw).",