Skip to content

refactor: centralize and enforce domain domination checks in orchestrator automation#323

Merged
l50 merged 1 commit into
mainfrom
refactor/dominated-domain-gating
May 16, 2026
Merged

refactor: centralize and enforce domain domination checks in orchestrator automation#323
l50 merged 1 commit into
mainfrom
refactor/dominated-domain-gating

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented May 16, 2026

Key Changes:

  • Enforced domain domination checks in all orchestrator automation modules to
    prevent redundant work in already-dominated domains
  • Added and unified is_domain_dominated logic in shared state for accurate,
    netbios-aware domain normalization
  • Updated task queue, credential expansion, share spidering, PTH spray, GPP
    sysvol, and stall detection logic to skip dominated domains
  • Added comprehensive tests for domain domination filtering across all
    relevant modules

Added:

  • Test coverage for domain domination filtering in:
    • Credential expansion, hash expansion, and low-hanging fruit selection
    • GPP sysvol automation
    • PTH spray automation
    • Share spidering automation
    • Stall spray and low-hanging fruit stall detection
    • State inner logic for domain domination and netbios mapping

Changed:

  • All orchestrator automation selection routines (credential_access,
    credential_expansion, gpp_sysvol, pth_spray, shares, stall_detection)
    now call state.is_domain_dominated() to skip work for dominated domains
  • Updated PTH spray to filter out machine and krbtgt hashes, require domain
    match, and handle domain normalization more robustly
  • Share spidering now resolves and checks the share's domain before work is
    scheduled
  • Refactored state management:
    • Added is_domain_dominated to StateInner with netbios/FQDN handling
    • Ensured all relevant automation routines use normalized domain checks
  • Updated task monitoring and queue cleanup to propagate domain state
    consistently
  • Improved CLI and Taskfile logic for report fetching and operation monitoring,
    including more robust polling and output handling

Removed:

  • Redundant and inconsistent ad-hoc domain domination checks from individual
    automation modules, replaced with a centralized approach via shared state

…modules

**Added:**

- Unit tests verifying that automation work selection skips dominated domains for:
  - Low-hanging credential work
  - Credential expansion and hash expansion
  - GPP SYSVOL collection
  - Pass-the-hash spray
  - Share spidering
  - Stall detection spray and LHF work
- Tests for new domain domination logic and edge cases in state management

**Changed:**

- Refactored report fetching logic in ec2 Taskfile to transfer large reports in
  chunks and verify checksums for reliability
- Updated multi-agent red team operation workflow to poll operation status and
  fetch reports only after completion, with improved status monitoring and
  error handling in Taskfile
- Taskfile now defaults WAIT to true for multi-agent ops for safer automation
- Refined ares-cli ops command to clarify `auto_report` is implied by `--follow`
- Updated orchestrator automation modules (credential expansion, gpp_sysvol,
  pth_spray, shares, stall_detection) to skip work in domains marked as dominated
- Improved hash expansion to only select hosts/DCs within the same forest/domain
  and to prefer resolved domain names
- Enhanced pass-the-hash spray to enforce domain boundaries and filter out
  machine/krbtgt hashes and dominated domains
- Refined share spider work selection to exclude shares in dominated domains
- Updated stall detection logic to avoid unnecessary work in dominated domains
- Monitoring: stale orchestrator tasks are now marked failed and completed in
  state, preventing resource leaks and improving reporting
- Added `is_domain_dominated` method to state, handling NetBIOS and FQDN
  resolution, with tests

**Removed:**

- Removed legacy direct port-forward and Redis fetch logic from Taskfile in
  favor of operation-aware polling and report transfer
- Removed deprecated manual domain inference in pass-the-hash spray logic
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 86.79245% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.83%. Comparing base (716599a) to head (57e073c).

Files with missing lines Patch % Lines
ares-cli/src/orchestrator/monitoring.rs 0.00% 19 Missing ⚠️
...rc/orchestrator/automation/credential_expansion.rs 84.12% 10 Missing ⚠️
ares-cli/src/ops/mod.rs 0.00% 3 Missing ⚠️
ares-cli/src/orchestrator/automation/shares.rs 95.65% 2 Missing ⚠️
ares-cli/src/orchestrator/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #323      +/-   ##
==========================================
+ Coverage   78.81%   78.83%   +0.02%     
==========================================
  Files         439      439              
  Lines      125356   125591     +235     
==========================================
+ Hits        98800    99013     +213     
- Misses      26556    26578      +22     
Files with missing lines Coverage Δ
...i/src/orchestrator/automation/credential_access.rs 77.59% <100.00%> (+0.26%) ⬆️
ares-cli/src/orchestrator/automation/gpp_sysvol.rs 84.85% <100.00%> (+0.72%) ⬆️
ares-cli/src/orchestrator/automation/pth_spray.rs 93.24% <100.00%> (+0.55%) ⬆️
...cli/src/orchestrator/automation/stall_detection.rs 71.09% <100.00%> (+1.58%) ⬆️
ares-cli/src/orchestrator/state/inner.rs 92.85% <100.00%> (+0.30%) ⬆️
ares-cli/src/orchestrator/mod.rs 0.00% <0.00%> (ø)
ares-cli/src/orchestrator/automation/shares.rs 84.93% <95.65%> (+2.85%) ⬆️
ares-cli/src/ops/mod.rs 0.00% <0.00%> (ø)
...rc/orchestrator/automation/credential_expansion.rs 80.31% <84.12%> (+0.88%) ⬆️
ares-cli/src/orchestrator/monitoring.rs 55.69% <0.00%> (-2.60%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@l50 l50 merged commit 1f2d24c into main May 16, 2026
12 checks passed
@l50 l50 deleted the refactor/dominated-domain-gating branch May 16, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant