SurePassID Compliance Manager User Guide

SurePassID Authentication Server

SurePassID Compliance Monitoring and Reporting Library - User Guide


Introduction

The SurePassID Compliance Monitoring and Reporting Library provides a comprehensive solution for:

  • Collecting authentication events from multiple sources (JSON files, Syslog, Windows Event Log, SurePassID REST API, Entra ID/Azure AD)
  • Correlating events with privileged user identities from Active Directory
  • Analyzing MFA vs SFA authentication patterns
  • Generating compliance reports for CMMC 2.0 and HIPAA
  • Creating audit-ready evidence packs with integrity hashes
  • Monitoring authentication events in real-time with alerts
  • Integrating with AI agents via MCP-compatible tool definitions

Getting Started

Easy Setup: Configuration Wizard

New in v1.3.0! The easiest way to get started - no JSON editing required.

Using the CLI Wizard

# Run the interactive setup wizard
compliance-cli configure

# Quick mode - only prompts for required settings
compliance-cli configure --quick

# Save to a specific location
compliance-cli configure --output C:\Services\ComplianceMonitor\appsettings.json

The wizard will guide you through:

  1. Event Source Selection - Choose SurePassID API, JSON files, or Syslog
  2. Server Configuration - Enter your SurePassID server URL and API credentials
  3. Active Directory Setup - Configure AD server and authentication
  4. Privileged Groups - Specify which AD groups to monitor
  5. Schedule - Set when compliance checks should run

Using the PowerShell Setup Script (Windows)

# Full interactive setup with service installation
.\scripts\Setup-ComplianceService.ps1

# Custom install location
.\scripts\Setup-ComplianceService.ps1 -InstallPath "D:\Apps\Compliance"

# Only generate config (no service install)
.\scripts\Setup-ComplianceService.ps1 -ConfigOnly

# Uninstall existing service
.\scripts\Setup-ComplianceService.ps1 -Uninstall

Using the Template File

# Copy the commented template
copy src\SurePassID.Compliance.Cli\appsettings.template.jsonc appsettings.json

# Edit with any text editor - comments explain each setting
notepad appsettings.json

Manual Setup

For programmatic use or advanced configuration:

NuGet Packages

<ItemGroup>
  <PackageReference Include="SurePassID.Compliance.Runner" />
  <PackageReference Include="SurePassID.Compliance.Events.RestApi" />
  <PackageReference Include="SurePassID.Compliance.Identity.ActiveDirectory" />
  <PackageReference Include="SurePassID.Compliance.Reporting" />
  <PackageReference Include="SurePassID.Compliance.Monitoring" />
</ItemGroup>

Minimal Code Example

using Microsoft.Extensions.DependencyInjection;
using SurePassID.Compliance.Events.RestApi;
using SurePassID.Compliance.Identity.ActiveDirectory;
using SurePassID.Compliance.Runner;

// Configure services
var services = new ServiceCollection();

// Add SurePassID REST API event source
services.AddSurePassIdRestApiEventSource(options =>
{
    options.Endpoint = "https://mfa.company.com/api/mfa/v1";
    options.ApiKeyId = "your-api-key-id";
    options.ApiKey = "your-api-key";
});

// Add identity provider
services.AddActiveDirectoryIdentityProvider(options =>
{
    options.Server = "dc01.contoso.com";
    options.BaseDn = "DC=contoso,DC=com";
    options.UseIntegratedAuth = true;
});

// Add compliance runner
services.AddComplianceRunner();

var provider = services.BuildServiceProvider();
var runner = provider.GetRequiredService<IComplianceRunner>();

// Run compliance check
var result = await runner.RunAsync(new ComplianceRunRequest
{
    Start = DateTimeOffset.UtcNow.AddDays(-1),
    End = DateTimeOffset.UtcNow,
    PrivilegedGroupNamesOrDns = ["Domain Admins", "Enterprise Admins"],
    Reports = [ReportType.PrivilegedAuthReport, ReportType.SfaMfaSummary]
});

