Skip to content

Commit 3de64e6

Browse files
committed
Add comprehensive integration and orchestration test suites for TailOpsMCP
- Implemented a detailed integration test suite in `test_system_integration.py` covering end-to-end workflows, multi-system orchestration, and security compliance. - Created a robust orchestration test suite in `test_workflow_orchestration.py` focusing on workflow execution lifecycle, error handling, approval workflows, scheduling, and parallel execution. - Utilized mocks for various services to simulate realistic scenarios and validate system behavior under different conditions. - Included tests for edge cases, performance, and reliability to ensure system robustness and fault tolerance.
1 parent 8acc6dc commit 3de64e6

40 files changed

+23852
-291
lines changed

.github/workflows/test.yml

Lines changed: 507 additions & 0 deletions
Large diffs are not rendered by default.

config/security-config.yaml

Lines changed: 386 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,386 @@
1+
# TailOpsMCP Security Configuration
2+
# Enhanced security and identity controls configuration
3+
4+
# Security Audit Logging Configuration
5+
security:
6+
audit_logging:
7+
enabled: true
8+
retention_days: 2555 # 7 years for compliance
9+
encryption_enabled: true
10+
real_time_processing: true
11+
database_path: "./logs/security_audit.db"
12+
log_file_path: "./logs/security_audit.log"
13+
14+
# Identity Management Configuration
15+
identity_management:
16+
session_timeout: 3600 # 1 hour in seconds
17+
max_concurrent_sessions: 3
18+
mfa_required_roles: ["admin", "operations", "security"]
19+
oidc_enabled: true
20+
tailscale_integration: true
21+
session_cleanup_interval: 300 # 5 minutes
22+
23+
# Access Control Configuration
24+
access_control:
25+
default_deny: true
26+
contextual_permissions: true
27+
risk_based_access: true
28+
separation_of_duties: true
29+
approval_chain_required: true
30+
31+
# Security Monitoring Configuration
32+
security_monitoring:
33+
threat_detection_enabled: true
34+
anomaly_detection: true
35+
real_time_alerts: true
36+
automated_response: false # Enable with caution
37+
38+
# Threat Detection Thresholds
39+
brute_force_threshold: 5
40+
brute_force_time_window: 300 # 5 minutes
41+
privilege_escalation_threshold: 3
42+
data_dumping_threshold: 100
43+
lateral_movement_threshold: 5
44+
45+
# Compliance Framework Configuration
46+
compliance:
47+
standards: ["SOC2", "ISO27001", "PCI-DSS"]
48+
automated_reporting: true
49+
evidence_collection: true
50+
retention_policies: true
51+
assessment_frequency: "quarterly"
52+
53+
# Data Retention Policies
54+
retention:
55+
audit_logs: 2555 # 7 years
56+
security_events: 2555 # 7 years
57+
user_sessions: 30 # 30 days
58+
security_alerts: 365 # 1 year
59+
compliance_reports: 2555 # 7 years
60+
threat_intelligence: 90 # 90 days
61+
62+
# Network Security Configuration
63+
network_security:
64+
private_ip_ranges:
65+
- "10.0.0.0/8"
66+
- "172.16.0.0/12"
67+
- "192.168/16"
68+
0.0.0/8"
69+
- "169.254.0 - "127..0/16"
70+
allowed_ports.0.0: [22, 80, 443, 8080]
71+
block_metadata_services: true
72+
allowlist_enabled: false
73+
: ["*"] allowed_hosts # Use ["*"] for wildcard, [] for deny all
74+
75+
# Authentication Configuration
76+
authentication:
77+
# Tailscale OIDC Integration
78+
tailscale_oidc:
79+
enabled: true
80+
issuer: "https://login.tailscale.com"
81+
audience: "tailops-mcp"
82+
claims_mapping:
83+
user_id: "sub"
84+
username: "preferred_username"
85+
email: "email"
86+
groups: "groups"
87+
roles: "roles"
88+
89+
# Session Management
90+
session_management:
91+
token_length: 32
92+
refresh_enabled: true
93+
revocation_enabled: true
94+
concurrent_sessions_limit: 3
95+
96+
# Multi-Factor Authentication
97+
mfa:
98+
required_for_roles: ["admin", "security", "operations"]
99+
methods: ["TOTP", "SMS", "Email"]
100+
backup_codes: true
101+
grace_period: 300 # 5 minutes
102+
103+
# Authorization Configuration
104+
authorization:
105+
# Role-Based Access Control
106+
rbac:
107+
roles:
108+
admin:
109+
permissions: ["*"]
110+
description: "Full system access"
111+
security:
112+
permissions: ["security:*", "audit:read", "compliance:*"]
113+
description: "Security team access"
114+
operations:
115+
permissions: ["operations:*", "fleet:*", "monitoring:*"]
116+
description: "Operations team access"
117+
user:
118+
permissions: ["targets:read", "targets:connect", "logs:read"]
119+
description: "Standard user access"
120+
121+
# Contextual Access Control
122+
contextual:
123+
time_restrictions:
124+
business_hours: [8, 17] # 8 AM to 5 PM
125+
business_days: [1, 2, 3, 4, 5] # Monday to Friday
126+
location_restrictions:
127+
allowed_countries: ["US", "CA", "GB"]
128+
block_vpn: false
129+
device_restrictions:
130+
require_trusted_devices: false
131+
allowed_device_types: ["desktop", "laptop", "mobile"]
132+
133+
# Security Monitoring Configuration
134+
monitoring:
135+
# Real-time Monitoring
136+
real_time:
137+
enabled: true
138+
alert_channels: ["log", "email"]
139+
escalation_rules:
140+
critical: ["immediate"]
141+
high: ["15min"]
142+
medium: ["1hour"]
143+
low: ["24hour"]
144+
145+
# Log Analysis
146+
log_analysis:
147+
enabled: true
148+
retention: 90 # days
149+
analysis_interval: 300 # 5 minutes
150+
pattern_matching: true
151+
anomaly_detection: true
152+
153+
# Threat Intelligence
154+
threat_intelligence:
155+
enabled: true
156+
sources: ["internal", "commercial"]
157+
update_frequency: "daily"
158+
confidence_threshold: 0.7
159+
160+
# Incident Response Configuration
161+
incident_response:
162+
# Automated Response
163+
automated_response:
164+
enabled: false # Enable with caution
165+
actions:
166+
brute_force: ["block_ip", "alert_security"]
167+
privilege_escalation: ["alert_security", "require_approval"]
168+
data_exfiltration: ["block_operation", "alert_management"]
169+
170+
# Manual Response
171+
manual_response:
172+
escalation_matrix:
173+
level_1: ["security_team"]
174+
level_2: ["security_manager"]
175+
level_3: ["cto", "legal"]
176+
177+
# Communication
178+
communication:
179+
channels:
180+
email:
181+
enabled: true
182+
smtp_server: "smtp.example.com"
183+
from_address: "[email protected]"
184+
slack:
185+
enabled: false
186+
webhook_url: ""
187+
teams:
188+
enabled: false
189+
webhook_url: ""
190+
191+
# Compliance Configuration
192+
compliance:
193+
# SOC2 Configuration
194+
soc2:
195+
enabled: true
196+
controls:
197+
- "CC6.1" # Logical and Physical Access Controls
198+
- "CC6.2" # User Registration
199+
- "CC6.3" # User Access Management
200+
- "CC7.1" # System Operations
201+
- "CC8.1" # Change Management
202+
203+
# ISO 27001 Configuration
204+
iso27001:
205+
enabled: true
206+
controls:
207+
- "A.9.1.1" # Access Control Policy
208+
- "A.9.2.1" # User Registration
209+
- "A.9.4.1" # Information Access Restriction
210+
- "A.12.4.1" # Event Logging
211+
- "A.12.6.1" # Technical Vulnerability Management
212+
213+
# PCI DSS Configuration
214+
pci_dss:
215+
enabled: false # Enable only if handling payment data
216+
controls:
217+
- "8.2.3" # Multi-factor Authentication
218+
- "10.1" # Audit Trails
219+
- "10.2" # Automated Audit Trails
220+
221+
# GDPR Configuration
222+
gdpr:
223+
enabled: false # Enable only if handling EU personal data
224+
data_retention: 2555 # days
225+
consent_required: true
226+
right_to_erasure: true
227+
data_portability: true
228+
229+
# Risk Management Configuration
230+
risk_management:
231+
# Risk Assessment
232+
risk_assessment:
233+
enabled: true
234+
factors:
235+
- "user_profile"
236+
- "resource_sensitivity"
237+
- "operation_type"
238+
- "time_context"
239+
- "location_context"
240+
241+
# Risk Scoring
242+
risk_scoring:
243+
thresholds:
244+
low: 0.3
245+
medium: 0.6
246+
high: 0.8
247+
critical: 0.95
248+
249+
# Risk Mitigation
250+
mitigation:
251+
automatic_blocking: false
252+
approval_required: true
253+
additional_monitoring: true
254+
255+
# Security Policies Configuration
256+
policies:
257+
# Password Policy
258+
password_policy:
259+
min_length: 12
260+
require_uppercase: true
261+
require_lowercase: true
262+
require_numbers: true
263+
require_symbols: true
264+
prevent_reuse: 5
265+
max_age: 90 # days
266+
267+
# Session Policy
268+
session_policy:
269+
idle_timeout: 1800 # 30 minutes
270+
absolute_timeout: 3600 # 1 hour
271+
concurrent_sessions: 3
272+
session_regeneration: true
273+
274+
# Access Policy
275+
access_policy:
276+
default_deny: true
277+
least_privilege: true
278+
periodic_review: true
279+
review_frequency: 90 # days
280+
281+
# Data Handling Policy
282+
data_policy:
283+
classification_required: true
284+
encryption_required: true
285+
backup_required: true
286+
retention_enforced: true
287+
288+
# Environment-Specific Overrides
289+
environments:
290+
development:
291+
security:
292+
audit_logging:
293+
retention_days: 30
294+
security_monitoring:
295+
automated_response: false
296+
compliance:
297+
standards: ["internal"]
298+
299+
staging:
300+
security:
301+
audit_logging:
302+
retention_days: 90
303+
security_monitoring:
304+
real_time_alerts: true
305+
compliance:
306+
standards: ["SOC2", "ISO27001"]
307+
308+
production:
309+
security:
310+
audit_logging:
311+
retention_days: 2555
312+
encryption_enabled: true
313+
security_monitoring:
314+
real_time_alerts: true
315+
automated_response: true
316+
compliance:
317+
standards: ["SOC2", "ISO27001", "PCI-DSS"]
318+
319+
# Notification Configuration
320+
notifications:
321+
# Security Alerts
322+
security_alerts:
323+
enabled: true
324+
channels: ["email", "log"]
325+
recipients:
326+
security_team: ["[email protected]"]
327+
management: ["[email protected]"]
328+
329+
# Compliance Reports
330+
compliance_reports:
331+
enabled: true
332+
frequency: "monthly"
333+
recipients: ["[email protected]"]
334+
335+
# System Health
336+
system_health:
337+
enabled: true
338+
frequency: "daily"
339+
recipients: ["[email protected]"]
340+
341+
# Integration Configuration
342+
integrations:
343+
# Tailscale Integration
344+
tailscale:
345+
enabled: true
346+
serve_enabled: true
347+
auth_enabled: true
348+
oidc_enabled: true
349+
350+
# Proxmox Integration
351+
proxmox:
352+
enabled: false # Enable if using Proxmox
353+
api_endpoint: ""
354+
credentials: ""
355+
356+
# SIEM Integration
357+
siem:
358+
enabled: false
359+
endpoint: ""
360+
api_key: ""
361+
362+
# Threat Intelligence
363+
threat_intel:
364+
enabled: false
365+
providers: []
366+
api_keys: {}
367+
368+
# Development and Testing Configuration
369+
development:
370+
# Testing Mode
371+
testing:
372+
enabled: false
373+
mock_services: false
374+
bypass_authentication: false
375+
376+
# Debug Configuration
377+
debug:
378+
enabled: false
379+
log_level: "INFO"
380+
audit_all_requests: false
381+
382+
# Development Security
383+
dev_security:
384+
allow_localhost: true
385+
relaxed_cors: true
386+
debug_endpoints: true

0 commit comments

Comments
 (0)