Opt-in local audit log of executed state-changing tool calls

Ouverte
#159 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
72/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
node.js, typescript

Piste de recherche

Start by reading mcp-server/src/utils/confirm-param.ts — it is the shared gate all twelve confirmed tools pass through, so the append belongs there rather than in each tool. Look at mcp-server/src/tools/nodeExec.ts:22 for the shape of a gated call and at mcp-server/src/index.ts:130 for the existing (only) logging pattern, then run cd mcp-server && npm install && npm test plus npm run typecheck. Done means: with HOMELAB_AUDIT_LOG set, a confirmed gated call appends one JSON line with timestamp, tool, node, host, masked command, exit status and duration, no secret values, covered by a unit test.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement severity: medium

Summary

Twelve tools change remote state behind confirm: true, but nothing records what was executed.

Where

  • mcp-server/src/tools/nodeExec.ts:22
  • mcp-server/src/index.ts:130 (the only logging in src)

Details

After an agent session a user cannot answer "what did the AI run on my Pi, and when", which matters most for nodeExec, backupRestore and composeDown.

Impact

No after-the-fact record of agent actions on the user's hardware.

Suggested fix

Add opt-in HOMELAB_AUDIT_LOG=<path>: every confirmed gated call appends one JSON line (timestamp, tool, node, host, masked command, exit status, duration). Hook it in one place shared by the gated tools. Never log secret values.

Open questions: also log cancelled previews and dry runs? Rotate the file?

Acceptance criteria

  • Gated calls append a JSON line when the variable is set
  • No secret values in the log
  • Unit test

Getting started

  • Relevant files: mcp-server/src/utils/confirm-param.ts, mcp-server/src/tools/nodeExec.ts, mcp-server/src/index.ts
  • How to run tests: cd mcp-server && npm install && npm test (and npm run typecheck); structure tests: pip install -r requirements-test.txt && pytest tests/ -v
  • Conventions: see CLAUDE.md and CONTRIBUTING.md

Filed by repo-audit/full-audit at 636fefb. Severity: medium. Effort: M. audit-key: enhancement|mcp-server/src/utils/confirm-param.ts|audit-log

Langage dominant
TypeScript
Étoiles
0
Forks
4
Merge moyen
10 h 16 min
PR mergées (30 j)
2

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Home-Lab-Developer-Tools

Toutes les issues de TMHSDigital/Home-Lab-Developer-Tools

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.