agentic-threat-hunting-framework 0.3.0__tar.gz → 0.4.0__tar.gz

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.
Files changed (77) hide show
  1. {agentic_threat_hunting_framework-0.3.0/agentic_threat_hunting_framework.egg-info → agentic_threat_hunting_framework-0.4.0}/PKG-INFO +4 -1
  2. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0/agentic_threat_hunting_framework.egg-info}/PKG-INFO +4 -1
  3. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/agentic_threat_hunting_framework.egg-info/SOURCES.txt +7 -0
  4. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/agentic_threat_hunting_framework.egg-info/requires.txt +4 -0
  5. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/__version__.py +1 -1
  6. agentic_threat_hunting_framework-0.4.0/athf/agents/__init__.py +14 -0
  7. agentic_threat_hunting_framework-0.4.0/athf/agents/base.py +141 -0
  8. agentic_threat_hunting_framework-0.4.0/athf/agents/llm/__init__.py +27 -0
  9. agentic_threat_hunting_framework-0.4.0/athf/agents/llm/hunt_researcher.py +762 -0
  10. agentic_threat_hunting_framework-0.4.0/athf/agents/llm/hypothesis_generator.py +238 -0
  11. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/cli.py +17 -10
  12. agentic_threat_hunting_framework-0.4.0/athf/commands/__init__.py +21 -0
  13. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/commands/agent.py +43 -1
  14. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/commands/hunt.py +63 -12
  15. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/commands/similar.py +2 -2
  16. agentic_threat_hunting_framework-0.4.0/athf/commands/splunk.py +323 -0
  17. agentic_threat_hunting_framework-0.4.0/athf/core/splunk_client.py +360 -0
  18. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/core/template_engine.py +7 -1
  19. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/core/web_search.py +1 -1
  20. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/CHANGELOG.md +52 -0
  21. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/CLI_REFERENCE.md +518 -12
  22. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/getting-started.md +47 -3
  23. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/level4-agentic-workflows.md +9 -1
  24. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/maturity-model.md +56 -14
  25. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/pyproject.toml +6 -2
  26. agentic_threat_hunting_framework-0.3.0/athf/commands/__init__.py +0 -5
  27. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/LICENSE +0 -0
  28. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/MANIFEST.in +0 -0
  29. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/README.md +0 -0
  30. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/USING_ATHF.md +0 -0
  31. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/agentic_threat_hunting_framework.egg-info/dependency_links.txt +0 -0
  32. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/agentic_threat_hunting_framework.egg-info/entry_points.txt +0 -0
  33. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/agentic_threat_hunting_framework.egg-info/top_level.txt +0 -0
  34. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/ATHF_level_3.png +0 -0
  35. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/athf-cli-workflow.gif +0 -0
  36. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/athf-level0.gif +0 -0
  37. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/athf-level1.gif +0 -0
  38. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/athf-level2.gif +0 -0
  39. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/athf-level3.gif +0 -0
  40. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/athf_fivelevels.png +0 -0
  41. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/athf_lock.png +0 -0
  42. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/athf_logo.png +0 -0
  43. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/assets/athf_manual_v_ai.png +0 -0
  44. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/__init__.py +0 -0
  45. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/commands/context.py +0 -0
  46. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/commands/env.py +0 -0
  47. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/commands/init.py +0 -0
  48. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/commands/investigate.py +0 -0
  49. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/commands/research.py +0 -0
  50. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/core/__init__.py +0 -0
  51. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/core/attack_matrix.py +0 -0
  52. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/core/hunt_manager.py +0 -0
  53. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/core/hunt_parser.py +0 -0
  54. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/core/investigation_parser.py +0 -0
  55. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/core/research_manager.py +0 -0
  56. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/__init__.py +0 -0
  57. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/INSTALL.md +0 -0
  58. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/README.md +0 -0
  59. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/environment.md +0 -0
  60. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/lock-pattern.md +0 -0
  61. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/docs/why-athf.md +0 -0
  62. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/hunts/FORMAT_GUIDELINES.md +0 -0
  63. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/hunts/H-0001.md +0 -0
  64. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/hunts/H-0002.md +0 -0
  65. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/hunts/H-0003.md +0 -0
  66. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/hunts/README.md +0 -0
  67. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/integrations/MCP_CATALOG.md +0 -0
  68. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/integrations/README.md +0 -0
  69. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/integrations/quickstart/splunk.md +0 -0
  70. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/knowledge/hunting-knowledge.md +0 -0
  71. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/prompts/README.md +0 -0
  72. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/prompts/ai-workflow.md +0 -0
  73. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/prompts/basic-prompts.md +0 -0
  74. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/data/templates/HUNT_LOCK.md +0 -0
  75. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/athf/utils/__init__.py +0 -0
  76. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/setup.cfg +0 -0
  77. {agentic_threat_hunting_framework-0.3.0 → agentic_threat_hunting_framework-0.4.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentic-threat-hunting-framework
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Agentic Threat Hunting Framework - Memory and AI for threat hunters
5
5
  Author-email: Sydney Marrone <athf@nebulock.io>
6
6
  Maintainer-email: Sydney Marrone <athf@nebulock.io>
@@ -33,6 +33,7 @@ Requires-Dist: click>=8.0.0
33
33
  Requires-Dist: pyyaml>=6.0
34
34
  Requires-Dist: rich>=10.0.0
35
35
  Requires-Dist: jinja2>=3.0.0
36
+ Requires-Dist: python-dotenv>=0.19.0
36
37
  Requires-Dist: importlib_resources>=5.0.0; python_version < "3.9"
37
38
  Provides-Extra: dev
38
39
  Requires-Dist: pytest>=7.0.0; extra == "dev"
@@ -49,6 +50,8 @@ Requires-Dist: mkdocs>=1.5.0; extra == "docs"
49
50
  Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
50
51
  Provides-Extra: similarity
51
52
  Requires-Dist: scikit-learn>=1.0.0; extra == "similarity"
53
+ Provides-Extra: splunk
54
+ Requires-Dist: requests>=2.25.0; extra == "splunk"
52
55
  Dynamic: license-file
53
56
 
54
57
  # Agentic Threat Hunting Framework (ATHF)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentic-threat-hunting-framework
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Agentic Threat Hunting Framework - Memory and AI for threat hunters
5
5
  Author-email: Sydney Marrone <athf@nebulock.io>
6
6
  Maintainer-email: Sydney Marrone <athf@nebulock.io>
@@ -33,6 +33,7 @@ Requires-Dist: click>=8.0.0
33
33
  Requires-Dist: pyyaml>=6.0
34
34
  Requires-Dist: rich>=10.0.0
35
35
  Requires-Dist: jinja2>=3.0.0
36
+ Requires-Dist: python-dotenv>=0.19.0
36
37
  Requires-Dist: importlib_resources>=5.0.0; python_version < "3.9"
37
38
  Provides-Extra: dev
38
39
  Requires-Dist: pytest>=7.0.0; extra == "dev"
@@ -49,6 +50,8 @@ Requires-Dist: mkdocs>=1.5.0; extra == "docs"
49
50
  Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
50
51
  Provides-Extra: similarity
51
52
  Requires-Dist: scikit-learn>=1.0.0; extra == "similarity"
53
+ Provides-Extra: splunk
54
+ Requires-Dist: requests>=2.25.0; extra == "splunk"
52
55
  Dynamic: license-file
53
56
 
54
57
  # Agentic Threat Hunting Framework (ATHF)
@@ -23,6 +23,11 @@ assets/athf_manual_v_ai.png
23
23
  athf/__init__.py
24
24
  athf/__version__.py
25
25
  athf/cli.py
26
+ athf/agents/__init__.py
27
+ athf/agents/base.py
28
+ athf/agents/llm/__init__.py
29
+ athf/agents/llm/hunt_researcher.py
30
+ athf/agents/llm/hypothesis_generator.py
26
31
  athf/commands/__init__.py
27
32
  athf/commands/agent.py
28
33
  athf/commands/context.py
@@ -32,12 +37,14 @@ athf/commands/init.py
32
37
  athf/commands/investigate.py
33
38
  athf/commands/research.py
34
39
  athf/commands/similar.py
40
+ athf/commands/splunk.py
35
41
  athf/core/__init__.py
36
42
  athf/core/attack_matrix.py
37
43
  athf/core/hunt_manager.py
38
44
  athf/core/hunt_parser.py
39
45
  athf/core/investigation_parser.py
40
46
  athf/core/research_manager.py
47
+ athf/core/splunk_client.py
41
48
  athf/core/template_engine.py
42
49
  athf/core/web_search.py
43
50
  athf/data/__init__.py
@@ -2,6 +2,7 @@ click>=8.0.0
2
2
  pyyaml>=6.0
3
3
  rich>=10.0.0
4
4
  jinja2>=3.0.0
5
+ python-dotenv>=0.19.0
5
6
 
6
7
  [:python_version < "3.9"]
7
8
  importlib_resources>=5.0.0
@@ -23,3 +24,6 @@ mkdocs-material>=9.0.0
23
24
 
24
25
  [similarity]
25
26
  scikit-learn>=1.0.0
27
+
28
+ [splunk]
29
+ requests>=2.25.0
@@ -1,3 +1,3 @@
1
1
  """Version information for ATHF."""
2
2
 
3
- __version__ = "0.3.0"
3
+ __version__ = "0.4.0"
@@ -0,0 +1,14 @@
1
+ """ATHF Agent Framework.
2
+
3
+ This module provides base classes and implementations for ATHF agents.
4
+ Agents can be deterministic (Python-only) or LLM-powered (using Claude API).
5
+ """
6
+
7
+ from athf.agents.base import Agent, AgentResult, DeterministicAgent, LLMAgent
8
+
9
+ __all__ = [
10
+ "Agent",
11
+ "AgentResult",
12
+ "DeterministicAgent",
13
+ "LLMAgent",
14
+ ]
@@ -0,0 +1,141 @@
1
+ """Base classes for hunt-vault agents."""
2
+
3
+ import os
4
+ from abc import ABC, abstractmethod
5
+ from dataclasses import dataclass, field
6
+ from typing import Any, Dict, Generic, List, Optional, TypeVar
7
+
8
+ # Type variables for input/output
9
+ InputT = TypeVar("InputT")
10
+ OutputT = TypeVar("OutputT")
11
+
12
+
13
+ @dataclass
14
+ class AgentResult(Generic[OutputT]):
15
+ """Standard result format for all agents."""
16
+
17
+ success: bool
18
+ data: Optional[OutputT]
19
+ error: Optional[str] = None
20
+ warnings: List[str] = field(default_factory=list)
21
+ metadata: Dict[str, Any] = field(default_factory=dict)
22
+
23
+ @property
24
+ def is_success(self) -> bool:
25
+ """Check if the agent execution was successful."""
26
+ return self.success and self.error is None
27
+
28
+
29
+ class Agent(ABC, Generic[InputT, OutputT]):
30
+ """Base class for all agents."""
31
+
32
+ def __init__(self, config: Optional[Dict[str, Any]] = None):
33
+ """Initialize agent with optional configuration.
34
+
35
+ Args:
36
+ config: Optional configuration dictionary
37
+ """
38
+ self.config = config or {}
39
+ self._setup()
40
+
41
+ def _setup(self) -> None:
42
+ """Optional setup method for subclasses."""
43
+ pass
44
+
45
+ @abstractmethod
46
+ def execute(self, input_data: InputT) -> AgentResult[OutputT]:
47
+ """Execute agent logic.
48
+
49
+ Args:
50
+ input_data: Input for the agent
51
+
52
+ Returns:
53
+ AgentResult with output data or error
54
+ """
55
+ pass
56
+
57
+ def __call__(self, input_data: InputT) -> AgentResult[OutputT]:
58
+ """Allow calling agent as a function."""
59
+ return self.execute(input_data)
60
+
61
+
62
+ class DeterministicAgent(Agent[InputT, OutputT]):
63
+ """Base class for deterministic Python agents (no LLM)."""
64
+
65
+ pass
66
+
67
+
68
+ class LLMAgent(Agent[InputT, OutputT]):
69
+ """Base class for LLM-powered agents."""
70
+
71
+ def __init__(self, config: Optional[Dict[str, Any]] = None, llm_enabled: bool = True):
72
+ """Initialize LLM agent.
73
+
74
+ Args:
75
+ config: Optional configuration dictionary
76
+ llm_enabled: Whether to enable LLM functionality
77
+ """
78
+ self.llm_enabled = llm_enabled
79
+ super().__init__(config)
80
+
81
+ def _log_llm_metrics(
82
+ self,
83
+ agent_name: str,
84
+ model_id: str,
85
+ input_tokens: int,
86
+ output_tokens: int,
87
+ cost_usd: float,
88
+ duration_ms: int,
89
+ ) -> None:
90
+ """Log LLM call metrics to centralized tracker.
91
+
92
+ Args:
93
+ agent_name: Name of the agent (e.g., "hypothesis-generator")
94
+ model_id: Bedrock model ID
95
+ input_tokens: Number of input tokens
96
+ output_tokens: Number of output tokens
97
+ cost_usd: Estimated cost in USD
98
+ duration_ms: Call duration in milliseconds
99
+ """
100
+ try:
101
+ from athf.core.metrics_tracker import MetricsTracker # type: ignore[import-not-found]
102
+
103
+ MetricsTracker.get_instance().log_bedrock_call(
104
+ agent=agent_name,
105
+ model_id=model_id,
106
+ input_tokens=input_tokens,
107
+ output_tokens=output_tokens,
108
+ cost_usd=cost_usd,
109
+ duration_ms=duration_ms,
110
+ )
111
+ except Exception:
112
+ pass # Never fail agent execution due to metrics logging
113
+
114
+ def _get_llm_client(self) -> Any:
115
+ """Get AWS Bedrock runtime client for Claude models.
116
+
117
+ Returns:
118
+ Bedrock runtime client instance or None if LLM is disabled
119
+
120
+ Raises:
121
+ ValueError: If AWS credentials are not configured
122
+ ImportError: If boto3 package is not installed
123
+ """
124
+ if not self.llm_enabled:
125
+ return None
126
+
127
+ try:
128
+ import boto3 # type: ignore[import-untyped]
129
+
130
+ # Get AWS region from environment or use default
131
+ region = os.getenv("AWS_REGION", os.getenv("AWS_DEFAULT_REGION", "us-east-1"))
132
+
133
+ # Create Bedrock runtime client
134
+ # Uses AWS credentials from environment, ~/.aws/credentials, or IAM role
135
+ client = boto3.client(service_name="bedrock-runtime", region_name=region)
136
+
137
+ return client
138
+ except ImportError:
139
+ raise ImportError("boto3 package not installed. Run: pip install boto3")
140
+ except Exception as e:
141
+ raise ValueError(f"Failed to create Bedrock client: {e}")
@@ -0,0 +1,27 @@
1
+ """LLM-powered agents for ATHF.
2
+
3
+ These agents use Claude API for creative and analytical tasks.
4
+ All LLM agents have fallback to deterministic methods when LLM is disabled.
5
+ """
6
+
7
+ from athf.agents.llm.hunt_researcher import (
8
+ HuntResearcherAgent,
9
+ ResearchInput,
10
+ ResearchOutput,
11
+ ResearchSkillOutput,
12
+ )
13
+ from athf.agents.llm.hypothesis_generator import (
14
+ HypothesisGenerationInput,
15
+ HypothesisGenerationOutput,
16
+ HypothesisGeneratorAgent,
17
+ )
18
+
19
+ __all__ = [
20
+ "HypothesisGeneratorAgent",
21
+ "HypothesisGenerationInput",
22
+ "HypothesisGenerationOutput",
23
+ "HuntResearcherAgent",
24
+ "ResearchInput",
25
+ "ResearchOutput",
26
+ "ResearchSkillOutput",
27
+ ]