Skip to content

security: harden prometheus token, grafana, MCP env, sandbox defaults - #1

Open
iotappman wants to merge 1 commit into
DDS-Solutions:mainfrom
iotappman:security/high-priority-hardening
Open

iotappman wants to merge 1 commit into
DDS-Solutions:mainfrom
iotappman:security/high-priority-hardening

Conversation

@iotappman

Copy link
Copy Markdown

Summary

High-priority security hygiene from a code review of main:

  1. Prometheus bearer token — deleted committed monitoring/prometheus/bearer_token (contained test-token), replaced bearer_token.example with a non-secret placeholder, and gitignored the real file.
  2. Grafana passworddocker-compose.yml now requires GRAFANA_ADMIN_PASSWORD (same fail-fast pattern as NEURAL_TOKEN); removed the admin default.
  3. MCP skill envexecution/tadpole_mcp_server.py no longer passes os.environ.copy() into legacy skill subprocesses; uses an allowlist that excludes provider API keys and NEURAL_TOKEN*. Unit coverage added in tests/unit/test_mcp_sandbox.py.
  4. Sandbox defaults.env.example sets USE_SANDBOX_DOCKER=true to match README guidance while keeping ALLOW_HOST_SKILL_EXECUTION=false. Documents GRAFANA_ADMIN_PASSWORD.

Notes

  • If any real deployment ever used test-token as NEURAL_TOKEN, rotate it.
  • After pull: cp monitoring/prometheus/bearer_token.example monitoring/prometheus/bearer_token and paste the real token locally.
  • Compose Grafana now needs GRAFANA_ADMIN_PASSWORD in .env.

Test plan

  • python -m unittest discover -s tests/unit -p 'test_mcp_sandbox.py'
  • Confirm monitoring/prometheus/bearer_token is absent from the tree
  • docker compose config fails without GRAFANA_ADMIN_PASSWORD and succeeds when set
  • Spot-check .env.example sandbox defaults

- Remove committed monitoring/prometheus/bearer_token and gitignore it
- Replace bearer_token.example with a non-secret placeholder
- Require GRAFANA_ADMIN_PASSWORD (no admin default)
- Allowlist MCP skill subprocess env (exclude provider/API tokens)
- Set USE_SANDBOX_DOCKER=true in .env.example to match README guidance
- Add unit coverage for MCP env allowlisting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant