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

Aberta
#159 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
72/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
node.js, typescript

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
TypeScript
Estrelas
0
Forks
4
Merge médio
10h 16min
PRs com merge (30d)
2

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/Home-Lab-Developer-Tools

Todas as issues de TMHSDigital/Home-Lab-Developer-Tools

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.