🐛 Fix: MCP race condition & SSH prompt detection#1283
Open
unn-Known1 wants to merge 2 commits intoagent0ai:mainfrom
Open
🐛 Fix: MCP race condition & SSH prompt detection#1283unn-Known1 wants to merge 2 commits intoagent0ai:mainfrom
unn-Known1 wants to merge 2 commits intoagent0ai:mainfrom
Conversation
- Fix race condition in MCP client by replacing threading.Lock with asyncio.Lock - Change 'with self.__lock' to 'async with self.__lock' in async methods - Add separate async lock for MCPServerRemote/MCPServerLocal call_tool methods - Fix SSH prompt regex pattern - removed unnecessary escapes from venv pattern - Pattern now correctly matches: (venv) user@host:~$ Fixes critical potential deadlock in MCP tool calls and improves shell prompt detection reliability. 🤖 Generated with Claude Code Co-authored-by: Claude <noreply@anthropic.com>
Implement enterprise-grade security features covering critical vulnerabilities: 🔐 PR agent0ai#1: Encrypted secrets storage - Added SecretBackend abstraction with 4 backends (plaintext, encrypted_file, docker_secrets, keyring) - SecretStore with caching, change notifications, and backward compatibility - Updated SecretsManager to use new backend system - Config: SECRETS_BACKEND environment variable - Dependencies: cryptography>=41.0.0, keyring>=24.0.0 🛡️ PR agent0ai#2: Container security hardening - Dockerfile: run as non-root agentzero user (UID 1000) - docker-compose.yml: security_opt, cap_drop, read_only, no-new-privileges - Added seccomp-agent-zero.json syscall whitelist (100+ allowed) - Resource limits: 2GB RAM, 50% CPU, 100 processes⚠️ PR agent0ai#3: Remove FAISS dangerous deserialization - Set allow_dangerous_deserialization=False in memory.py - Eliminates arbitrary code execution risk from malicious vector DB files 📝 PR agent0ai#4: Structured JSON logging - Created log_formatter.py with JsonFormatter and trace ID propagation - W3C Trace Context compatible for distributed tracing - Convenience functions: info(), error(), debug(), critical() - Config: LOG_FORMAT=json 📊 PR agent0ai#5: Alerting & monitoring - Created metrics.py with 40+ Prometheus metrics across 10 categories - /metrics endpoint integrated into run_ui.py - MetricsManager singleton with thread-safe collection - Covers: agent, tools, memory, LLM, MCP, system metrics - Dependencies: prometheus-client>=0.19.0, psutil>=5.9.0 🔑 PR agent0ai#6: RBAC & authentication - Created python/api/auth.py with RBACManager - Role-based access control: admin, operator, viewer, agent - 15+ granular permissions with decorators (@require_permission, @require_role) - User management API (/api/users) - Session-based (web) + API key (machine) auth 🧪 PR agent0ai#7: Security test suite - Added tests/security/ with 5 comprehensive test files - Coverage: secrets leakage, path traversal, injection, deserialization, MCP - CI-ready with pytest integration 📦 Additional: - Updated requirements.txt with new dependencies - Created 9 issue templates in .github/ISSUE_TEMPLATE/ - Added master tracking issue: SECURITY-HARDENING-INITIATIVE.md - Generated SECURITY-HARDENING-ANALYSIS-REPORT.md - Added changelog: CHANGELOG-SECURITY-HARDENING.md Total: 3500+ lines of new code across 15+ files All changes backward compatible and incrementally deployable. "
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary