TestimoX

API Reference

Class

TestimoRunner

Namespace TestimoX.Execution
Assembly TestimoX
Modifiers sealed

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 optionalposition: 0
powerShellRuntime TestimoX.Configuration.Engine.PowerShellRuntimeConfig = null optionalposition: 1

Methods

public async Task<List<Rule>> DiscoverRulesAsync(Boolean includeDisabled = true, CancellationToken ct = null, String powerShellRulesDirectory = null) #
Returns: Task<List<Rule>>

Discovers rules from loaded providers.

Parameters

includeDisabled System.Boolean = true optionalposition: 0
When true, include rules that are disabled by default.
ct System.Threading.CancellationToken = null optionalposition: 1
Cancellation token.
powerShellRulesDirectory System.String = null optionalposition: 2
Optional directory containing user PowerShell rules (.ps1) to load alongside built-in rules.
public Void EnableRocaIfAvailable(String datasetPath, List<Rule> rules) #
Returns: Void

Enables ROCA rule automatically when the optional dataset file is available and ROCA detector is initialized.

Parameters

datasetPath System.String requiredposition: 0
Path to ROCA dataset (optional).
rules System.Collections.Generic.List{TestimoX.Definitions.Rule} requiredposition: 1
Discovered rules to adjust.
RunAsync 4 overloads
public async Task<TestimoRunResult> RunAsync(IEnumerable<String> ruleNames, ExecutionConfiguration config, CancellationToken ct = null) #
Returns: Task<TestimoRunResult>

Runs selected rules using an isolated engine instance and the provided configuration.

Parameters

ruleNames System.Collections.Generic.IEnumerable{System.String} requiredposition: 0
Names of rules to run (case-insensitive).
config TestimoX.Execution.ExecutionConfiguration requiredposition: 1
Execution options (concurrency, reports, verbosity, preflight, etc.).
ct System.Threading.CancellationToken = null optionalposition: 2
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) #
Returns: Task<TestimoRunResult>

Runs selected rules using an existing Testimo engine.

Parameters

engine TestimoX.Testimo requiredposition: 0
Reusable engine instance to configure and execute.
ruleNames System.Collections.Generic.IEnumerable{System.String} requiredposition: 1
Names of rules to run (case-insensitive).
config TestimoX.Execution.ExecutionConfiguration = null requiredposition: 2
Optional execution options; when null, inferred from the engine state.
ct System.Threading.CancellationToken = null optionalposition: 3
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 required
Engine instance.
csharpRules TestimoX.Definitions.CSharpRule[] required
Optional list of C# rules (enum values).
powershellRules TestimoX.RulesPowerShell.PowerShellRule[] required
Optional list of PowerShell rules (enum values).
ct System.Threading.CancellationToken required
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 required
Engine instance.
csharpRules TestimoX.Definitions.CSharpRule[] required
Optional list of C# rules (enum values).
powershellRuleNames System.String[] required
Optional list of PowerShell rule names.
ct System.Threading.CancellationToken required
Cancellation token.

Returns

Aggregated run result.