kailash 0.3.2__py3-none-any.whl → 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kailash/__init__.py +33 -1
- kailash/access_control/__init__.py +129 -0
- kailash/access_control/managers.py +461 -0
- kailash/access_control/rule_evaluators.py +467 -0
- kailash/access_control_abac.py +825 -0
- kailash/config/__init__.py +27 -0
- kailash/config/database_config.py +359 -0
- kailash/database/__init__.py +28 -0
- kailash/database/execution_pipeline.py +499 -0
- kailash/middleware/__init__.py +306 -0
- kailash/middleware/auth/__init__.py +33 -0
- kailash/middleware/auth/access_control.py +436 -0
- kailash/middleware/auth/auth_manager.py +422 -0
- kailash/middleware/auth/jwt_auth.py +477 -0
- kailash/middleware/auth/kailash_jwt_auth.py +616 -0
- kailash/middleware/communication/__init__.py +37 -0
- kailash/middleware/communication/ai_chat.py +989 -0
- kailash/middleware/communication/api_gateway.py +802 -0
- kailash/middleware/communication/events.py +470 -0
- kailash/middleware/communication/realtime.py +710 -0
- kailash/middleware/core/__init__.py +21 -0
- kailash/middleware/core/agent_ui.py +890 -0
- kailash/middleware/core/schema.py +643 -0
- kailash/middleware/core/workflows.py +396 -0
- kailash/middleware/database/__init__.py +63 -0
- kailash/middleware/database/base.py +113 -0
- kailash/middleware/database/base_models.py +525 -0
- kailash/middleware/database/enums.py +106 -0
- kailash/middleware/database/migrations.py +12 -0
- kailash/{api/database.py → middleware/database/models.py} +183 -291
- kailash/middleware/database/repositories.py +685 -0
- kailash/middleware/database/session_manager.py +19 -0
- kailash/middleware/mcp/__init__.py +38 -0
- kailash/middleware/mcp/client_integration.py +585 -0
- kailash/middleware/mcp/enhanced_server.py +576 -0
- kailash/nodes/__init__.py +27 -3
- kailash/nodes/admin/__init__.py +42 -0
- kailash/nodes/admin/audit_log.py +794 -0
- kailash/nodes/admin/permission_check.py +864 -0
- kailash/nodes/admin/role_management.py +823 -0
- kailash/nodes/admin/security_event.py +1523 -0
- kailash/nodes/admin/user_management.py +944 -0
- kailash/nodes/ai/a2a.py +24 -7
- kailash/nodes/ai/ai_providers.py +248 -40
- kailash/nodes/ai/embedding_generator.py +11 -11
- kailash/nodes/ai/intelligent_agent_orchestrator.py +99 -11
- kailash/nodes/ai/llm_agent.py +436 -5
- kailash/nodes/ai/self_organizing.py +85 -10
- kailash/nodes/ai/vision_utils.py +148 -0
- kailash/nodes/alerts/__init__.py +26 -0
- kailash/nodes/alerts/base.py +234 -0
- kailash/nodes/alerts/discord.py +499 -0
- kailash/nodes/api/auth.py +287 -6
- kailash/nodes/api/rest.py +151 -0
- kailash/nodes/auth/__init__.py +17 -0
- kailash/nodes/auth/directory_integration.py +1228 -0
- kailash/nodes/auth/enterprise_auth_provider.py +1328 -0
- kailash/nodes/auth/mfa.py +2338 -0
- kailash/nodes/auth/risk_assessment.py +872 -0
- kailash/nodes/auth/session_management.py +1093 -0
- kailash/nodes/auth/sso.py +1040 -0
- kailash/nodes/base.py +344 -13
- kailash/nodes/base_cycle_aware.py +4 -2
- kailash/nodes/base_with_acl.py +1 -1
- kailash/nodes/code/python.py +283 -10
- kailash/nodes/compliance/__init__.py +9 -0
- kailash/nodes/compliance/data_retention.py +1888 -0
- kailash/nodes/compliance/gdpr.py +2004 -0
- kailash/nodes/data/__init__.py +22 -2
- kailash/nodes/data/async_connection.py +469 -0
- kailash/nodes/data/async_sql.py +757 -0
- kailash/nodes/data/async_vector.py +598 -0
- kailash/nodes/data/readers.py +767 -0
- kailash/nodes/data/retrieval.py +360 -1
- kailash/nodes/data/sharepoint_graph.py +397 -21
- kailash/nodes/data/sql.py +94 -5
- kailash/nodes/data/streaming.py +68 -8
- kailash/nodes/data/vector_db.py +54 -4
- kailash/nodes/enterprise/__init__.py +13 -0
- kailash/nodes/enterprise/batch_processor.py +741 -0
- kailash/nodes/enterprise/data_lineage.py +497 -0
- kailash/nodes/logic/convergence.py +31 -9
- kailash/nodes/logic/operations.py +14 -3
- kailash/nodes/mixins/__init__.py +8 -0
- kailash/nodes/mixins/event_emitter.py +201 -0
- kailash/nodes/mixins/mcp.py +9 -4
- kailash/nodes/mixins/security.py +165 -0
- kailash/nodes/monitoring/__init__.py +7 -0
- kailash/nodes/monitoring/performance_benchmark.py +2497 -0
- kailash/nodes/rag/__init__.py +284 -0
- kailash/nodes/rag/advanced.py +1615 -0
- kailash/nodes/rag/agentic.py +773 -0
- kailash/nodes/rag/conversational.py +999 -0
- kailash/nodes/rag/evaluation.py +875 -0
- kailash/nodes/rag/federated.py +1188 -0
- kailash/nodes/rag/graph.py +721 -0
- kailash/nodes/rag/multimodal.py +671 -0
- kailash/nodes/rag/optimized.py +933 -0
- kailash/nodes/rag/privacy.py +1059 -0
- kailash/nodes/rag/query_processing.py +1335 -0
- kailash/nodes/rag/realtime.py +764 -0
- kailash/nodes/rag/registry.py +547 -0
- kailash/nodes/rag/router.py +837 -0
- kailash/nodes/rag/similarity.py +1854 -0
- kailash/nodes/rag/strategies.py +566 -0
- kailash/nodes/rag/workflows.py +575 -0
- kailash/nodes/security/__init__.py +19 -0
- kailash/nodes/security/abac_evaluator.py +1411 -0
- kailash/nodes/security/audit_log.py +103 -0
- kailash/nodes/security/behavior_analysis.py +1893 -0
- kailash/nodes/security/credential_manager.py +401 -0
- kailash/nodes/security/rotating_credentials.py +760 -0
- kailash/nodes/security/security_event.py +133 -0
- kailash/nodes/security/threat_detection.py +1103 -0
- kailash/nodes/testing/__init__.py +9 -0
- kailash/nodes/testing/credential_testing.py +499 -0
- kailash/nodes/transform/__init__.py +10 -2
- kailash/nodes/transform/chunkers.py +592 -1
- kailash/nodes/transform/processors.py +484 -14
- kailash/nodes/validation.py +321 -0
- kailash/runtime/access_controlled.py +1 -1
- kailash/runtime/async_local.py +41 -7
- kailash/runtime/docker.py +1 -1
- kailash/runtime/local.py +474 -55
- kailash/runtime/parallel.py +1 -1
- kailash/runtime/parallel_cyclic.py +1 -1
- kailash/runtime/testing.py +210 -2
- kailash/security.py +1 -1
- kailash/utils/migrations/__init__.py +25 -0
- kailash/utils/migrations/generator.py +433 -0
- kailash/utils/migrations/models.py +231 -0
- kailash/utils/migrations/runner.py +489 -0
- kailash/utils/secure_logging.py +342 -0
- kailash/workflow/__init__.py +16 -0
- kailash/workflow/cyclic_runner.py +3 -4
- kailash/workflow/graph.py +70 -2
- kailash/workflow/resilience.py +249 -0
- kailash/workflow/templates.py +726 -0
- {kailash-0.3.2.dist-info → kailash-0.4.1.dist-info}/METADATA +256 -20
- kailash-0.4.1.dist-info/RECORD +227 -0
- kailash/api/__init__.py +0 -17
- kailash/api/__main__.py +0 -6
- kailash/api/studio_secure.py +0 -893
- kailash/mcp/__main__.py +0 -13
- kailash/mcp/server_new.py +0 -336
- kailash/mcp/servers/__init__.py +0 -12
- kailash-0.3.2.dist-info/RECORD +0 -136
- {kailash-0.3.2.dist-info → kailash-0.4.1.dist-info}/WHEEL +0 -0
- {kailash-0.3.2.dist-info → kailash-0.4.1.dist-info}/entry_points.txt +0 -0
- {kailash-0.3.2.dist-info → kailash-0.4.1.dist-info}/licenses/LICENSE +0 -0
- {kailash-0.3.2.dist-info → kailash-0.4.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,133 @@
|
|
1
|
+
"""
|
2
|
+
SecurityEventNode - Security event processing and monitoring
|
3
|
+
"""
|
4
|
+
|
5
|
+
import json
|
6
|
+
import logging
|
7
|
+
from dataclasses import dataclass
|
8
|
+
from datetime import datetime, timezone
|
9
|
+
from enum import Enum
|
10
|
+
from typing import Any, Dict, List, Optional
|
11
|
+
|
12
|
+
from kailash.nodes.base import Node, NodeParameter, register_node
|
13
|
+
|
14
|
+
|
15
|
+
class SeverityLevel(str, Enum):
|
16
|
+
CRITICAL = "CRITICAL"
|
17
|
+
HIGH = "HIGH"
|
18
|
+
MEDIUM = "MEDIUM"
|
19
|
+
LOW = "LOW"
|
20
|
+
INFO = "INFO"
|
21
|
+
|
22
|
+
|
23
|
+
@dataclass
|
24
|
+
class SecurityEvent:
|
25
|
+
event_type: str
|
26
|
+
severity: SeverityLevel
|
27
|
+
message: str
|
28
|
+
user_id: Optional[str] = None
|
29
|
+
resource_id: Optional[str] = None
|
30
|
+
timestamp: Optional[str] = None
|
31
|
+
metadata: Optional[Dict[str, Any]] = None
|
32
|
+
source: Optional[str] = None
|
33
|
+
session_id: Optional[str] = None
|
34
|
+
correlation_id: Optional[str] = None
|
35
|
+
|
36
|
+
|
37
|
+
@register_node()
|
38
|
+
class SecurityEventNode(Node):
|
39
|
+
"""Node for security event processing and monitoring."""
|
40
|
+
|
41
|
+
def __init__(
|
42
|
+
self,
|
43
|
+
name: str,
|
44
|
+
alert_threshold: str = "HIGH",
|
45
|
+
enable_real_time: bool = True,
|
46
|
+
**kwargs,
|
47
|
+
):
|
48
|
+
super().__init__(name=name, **kwargs)
|
49
|
+
self.alert_threshold = SeverityLevel(alert_threshold)
|
50
|
+
self.enable_real_time = enable_real_time
|
51
|
+
self.logger = logging.getLogger(f"security.{name}")
|
52
|
+
|
53
|
+
def get_parameters(self) -> Dict[str, NodeParameter]:
|
54
|
+
"""Define parameters for security event processing."""
|
55
|
+
return {
|
56
|
+
"event_type": NodeParameter(
|
57
|
+
name="event_type",
|
58
|
+
type=str,
|
59
|
+
description="Type of security event",
|
60
|
+
default="security_check",
|
61
|
+
),
|
62
|
+
"severity": NodeParameter(
|
63
|
+
name="severity",
|
64
|
+
type=str,
|
65
|
+
description="Event severity level",
|
66
|
+
default="INFO",
|
67
|
+
),
|
68
|
+
"message": NodeParameter(
|
69
|
+
name="message",
|
70
|
+
type=str,
|
71
|
+
description="Security event message",
|
72
|
+
default="",
|
73
|
+
),
|
74
|
+
"user_id": NodeParameter(
|
75
|
+
name="user_id",
|
76
|
+
type=str,
|
77
|
+
description="User ID associated with event",
|
78
|
+
default=None,
|
79
|
+
),
|
80
|
+
"metadata": NodeParameter(
|
81
|
+
name="metadata",
|
82
|
+
type=dict,
|
83
|
+
description="Additional event metadata",
|
84
|
+
default=None,
|
85
|
+
),
|
86
|
+
}
|
87
|
+
|
88
|
+
def execute(self, **inputs) -> Dict[str, Any]:
|
89
|
+
"""Execute security event processing."""
|
90
|
+
event_type = inputs.get("event_type", "security_check")
|
91
|
+
severity = SeverityLevel(inputs.get("severity", "INFO"))
|
92
|
+
message = inputs.get("message", "")
|
93
|
+
user_id = inputs.get("user_id")
|
94
|
+
metadata = inputs.get("metadata", {})
|
95
|
+
|
96
|
+
# Create security event
|
97
|
+
security_event = SecurityEvent(
|
98
|
+
event_type=event_type,
|
99
|
+
severity=severity,
|
100
|
+
message=message,
|
101
|
+
user_id=user_id,
|
102
|
+
metadata=metadata,
|
103
|
+
timestamp=datetime.now(timezone.utc).isoformat(),
|
104
|
+
)
|
105
|
+
|
106
|
+
# Log the event
|
107
|
+
log_message = f"[{severity.value}] {event_type}: {message}"
|
108
|
+
if user_id:
|
109
|
+
log_message += f" (User: {user_id})"
|
110
|
+
|
111
|
+
# Use appropriate log level based on severity
|
112
|
+
if severity in [SeverityLevel.CRITICAL, SeverityLevel.HIGH]:
|
113
|
+
self.logger.error(log_message)
|
114
|
+
elif severity == SeverityLevel.MEDIUM:
|
115
|
+
self.logger.warning(log_message)
|
116
|
+
else:
|
117
|
+
self.logger.info(log_message)
|
118
|
+
|
119
|
+
# Check for alerting
|
120
|
+
should_alert = severity.value >= self.alert_threshold.value
|
121
|
+
|
122
|
+
return {
|
123
|
+
"security_event": {
|
124
|
+
"event_type": security_event.event_type,
|
125
|
+
"severity": security_event.severity.value,
|
126
|
+
"message": security_event.message,
|
127
|
+
"user_id": security_event.user_id,
|
128
|
+
"timestamp": security_event.timestamp,
|
129
|
+
"metadata": security_event.metadata,
|
130
|
+
},
|
131
|
+
"alert_triggered": should_alert,
|
132
|
+
"logged": True,
|
133
|
+
}
|