Overview
TLA+ (Temporal Logic of Actions) is a formal specification language developed by Leslie Lamport. It excels at modeling concurrent and distributed systems where correctness depends on the order and interleaving of operations. For the AD tier model, TLA+ verifies that:- No administrative action can create cross-tier access
- Credentials never leak from higher to lower tiers
- Service accounts remain properly hardened
- Group nesting never creates circular dependencies
The specification implements the equivalent of LDAP’s
LDAP_MATCHING_RULE_IN_CHAIN (OID 1.2.840.113556.1.4.1941) for transitive group membership resolution.Core Type System
The specification defines the fundamental types and their relationships:State Variables
The model tracks the following state:| Variable | Type | Description |
|---|---|---|
tierAssignment | Object → Tier | Current tier for each object |
groupMembership | Object → Set(Group) | Direct group memberships |
nestedGroupMembership | Group → Set(Group) | Groups that are members of other groups |
primaryGroup | Object → Group | Primary group (for POSIX compatibility) |
activeSessions | Computer → Set(User) | Currently logged-in users |
credentialCache | Computer → Set(User) | Cached credentials on each computer |
gpoRestrictions | Tier → Set(Tier) | Logon restrictions per tier |
tier0Infrastructure | Set(Computer) | Systems that must remain Tier 0 |
Helper Functions
Transitive Group Closure
Computes all groups a principal belongs to through nested membership:Access Validation
Determines if a user can access a resource based on tier assignment:All Group Memberships
Returns combined direct, nested, and primary group memberships:Safety Invariants
The specification defines 10 core safety invariants that must hold in every reachable state.1. TierIsolation
No user can hold administrative privileges across multiple tiers:2. Tier0InfrastructurePlacement
Critical infrastructure must remain assigned to Tier 0:3. GpoRestrictionsValid
Each tier must deny logon from other tiers via GPO:4. ObjectTierConsistency
Admin group memberships must align with assigned tier levels:5. NoCrossTierSessions
Active sessions must respect tier boundaries:6. Tier0CredentialsProtected
Tier 0 credentials cannot be cached on lower-tier systems:7. Tier1CredentialsProtected
Tier 1 credentials cannot be cached on Tier 2 systems:8. NoCircularGroupNesting
Groups cannot transitively contain themselves:9. PrimaryGroupConsistency
Primary group assignments must match object tier assignments:10. ServiceAccountHardening
Privileged service accounts must be properly secured:Compliance Detection
The specification identifies and quantifies violations:Violation Types
| Violation | Severity Weight | Description |
|---|---|---|
| Cross-tier admin access | 20 | User in admin groups across multiple tiers |
| Misplaced Tier 0 infrastructure | 25 | Critical system not in Tier 0 |
| Wrong tier placement | 15 | Object in incorrect tier |
| Unhardened service account | 10 | Service account not marked sensitive |
| Interactive service account | 10 | Service account allows interactive logon |
| Stale account | 5 | Account inactive for 90+ days |
Compliance Score
Administrative Actions
The specification models 12 state transitions. The key actions are shown below:Additional actions include
RemoveFromTierGroup, RemoveNestedGroupMembership, SetPrimaryGroup, DesignateTier0Infrastructure, RemoveTier0Infrastructure, DisableAccount, EnableAccount, and UpdateLastLogon. See the full specification for details.MoveObjectToTier
Moves an object to a different tier with hardening validation:AddToTierGroup
Adds an object to a tier group, preventing cross-tier membership:AddNestedGroupMembership
Adds a group as a member of another group, preventing cycles:HardenServiceAccount
Marks a service account as sensitive and disables interactive logon:Running the Model
Prerequisites
- Download and install the TLA+ Toolbox
- Clone the ADTierModel-Rust repository
Model Configuration
TheADTierModel.cfg file configures the model checker:
Running TLC
- Open
ADTierModel.tlain the TLA+ Toolbox - Create a new model using the configuration
- Run the model checker
The model with the default configuration typically explores several thousand states. Larger configurations exponentially increase the state space.
Interpreting Results
No Violations Found
If TLC completes without errors, the tier model design is verified to maintain all safety invariants under the configured constraints.Violation Found
TLC provides a trace showing:- The initial state
- Each action taken
- The state where the invariant was violated
- Which invariant failed