Table of Contents

Interface ISoc2ComplianceService

Namespace
Excalibur.Compliance
Assembly
Excalibur.Compliance.Abstractions.dll

Service for SOC 2 compliance management and reporting.

public interface ISoc2ComplianceService

Remarks

Core compliance operations. For audit export operations, use GetService(Type) with typeof(ISoc2AuditExporter).

ISP Split: ExportForAuditorAsync moved to ISoc2AuditExporter to keep the core interface at or below 5 methods.

Methods

GenerateTypeIIReportAsync(DateTimeOffset, DateTimeOffset, ReportOptions, CancellationToken)

Generates a SOC 2 Type II report (period assessment).

Task<Soc2Report> GenerateTypeIIReportAsync(DateTimeOffset periodStart, DateTimeOffset periodEnd, ReportOptions options, CancellationToken cancellationToken)

Parameters

periodStart DateTimeOffset

The start of the assessment period.

periodEnd DateTimeOffset

The end of the assessment period.

options ReportOptions

Report generation options.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<Soc2Report>

The generated Type II report.

GenerateTypeIReportAsync(DateTimeOffset, ReportOptions, CancellationToken)

Generates a SOC 2 Type I report (point-in-time assessment).

Task<Soc2Report> GenerateTypeIReportAsync(DateTimeOffset asOfDate, ReportOptions options, CancellationToken cancellationToken)

Parameters

asOfDate DateTimeOffset

The point-in-time date for the assessment.

options ReportOptions

Report generation options.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<Soc2Report>

The generated Type I report.

GetComplianceStatusAsync(string?, CancellationToken)

Gets the current compliance status for all Trust Services Criteria.

Task<ComplianceStatus> GetComplianceStatusAsync(string? tenantId, CancellationToken cancellationToken)

Parameters

tenantId string

Optional tenant filter.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<ComplianceStatus>

The current compliance status.

GetEvidenceAsync(TrustServicesCriterion, DateTimeOffset, DateTimeOffset, CancellationToken)

Gets audit evidence for a specific criterion and period.

Task<AuditEvidence> GetEvidenceAsync(TrustServicesCriterion criterion, DateTimeOffset periodStart, DateTimeOffset periodEnd, CancellationToken cancellationToken)

Parameters

criterion TrustServicesCriterion

The criterion to get evidence for.

periodStart DateTimeOffset

The start of the evidence period.

periodEnd DateTimeOffset

The end of the evidence period.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<AuditEvidence>

The audit evidence for the criterion over the period.

Exceptions

NotSupportedException

The implementation has no evidence store to draw on. Collecting and retaining SOC 2 evidence is the deploying organisation's responsibility; an implementation that does not gather it must throw rather than return an empty result, because an empty AuditEvidence is indistinguishable from a period in which nothing happened, and an auditor cannot tell the two apart.

GetService(Type)

Gets a sub-interface or service from this provider.

object? GetService(Type serviceType)

Parameters

serviceType Type

The type of service to retrieve (e.g., typeof(ISoc2AuditExporter)).

Returns

object

The service instance, or null if not supported.

ValidateCriterionAsync(TrustServicesCriterion, CancellationToken)

Validates every control that the specified criterion covers.

Task<IReadOnlyList<ControlValidationResult>> ValidateCriterionAsync(TrustServicesCriterion criterion, CancellationToken cancellationToken)

Parameters

criterion TrustServicesCriterion

The criterion whose controls are validated.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<IReadOnlyList<ControlValidationResult>>

One result per control the criterion covers. The list is empty when the criterion has no registered controls, which reports an assessment that did not run rather than one that failed.