Skip to content

feat: add autonomous red team agent, unify blue/red core, and restructure project for dual-mode operations#22

Merged
l50 merged 5 commits intomainfrom
jayson/cap-787-migrate-armada-kali-red-team-agent-to-ares-codebase
Jan 8, 2026
Merged

feat: add autonomous red team agent, unify blue/red core, and restructure project for dual-mode operations#22
l50 merged 5 commits intomainfrom
jayson/cap-787-migrate-armada-kali-red-team-agent-to-ares-codebase

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented Jan 8, 2026

Key Changes:

  • Added a fully autonomous Red Team agent with pentesting tools, golden ticket, BloodHound, and ADCS exploitation
  • Unified blue and red team agent architecture under a single ares package with shared core, integrations, and templates
  • Enhanced blue team agent with precursor investigation logic and improved MITRE/detection recipe chaining
  • Major project restructuring: moved all code to src/ares, modularized tools, agents, reports, and templates

Added:

  • Autonomous Red Team agent (RedTeamOrchestrator) supporting Active Directory enumeration, credential harvesting, share pilfering, password cracking, BloodHound, ADCS (Certipy), delegation attacks, and golden ticket workflows - src/ares/agents/red/, src/ares/tools/red/, src/ares/reports/redteam.py
  • Unified core agent creation and state models for both blue and red team workflows - src/ares/core/
  • Comprehensive attack chain and detection recipe YAMLs for MITRE-based precursor and detection question generation - templates/engines/attack_chains.yaml, templates/engines/detection_recipes.yaml
  • Extensive Jinja2 prompt templates for red team agents, cracker, share pilfer, golden ticket, and reporting - templates/redteam/agents/, templates/redteam/reports/
  • Red team tasks in Taskfile.yaml for orchestrating pentests, EC2 discovery, and SSM log monitoring
  • Documentation covering dual blue/red workflows, attack chain logic, and red team usage (README.md, docs/)

Changed:

  • Refactored blue team agent and tool APIs to use new ares core, models, and templates (e.g., src/agent.pysrc/ares/agents/blue/soc_investigator.py)
  • Enhanced investigation prompt logic to always extract MITRE techniques and generate precursor questions
  • Improved LogQL query validation, progressive log search, and time handling in blue team tools
  • Unified toolset registration and state management for both agent types
  • Updated build, packaging, and script entry points to use ares namespace throughout (pyproject.toml, Taskfile.yaml)
  • Updated documentation, task usage, and templates to reflect red/blue duality and new command/task structure
  • Blue team agent now prioritizes precursor investigation and detection recipes based on attack chain definitions

Removed:

  • Deprecated src/ root module files and legacy single-agent structure
  • Obsolete blue team-only tool wrappers and duplicated logic (migrated to new modular toolsets)
  • Legacy main.py, agent.py, and old-style tools/ modules (replaced with src/ares/main.py and modular imports)
  • Unused or redundant code paths now handled by the shared core and templates

l50 added 4 commits January 7, 2026 22:13
…tegration

**Added:**

- Introduced `create_redteam.py` as a factory for building red team agents with
  preset workflows, event hooks, and system instructions for Active Directory
  penetration testing operations
- Added a CLI command (`red-team`) to `main.py` to launch autonomous red team
  operations against a target, including report generation and result logging
- Implemented `redteam_agent.py` orchestrator class to manage agent execution,
  state, and automated reporting for red team engagements
- Developed `redteam_report.py` to generate detailed markdown reports of red
  team findings, attack paths, and MITRE ATT&CK mappings
- Created `tools/redteam.py` with comprehensive toolsets for network
  enumeration, credential harvesting, cracking, share pilfering, golden ticket
  attacks, BloodHound/Certipy/Delegation workflows, and reporting integration
- Added new agent and task instruction templates under `templates/redteam/agents`
  covering system operation, password cracking, golden ticket, and share pilfering
- Added new report summary template under `templates/redteam/reports` for
  structured operation results

**Changed:**

- Extended `models.py` with new dataclasses for red team operations, including
  `Target`, `Host`, `User`, `Credential`, `Hash`, `Share`, and `RedTeamState`
  to track discoveries, credentials, progress, and success metrics

**Why:**

- Enables fully automated, reproducible, and observable red team engagements
  with systematic enumeration, privilege escalation, credential harvesting,
  and executive reporting suitable for penetration testing and security validation
**Added:**

- Introduced red team agent tasks: `ares:red`, `ares:red:local`, and
  `ares:red:orchestrate` for offensive operations, supporting remote orchestration
  via S3/SSM and local/1Password credential loading

**Changed:**

- Renamed SOC agent tasks to "blue team agent" for clarity and consistency
- Updated environment variable usage to standardize on `GRAFANA_API_KEY` instead
  of `GRAFANA_SERVICE_ACCOUNT_TOKEN`
- Changed python module invocation from `src` to `ares` throughout agent commands
- Improved .env file validation and error messaging for blue team agent tasks
- Refined log and echo output to reduce noise and improve clarity in blue team
  agent tasks
- Updated `ares:version` task to directly print version using Python import
- Updated MITRE ATT&CK test task to reference new import path
- Clarified terminology in API key checks and user messages for consistency

**Removed:**

- Removed redundant and verbose comments and echo statements in blue team agent
  tasks to streamline execution and output
…ecipe engines

**Added:**

- Introduced `src/ares` package structure, modularizing agents, core, integrations,
  reports, and tools for blue and red teams
- Implemented attack chain and detection recipe engines in `ares.core.engines`,
  loading from new YAML configs for precursor/follow-on mapping and Windows event
  detection
- Added extensive precursor investigation logic and detection recipe logic to
  MITRENavigator, enhancing investigative question generation
- Created YAML files: `templates/engines/attack_chains.yaml` and
  `templates/engines/detection_recipes.yaml` defining attack chains, detection
  recipes, log patterns, and Windows event mappings for common techniques
- Added new tools for blue and red teams under `ares.tools.blue` and
  `ares.tools.red`, including advanced investigation, observability, and
  completion/escalation actions
- Provided shared MITRE lookup tools and core agent factories for blue/red
- Added enhanced Jinja templates for initial alert prompts and precursor
  questions, enforcing investigation workflow and time handling

**Changed:**

- Refactored main agent entry points, reports, and models to reference new
  modular locations under `ares/`
- Enhanced initial alert prompt to stress precursor investigation, correct time
  range usage, and stepwise evidence recording
- Updated investigation workflow to enforce mandatory evidence recording after
  every query and prevent query loops
- Improved LogQL guidance and error handling in blue team tools
- Main orchestration scripts now always use absolute report directory paths and
  improved shutdown handling
- MITRENavigator now generates precursor/detection recipe questions before
  follow-on and gap analysis
- All file and template references adjusted to new package structure and
  directory layout
- Updated pyproject.toml, test imports, and build config to reference new
  module/package names (`ares` instead of `src`)
- Improved investigation completion tool to enforce stricter validation on
  evidence, stage, host/user findings, and timeline

**Removed:**

- Removed old monolithic src/agent.py, src/redteam_agent.py, and tools/__init__.py,
  actions.py, core/__init__.py, and other legacy glue in favor of modular
  ares/ package structure
- Deleted src/__init__.py and obsolete src/core/create.py in favor of new
  factory modules
- Eliminated duplicate or redundant imports and logic now covered by new engines,
  reports, and toolsets
… clarity

**Added:**

- Expanded mypy error code disables: misc, valid-type, untyped-decorator in
  `pyproject.toml` for broader static analysis coverage
- Added detailed comments to Bandit skips and expanded the skip list to handle
  pentesting tool usage and code style exceptions in `pyproject.toml`
- Added multiple additional ignore rules to Ruff config to account for
  project-specific code patterns and stylistic choices in `pyproject.toml`

**Changed:**

- Updated mypy module override from `src.*` to `ares.*` in `pyproject.toml`
- Reordered and grouped imports for consistency and PEP8 compliance across
  several modules (`src/ares/__init__.py`, `src/ares/agents/blue/soc_investigator.py`,
  `src/ares/agents/red/pentester.py`, `src/ares/core/factories/blue_factory.py`,
  `src/ares/core/factories/red_factory.py`, `src/ares/tools/blue/investigation.py`)
- Improved line breaking and formatting for long function calls and dict
  constructions for better readability (multiple files)
- Updated detection of MITRE technique extraction in orchestrators to use
  `labels.get(key)` and `annotations.get(key)` idiom for null-safety and clarity
- Simplified conditional logic in `GrafanaTools` by merging branches and
  flattening response handling
- Streamlined error and suggestion string formatting for LokiTools and other
  Toolset methods
- Improved handling of available recipes and their display logic in
  `QuestionEngineTools`
- Updated some docstring examples to add `# pragma: allowlist secret` comments
  for password fields in red team tools
- Improved import ordering and __all__ listing order in several `__init__.py`
  files for consistency

**Removed:**

- Eliminated unnecessary noqa comments for private member access in
  `src/ares/main.py` and other places now covered by updated lint config
- Removed unused import of `InvestigationStage` from
  `src/ares/tools/blue/actions.py` for clarity
@linear
Copy link
Copy Markdown

linear Bot commented Jan 8, 2026

CAP-787 Migrate Armada Kali Red Team Agent to Ares Codebase

Description:
Migrate the Armada Kali Red Team agent suite—including all specialized agents, data models, and pentesting tools—into the Ares codebase. This will unify red team offensive capabilities with Ares' defensive SOC infrastructure, ensuring alignment with Dreadnode platform standards and enabling integrated purple teaming.


Objective:

Fully integrate Armada’s Kali Red Team agents and tools into the Ares codebase using the Dreadnode Agent SDK, providing robust offensive security testing functionality while maintaining separation and safety controls within the SOC platform.


Scope of Work:

  • Confirm architectural approach (Option A: Full SDK migration)
  • Create new directory structure for red team agents, tools, and models in Ares
  • Port and adapt Armada data models (op_types.py) to src/models/redteam.py
  • Refactor EnumAgent as a Dreadnode agent (proof of concept)
  • Migrate CrackerAgent, SharePilferAgent, and GoldenTicketAgent to Dreadnode SDK
  • Port all pentesting tool functions to src/tools/redteam/kali_tools.py using Dreadnode’s @tool system
  • Implement CLI and Taskfile commands for red team agent execution
  • Add Docker deployment configs and ensure isolation of red team operations
  • Develop documentation and safety checks for red team functionality
  • Write unit and integration tests for all new agents and tools

Dependencies:

  • Dreadnode Agent SDK and platform integration
  • Existing Ares codebase and SOC agent
  • Armada Kali source files from /Users/l/dreadnode/armada/armada/examples/kali/
  • Docker (and optionally Ansible/AWS SSM for future deployment)
  • Addition of rigging>=1.0.0 to dependencies
  • Team decision on architecture (Option A confirmation)

Acceptance Criteria:

  1. Red team agents (EnumAgent, CrackerAgent, SharePilferAgent, GoldenTicketAgent) function as Dreadnode agents within Ares
  2. Pentesting tools and data models are fully ported and integrated with observability in Dreadnode platform
  3. CLI and Taskfile commands enable safe, authorized execution of red team operations
  4. Docker deployment for red team agents and tools is operational and isolated
  5. Safety mechanisms (authorization, target validation, logging) are enforced and tested
  6. Comprehensive documentation (docs/redteam.md) is available and integrated into main README
  7. Unit and integration tests for red team features pass successfully

Additional Notes:

  • Reference Armada Kali agent architecture doc: /Users/l/dreadnode/armada/armada/examples/kali/AGENT_ARCHITECTURE.md
  • Ensure red team and SOC agent logic remain logically and operationally separated
  • Initial deployment should focus on Docker for isolation; AWS SSM support can be added in later iterations
  • Highlight explicit warnings and authorization requirements in CLI and documentation to prevent misuse
  • For purple team reporting, ensure attack actions are visible and traceable in Dreadnode platform

@dreadnode-renovate-bot dreadnode-renovate-bot Bot added area/docs Changes made to project documentation area/python area/templates Changes made to warpgate template configurations labels Jan 8, 2026
@l50 l50 merged commit 1240ac0 into main Jan 8, 2026
8 checks passed
@l50 l50 deleted the jayson/cap-787-migrate-armada-kali-red-team-agent-to-ares-codebase branch January 8, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Changes made to project documentation area/templates Changes made to warpgate template configurations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant