API Reference
TestimoRunner
Host‑agnostic entry point for discovering and running TestimoX rules. Use this from CLI, PowerShell, or samples to share consistent behavior.
Inheritance
- Object
- TestimoRunner
Constructors
public TestimoRunner(IRuleProvider[] providers = null, PowerShellRuntimeConfig powerShellRuntime = null) #Creates a runner with optional custom rule providers.
Parameters
- providers TestimoX.Providers.IRuleProvider[] = null
- powerShellRuntime TestimoX.Configuration.Engine.PowerShellRuntimeConfig = null
Methods
public async Task<List<Rule>> DiscoverRulesAsync(Boolean includeDisabled = true, CancellationToken ct = null, String powerShellRulesDirectory = null) #Task<List<Rule>>Discovers rules from loaded providers.
Parameters
- includeDisabled System.Boolean = true
- When true, include rules that are disabled by default.
- ct System.Threading.CancellationToken = null
- Cancellation token.
- powerShellRulesDirectory System.String = null
- Optional directory containing user PowerShell rules (.ps1) to load alongside built-in rules.
public Void EnableRocaIfAvailable(String datasetPath, List<Rule> rules) #VoidEnables ROCA rule automatically when the optional dataset file is available and ROCA detector is initialized.
Parameters
- datasetPath System.String
- Path to ROCA dataset (optional).
- rules System.Collections.Generic.List{TestimoX.Definitions.Rule}
- Discovered rules to adjust.
public async Task<TestimoRunResult> RunAsync(IEnumerable<String> ruleNames, ExecutionConfiguration config, CancellationToken ct = null) #Task<TestimoRunResult>Runs selected rules using an isolated engine instance and the provided configuration.
Parameters
- ruleNames System.Collections.Generic.IEnumerable{System.String}
- Names of rules to run (case-insensitive).
- config TestimoX.Execution.ExecutionConfiguration
- Execution options (concurrency, reports, verbosity, preflight, etc.).
- ct System.Threading.CancellationToken = null
- Cancellation token.
Returns
Aggregated run result with counts, elapsed time, and the engine instance.
Examples
var runner = new TestimoRunner();
var config = new ExecutionConfiguration { Concurrency = 4, GenerateHtml = true };
var result = await runner.RunAsync(new[]{ "DomainGpoLlmnrWdigestConfiguration", "DomainControllerSmbSigning" }, config);
Console.WriteLine($"Ran {result.RuleCount} rules in {result.Elapsed}.");
public async Task<TestimoRunResult> RunAsync(Testimo engine, CSharpRule[] csharpRules, String[] powershellRuleNames, CancellationToken ct = null) #Task<TestimoRunResult>Runs selected rules using an existing Testimo engine.
Parameters
- engine TestimoX.Testimo
- Reusable engine instance to configure and execute.
- ruleNames System.Collections.Generic.IEnumerable{System.String}
- Names of rules to run (case-insensitive).
- config TestimoX.Execution.ExecutionConfiguration = null
- Optional execution options; when null, inferred from the engine state.
- ct System.Threading.CancellationToken = null
- Cancellation token.
Returns
Aggregated run result with counts, elapsed time, and the engine instance.
RunAsync(TestimoX.Testimo engine, TestimoX.Definitions.CSharpRule[] csharpRules, TestimoX.RulesPowerShell.PowerShellRule[] powershellRules, System.Threading.CancellationToken ct) #Runs a mix of C# enum-based rules and PowerShell enum-based rules using an existing engine.
Parameters
- engine TestimoX.Testimo
- Engine instance.
- csharpRules TestimoX.Definitions.CSharpRule[]
- Optional list of C# rules (enum values).
- powershellRules TestimoX.RulesPowerShell.PowerShellRule[]
- Optional list of PowerShell rules (enum values).
- ct System.Threading.CancellationToken
- Cancellation token.
Returns
Aggregated run result.
RunAsync(TestimoX.Testimo engine, TestimoX.Definitions.CSharpRule[] csharpRules, System.String[] powershellRuleNames, System.Threading.CancellationToken ct) #Runs a mix of C# enum-based rules and PowerShell rule names using an existing engine.
Parameters
- engine TestimoX.Testimo
- Engine instance.
- csharpRules TestimoX.Definitions.CSharpRule[]
- Optional list of C# rules (enum values).
- powershellRuleNames System.String[]
- Optional list of PowerShell rule names.
- ct System.Threading.CancellationToken
- Cancellation token.
Returns
Aggregated run result.