Console.WriteLine($"Events analyzed: {result.Summary.EventsIngested}");
Console.WriteLine($"MFA rate: {result.Summary.MfaPercentage}%");

CLI Commands

The compliance-cli tool provides command-line access to all features:

Configure Command (New!)

# Interactive configuration wizard
compliance-cli configure

# Quick setup - required fields only
compliance-cli configure --quick

# Save to custom location
compliance-cli configure --output /path/to/appsettings.json

# Test configuration after saving
compliance-cli configure --test

Run Command

# Run with defaults (24-hour lookback)
compliance-cli run

# Custom time range
compliance-cli run --start "2024-01-15" --end "2024-01-16"

# Custom lookback
compliance-cli run --lookback 48

# Specific groups
compliance-cli run --groups "Domain Admins" "DBA Admins" "Healthcare IT"

# All output formats
compliance-cli run --format all --output ./reports

# Specific output format (json, csv, pdf, html, or all)
compliance-cli run --format csv

# Omit --format to use the ReportFormats section of appsettings.json
# (JSON is always generated; PDF/HTML/CSV are controlled by configuration)
compliance-cli run

# Generate evidence pack
compliance-cli run --evidence-pack

# Quiet mode (JSON output for automation)
compliance-cli run --quiet

# Custom config file
compliance-cli run --config /path/to/appsettings.json

# Verbose logging
compliance-cli run --verbose

Exit Codes

Code Meaning
0 Success - Compliant
1 Error - Check failed
2 Success - Non-compliant (SFA detected)

Architecture Overview

+---------------------------------------------------------------------------+
|                             Compliance Runner                             |
|                                                                           |
|       +---------------+     +---------------+     +---------------+       |
|       | Event Source  |     |   Identity    |     |  Correlation  |       |
|       |    Adapter    |     |   Provider    |     |    Engine     |       |
|       +---------------+     +---------------+     +---------------+       |
|               |                     |                     |               |
|               v                     v                     v               |
|       +-----------------------------------------------------------+       |
|       |                   Compliance Run Engine                   |       |
|       +-----------------------------------------------------------+       |
|                                     |                                     |
|               +---------------------+---------------------+               |
|               |                     |                     |               |
|               v                     v                     v               |
|       +---------------+     +---------------+     +---------------+       |
|       |    Reports    |     |   Evidence    |     |    Alerts     |       |
|       |  (JSON/PDF)   |     |     Packs     |     |   (Webhook)   |       |
|       +---------------+     +---------------+     +---------------+       |
|                                                                           |
+---------------------------------------------------------------------------+

Project Structure

Project Purpose
SurePassID.Compliance.Events.Abstractions Event source interfaces and models
SurePassID.Compliance.Events.FileIngest JSON file event source
SurePassID.Compliance.Events.Syslog Syslog event source
SurePassID.Compliance.Events.WindowsEventLog Windows Event Log source
SurePassID.Compliance.Events.RestApi SurePassID REST API event source
SurePassID.Compliance.Events.EntraId Entra ID (Azure AD) Graph API and JSON import
SurePassID.Compliance.Identity.Abstractions Identity provider interfaces
SurePassID.Compliance.Identity.ActiveDirectory Active Directory provider
SurePassID.Compliance.Identity.SurePassId SurePassID identity provider
SurePassID.Compliance.Correlation Event-identity correlation
SurePassID.Compliance.Reporting Report generation (JSON, CSV, PDF)
SurePassID.Compliance.Runner Main orchestration engine
SurePassID.Compliance.Monitoring Real-time monitoring service
SurePassID.Compliance.Agent.Tools AI agent tool definitions (MCP)
SurePassID.Compliance.McpServer Pre-built MCP server for GitHub Copilot, Claude Desktop, Cursor
SurePassID.Compliance.Cli Command-line interface
SurePassID.Compliance.Runner.Service Windows Service / Linux daemon

Configuration

Configuration Methods

Choose the method that fits your needs:

Method Best For Skill Level
CLI Wizard (compliance-cli configure) First-time setup Beginner
PowerShell Script (Setup-ComplianceService.ps1) Windows Service deployment Beginner
Template File (appsettings.template.jsonc) Guided manual editing Intermediate
Environment Variables Docker, CI/CD, secrets Intermediate
JSON Config (appsettings.json) Full control Advanced

Configuration Precedence

Settings are loaded in this order (later sources override earlier):

  1. appsettings.json (base configuration)
  2. appsettings.{Environment}.json (environment-specific)
  3. appsettings.Local.json (local overrides, gitignored)
  4. Environment variables (COMPLIANCE_* or Section__Key)
  5. Command-line arguments

Configuration Reference

ComplianceService Section

{
  "ComplianceService": {
    "Enabled": true,
    "CronSchedule": "0 2 * * *",
    "TimeZone": "UTC",
    "RunOnStartup": false,
    "LookbackHours": 24,
    "PrivilegedGroups": ["Domain Admins", "Enterprise Admins"],
    "OutputDirectory": "./ComplianceReports",
    "RetentionDays": 90,
    "MaxConsecutiveFailures": 3
  },
  "ReportFormats": {
    "Json": true,
    "Pdf": false,
    "Html": false,
    "Csv": false
  }
}
Setting Description Default
Enabled Enable scheduled checks true
CronSchedule Cron expression for schedule 0 2 * * *
TimeZone IANA timezone for schedule UTC
RunOnStartup Run immediately on service start false
LookbackHours Hours of events to analyze 24
PrivilegedGroups AD groups to monitor Domain Admins, Enterprise Admins
OutputDirectory Report output path ./ComplianceReports
RetentionDays Days to keep old reports 90

Report formats. The top-level ReportFormats section controls which report files are produced when the CLI runs without an explicit --format argument. JSON is always generated; Pdf, Html, and Csv are opt-in booleans set here (or via the configure wizard). Passing --format on the command line overrides these settings for that run.

EventSources Section (Multi-Source)

{
  "EventSources": {
    "SurePassID": { "Enabled": true },
    "WindowsEventLog": { "Enabled": true },
    "JsonFile": {
      "Enabled": false,
      "DirectoryPath": "./Events",
      "FilePattern": "*.json"
    },
    "Syslog": { "Enabled": false }
  }
}
Source Description
SurePassID Real-time MFA events from SurePassID server
WindowsEventLog Windows Security event log (AD logon events 4624, 4625, etc.)
JsonFile JSON files from SIEM exports
Syslog Linux/Unix syslog files
EntraIdJson / EntraIdGraph Azure AD sign-in logs

When multiple sources are enabled, events are fetched in parallel and merged chronologically using AggregateEventSource. See Multiple Event Sources for details.

Legacy: The single-source EventSource:Type configuration is still supported for backward compatibility but EventSources takes priority when both are present.

WindowsEventLog Section

{
  "WindowsEventLog": {
    "LogName": "Security",
    "ComputerNames": [],
    "IncludeSuccessfulLogons": true,
    "IncludeFailedLogons": true,
    "IncludeLockouts": true,
    "ExcludeMachineAccounts": true,
    "ExcludeSystemAccounts": true,
    "MaxEventsPerQuery": 10000
  }
}
Setting Description Default
LogName Windows Event Log name Security
ComputerNames Computer names to query (supports multiple AD DCs; use "local" for local machine) [] (local)
IncludeSuccessfulLogons Include event ID 4624 true
IncludeFailedLogons Include event ID 4625 true
IncludeLockouts Include event ID 4740 true
ExcludeMachineAccounts Filter out machine accounts (ending in $) true
ExcludeSystemAccounts Filter out SYSTEM/LOCAL SERVICE true
MaxEventsPerQuery Maximum events to read per query 10000

