Security Policy - GitLab Zero-Leak MCP Server

March 29, 2025 ยท View on GitHub

Objective

To prevent all possible unintentional or unauthorized source code exposure through MCP Server integrations.

Threat Model & Mitigations

ThreatMitigation
AI/LLM client accesses source codeget_file_contents handler disabled by default
Unintended read access to any repoRead operations restricted by ALLOWED_READ_PROJECTS allowlist
Leaked GitLab token or misuse.env excluded from version control; recommend least-privilege tokens
External access to MCP ServerDocker binds only to internal IP (e.g., 192.168.x.x); not exposed publicly
Elevated privileges in containerDockerfile runs as non-root user
  • Only run within secured network (e.g., LAN/VPN)
  • Use firewalls to limit access to MCP port (8081)
  • Never commit .env files to version control
  • Use token scopes that exclude admin-level privileges
  • Optional: add audit logging in index.ts to trace usage

Future Enhancements (Optional)

  • mTLS authentication between Claude and MCP Server
  • Add AUDIT_LOG_ENABLED toggle
  • Integration with log aggregation (ELK, Loki, etc.)