This page assumes familiarity with Alloy. If you’re new to the language, start with Alloy Basics and the Alloy Syntax Guide.
Overview
Alloy is a declarative modeling language based on first-order relational logic. Unlike TLA+ which focuses on temporal behavior, Alloy excels at analyzing static structural properties and finding counterexamples to security assertions. For the AD tier model, Alloy verifies that:- No attack paths exist from Tier 2 to Tier 0
- DCSync rights are restricted to Tier 0
- Protected groups cannot be modified by lower tiers
- Resource-Based Constrained Delegation cannot be abused for escalation
The Alloy model performs analysis similar to BloodHound but with formal guarantees. It finds all possible attack paths within the modeled permissions, not just known patterns.
Data Model
Principal Hierarchy
Container Structure
Tier Model
Security Descriptors and ACLs
ACL Structure
Permission Rights
The specification models the full range of AD permissions: Control RightsProtected Groups
Well-known privileged groups are automatically assigned to Tier 0:Attack Path Detection
The specification includes 11 predicates for discovering attack paths. The examples below show the conceptual approach; see the full specification for exact implementation.Effective Trustee Resolution
Determines if a principal matches an ACE trustee (directly or through group membership):Core Compromise Predicate
Determines if a principal can compromise a target:Attack Scenarios
1. WriteDACL/WriteOwner Abuse
2. Group Membership Manipulation
3. Password Reset Attacks
4. DCSync Exploitation
5. Resource-Based Constrained Delegation (RBCD)
msDS-AllowedToActOnBehalfOfOtherIdentity plus a controlled account with an SPN.
6. SPN Manipulation (Kerberoasting Setup)
7. Shadow Credentials
msDS-KeyCredentialLink allows authentication as the target without knowing their password.
8. Constrained Delegation Abuse
9. Cross-Tier Compromise Chains
Security Assertions
The specification includes 9 key assertions that verify tier isolation:1. NoTier2ToTier0Path
2. NoTier1ToTier0Path
3. TierIsolationMaintained
4. DCSyncOnlyTier0
5. ProtectedGroupsSecure
6. NoRBCDEscalation
7. NoDanglingOwners
8. NoTier2ToTier1Path
9. NoSelfEscalationToProtectedGroups
Running the Model
Prerequisites
- Download and install the Alloy Analyzer
- Clone the ADTierModel-Rust repository
Basic Analysis
- Open
ADTierModel_ACL.alsin the Alloy Analyzer - Select an assertion to check (e.g.,
NoTier2ToTier0Path) - Click “Execute” to run the analysis
Understanding Scope
Thefor N clause limits the search space:
Interpreting Results
No Counterexample Found The assertion holds for all configurations within the specified scope. This provides high confidence but not absolute proof. Counterexample Found Alloy displays a concrete configuration showing:- The principals involved
- Their tier assignments
- The ACL configuration that enables the attack
- The specific permissions being exploited
Counterexamples are visualized as graphs, making it easy to understand the attack path. Each node represents an AD object, and edges show relationships and permissions.
Extending the Model
Adding New Attack Patterns
To model a new attack technique:- Define any new permission types or properties
- Create a predicate describing the attack conditions
- Add the predicate to
canCompromise - Create an assertion verifying tier isolation against the attack
Analyzing Your Environment
Export your AD configuration to Alloy format:- Extract ACLs using PowerShell or tools like BloodHound
- Transform to Alloy facts defining your specific principals and permissions
- Run assertions to identify actual attack paths