SurePassID Section

{
  "SurePassID": {
    "Endpoint": "https://mfa.company.com/api/mfa/v1",
    "ApiKeyId": "your-api-key-id",
    "ApiKey": "your-api-key",
    "UseHttpHeader": true,
    "MaxEventsPerRequest": 1000,
    "TimeoutSeconds": 30,
    "RetryCount": 3,
    "RetryDelaySeconds": 2,
    "EnableTracing": false,
    "ProxyAddress": null,
    "IgnoreSyncStatus": true,
    "PreferJsonBulkFormat": true
  }
}
Setting Description Default
Endpoint SurePassID MFA server URL (required)
ApiKeyId API Key ID (Account Login Name) (required)
ApiKey API Key (Account Login Key) (required)
UseHttpHeader Send credentials via HTTP header instead of body true
MaxEventsPerRequest Maximum events per API call 1000
TimeoutSeconds Connection timeout 30
RetryCount Retry attempts for failed requests 3
RetryDelaySeconds Delay between retries 2
EnableTracing Enable debug/trace logging false
ProxyAddress HTTP proxy address (optional) null
IgnoreSyncStatus When true, re-reads all events in the time range regardless of sync state (for compliance reports). When false, only returns events not yet synced (efficient for continuous monitoring). true
PreferJsonBulkFormat When true, requests JSON bulk format from the server, which includes additional fields (Tenant, AuthMethod, SsoIdentity, UserEmail). If the server does not support JSON format, falls back gracefully to legacy piped format with a warning logged. true

#### ActiveDirectory Section

```json
{
  "ActiveDirectory": {
    "Server": "dc01.company.com",
    "BaseDn": "DC=company,DC=com",
    "UseIntegratedAuth": true,
    "Username": null,
    "Password": null,
    "UseSsl": false
  }
}

Environment Variable Overrides

All settings can be set via environment variables:

# Using double underscore separator
export ComplianceService__CronSchedule="0 3 * * *"
export ActiveDirectory__Server="dc02.domain.com"
export SurePassID__Endpoint="https://mfa.company.com/api/mfa/v1"
export SurePassID__ApiKeyId="compliance-api"
export SurePassID__ApiKey="your-secret-key"

Event Sources

JSON File Event Source

For importing events from SIEM exports or other JSON sources:

services.AddJsonFileEventSource(options =>
{
    options.DirectoryPath = "./Events";
    options.FilePattern = "*.json";
    options.Format = JsonEventFormat.JsonFlat;
    options.FieldMappings = new JsonFieldMappings
    {
        EventId = "eventId",
        EventTime = "timestamp",
        Username = "user",
        Result = "status",
        MfaMethod = "authMethod"
    };
});

Syslog Event Source

For Linux/Unix authentication logs:

services.AddSyslogEventSource(options =>
{
    options.Path = "/var/log";
    options.FilePattern = "auth*.log";
    options.Format = SyslogFormat.Rfc5424;
});

Windows Event Log Source

For Windows Security log events:

services.AddWindowsEventLogSource(options =>
{
    options.LogName = "Security";
    options.EventIds = [4624, 4625, 4740];
    options.ExcludeMachineAccounts = true;
});

SurePassID REST API Event Source

For real-time MFA events from SurePassID:

services.AddSurePassIdRestApiEventSource(options =>
{
    options.Endpoint = "https://mfa.company.com/api/mfa/v1";
    options.ApiKeyId = "your-api-key-id";
    options.ApiKey = "your-api-key";
    options.UseHttpHeader = true;
    options.MaxEventsPerRequest = 1000;

    // Server-side date filtering: startDateUtc and endDateUtc are passed to the
    // server automatically from the EventQuery time range, limiting data returned.

    // Sync status control:
    // true  = re-read all events in time range (best for compliance reports)
    // false = only new/unsynced events (best for continuous monitoring)
    options.IgnoreSyncStatus = true;

    // JSON bulk format: richer data including Tenant, AuthMethod, SsoIdentity,
    // and UserEmail fields. Falls back to legacy piped format automatically
    // if the server does not support JSON.
    options.PreferJsonBulkFormat = true;
});

Compliance vs. Monitoring Mode

Setting Compliance / On-Demand Continuous Monitoring
IgnoreSyncStatus true -- Re-read all events in the requested time range to produce complete audit reports false -- Only fetch new events since the last sync, avoiding duplicates and reducing bandwidth
PreferJsonBulkFormat true -- Get the richest data for reports true -- Same benefit; format is negotiated once and cached

Entra ID (Azure AD) Event Source

For Azure AD sign-in logs:

// Via Graph API
services.AddEntraIdGraphEventSource(options =>
{
    options.TenantId = "your-tenant-id";
    options.ClientId = "your-client-id";
    options.ClientSecret = "your-client-secret";
});

// Via JSON export
services.AddEntraIdJsonEventSource(options =>
{
    options.DirectoryPath = "./EntraIdLogs";
    options.FilePattern = "*.json";
    options.Format = EntraIdJsonFormat.AzurePortalExport;
});

Identity Providers

Active Directory Provider

services.AddActiveDirectoryIdentityProvider(options =>
{
    options.Server = "dc01.contoso.com";
    options.BaseDn = "DC=contoso,DC=com";
    options.UseIntegratedAuth = true;
    // Or explicit credentials:
    // options.Username = "svc_compliance@contoso.com";
    // options.Password = "password";
    options.UseSsl = false;
});

SurePassID Identity Provider

Use MFA enrollment status as privilege indicator:

services.AddSurePassIdIdentityProvider(options =>
{
    options.Endpoint = "https://mfa.company.com/api/mfa/v1";
    options.ApiKeyId = "your-api-key-id";
    options.ApiKey = "your-api-key";
    options.PrivilegeStrategy = SurePassIdPrivilegeStrategy.MfaEnrolled;
    options.FlagBypassUsers = true;
});

MFA Coverage Analysis

When both Windows Event Log and SurePassID REST API event sources are enabled, the system performs cross-source MFA coverage analysis. This matches each privileged Windows logon (SFA) to a corresponding SurePassID MFA event, proving MFA enforcement even on machines where the SurePassID MFA component is not installed.

Configuration

Add to your appsettings.json (CLI, Service, or MCP Server):

{
  "MfaCoverage": {
    "Enabled": true,
    "TimeWindowMinutes": 5,
    "RequireIpMatch": false,
    "EnableFindUserLookup": true,
    "PrivilegedUsersOnly": true
  }
}

Username Normalization

Windows Event Log usernames are domain-qualified (CONTOSO\john.doe) while SurePassID usernames have no domain prefix (john.doe). The correlator automatically:

  • Strips domain prefixes (CONTOSO\john.doe ? john.doe)
  • Handles UPN format (john.doe@contoso.com ? john.doe)
  • Calls the SurePassID FindUser API to resolve login name and email when direct matching fails

Output

The compliance summary includes MFA coverage statistics. Events with NoMfaCoverage status indicate privileged Windows logons without a corresponding MFA event � these are compliance gaps that require investigation.


Troubleshooting

Common Issues

Configuration Problems

# Use the wizard to regenerate config
compliance-cli configure

# Test configuration
compliance-cli configure --test

No Events Found

  1. Verify event source path exists
  2. Check file pattern matches files
  3. Verify time range includes events
  4. Enable verbose logging: --verbose

AD Connection Issues

  1. Verify server is reachable: Test-NetConnection dc01 -Port 389
  2. Check credentials/permissions
  3. Try with explicit credentials instead of integrated auth

SurePassID API Issues

  1. Verify endpoint URL is correct
  2. Check API credentials are valid
  3. Enable tracing:
    {
      "SurePassID": {
        "EnableTracing": true
      }
    }
  4. "JSON format not supported" warning: Your MFA server is returning legacy piped format instead of JSON. Events are still processed correctly, but you may be missing some fields (Tenant, AuthMethod, SsoIdentity, UserEmail). Upgrade your SurePassID MFA server for full JSON support, or set "PreferJsonBulkFormat": false to suppress the warning.
  5. Duplicate events in monitoring: If continuous monitoring is processing the same events repeatedly, set "IgnoreSyncStatus": false in the monitoring configuration so the server only returns new events since the last sync.

Debug Logging

// Enable debug logging
services.AddLogging(builder =>
{
    builder.SetMinimumLevel(LogLevel.Debug);
    builder.AddConsole();
    builder.AddFilter("SurePassID.Compliance", LogLevel.Debug);
});

API Reference

Core Interfaces

IComplianceRunner

public interface IComplianceRunner
{
    Task<ComplianceRunResult> RunAsync(
        ComplianceRunRequest request,
        CancellationToken cancellationToken = default);
}

IAuthEventSource

public interface IAuthEventSource
{
    string SourceName { get; }
    
    Task<IReadOnlyList<AuthEvent>> FetchAsync(
        EventQuery query,
        CancellationToken cancellationToken = default);
    
    Task<bool> TestConnectivityAsync(
        CancellationToken cancellationToken = default);
}

IIdentityProvider

public interface IIdentityProvider
{
    string ProviderName { get; }
    
    Task<IReadOnlyList<IdentityRecord>> GetUsersAsync(
        IdentityQuery query,
        CancellationToken cancellationToken = default);
    
    Task<IReadOnlyList<PrivilegeSnapshot>> GetPrivilegeSnapshotAsync(
        PrivilegeQuery query,
        CancellationToken cancellationToken = default);
}

Models

AuthFactorClassification

public enum AuthFactorClassification
{
    Unknown = 0,
    Sfa = 1,  // Single-factor
    Mfa = 2   // Multi-factor
}

MfaMethod

public enum MfaMethod
{
    Unknown = 0,
    Otp = 1,           // TOTP/HOTP authenticator codes
    Push = 2,          // Push notification (Authenticator app)
    Sms = 3,           // SMS one-time code
    Email = 4,         // Email one-time code
    Fido2 = 5,         // FIDO2/WebAuthn/Passkey
    Voice = 6,         // Voice call verification
    Biometric = 7,     // Biometric (Windows Hello, fingerprint)
    HardwareToken = 8  // Hardware OATH token/FOB
}

For Support

For additional support:

  • Documentation: See docs/ folder for detailed guides
  • Quick Start: See docs/QuickStartScenarios.md for copy-paste examples
  • Issues: Report issues on GitHub
  • Email: support@surepassid.com

Version History

Version Date Changes
1.5.0 July 2026 Report output formats now driven by the ReportFormats configuration section
1.4.0 May 2025 SurePassID REST API: server-side date filtering (startDateUtc/endDateUtc), sync status control (IgnoreSyncStatus), JSON bulk format with automatic piped-format fallback (PreferJsonBulkFormat); Optimized continuous monitoring to fetch only new events
1.3.0 January 2025 Added interactive configuration wizard (compliance-cli configure); PowerShell setup script; Template configuration files; 225 tests
1.2.0 January 2025 Added Entra ID (Azure AD) event source with Graph API and JSON import support; Enhanced test coverage with 197 tests; Improved syslog parsing
1.1.0 December 2024 Added SurePassID REST API event source; CMMC 2.0 and HIPAA compliance mapping
1.0.0 November 2024 Initial release with JSON, Syslog, and Windows Event Log sources
SurePassID 360 Central Avenue #800 St. Petersburg, FL 33701 USA +1 (888) 200-8144 surepassid.com