Cerbi.Governance.Runtime
1.1.2
See the version list below for details.
dotnet add package Cerbi.Governance.Runtime --version 1.1.2
NuGet\Install-Package Cerbi.Governance.Runtime -Version 1.1.2
<PackageReference Include="Cerbi.Governance.Runtime" Version="1.1.2" />
<PackageVersion Include="Cerbi.Governance.Runtime" Version="1.1.2" />
<PackageReference Include="Cerbi.Governance.Runtime" />
paket add Cerbi.Governance.Runtime --version 1.1.2
#r "nuget: Cerbi.Governance.Runtime, 1.1.2"
#:package Cerbi.Governance.Runtime@1.1.2
#addin nuget:?package=Cerbi.Governance.Runtime&version=1.1.2
#tool nuget:?package=Cerbi.Governance.Runtime&version=1.1.2
Cerbi.Governance.Runtime
🛡️ Real-time Governance Enforcement for Structured Logging
Cerbi.Governance.Runtime enables runtime validation of log messages against Cerbi governance profiles. It ensures your logs adhere to required and forbidden field policies, validates types, supports [CerbiTopic] inference, and enriches metadata for downstream audit and ML pipelines.
✅ Key Features
- Validates fields by severity:
Required,Forbidden,Info - Enforces type constraints (
string,int,bool, etc.) - Supports enumerated value enforcement (e.g.,
Status = Approved | Rejected) - Detects
[CerbiTopic]from method/class scope - Honors
GovernanceRelaxed = trueoverride with proper tagging - Tags every log with enforcement metadata:
GovernanceProfileUsedGovernanceViolationsGovernanceEnforcedGovernanceMode
- Supports hot-reloading from JSON configuration
📦 Installation
dotnet add package Cerbi.Governance.Runtime
Also see:
🧩 Governance JSON Example
{
"EnforcementMode": "Strict",
"LoggingProfiles": {
"Orders": {
"RequireTopic": true,
"AllowedTopics": ["Orders", "Users"],
"FieldSeverities": {
"userId": "Required",
"email": "Required",
"password": "Forbidden"
},
"FieldTypes": {
"userId": "string",
"email": "string"
},
"FieldEnums": {
"Status": ["Pending", "Approved", "Rejected"]
},
"AllowRelax": true
}
}
}
🚀 Usage
With Manual Validation:
var validator = new RuntimeGovernanceValidator(
isEnabled: () => true,
profileName: "Orders",
source: new FileGovernanceSource("cerbi_governance.json")
);
var log = new Dictionary<string, object>
{
["userId"] = "abc123",
["email"] = "invalid@example.com",
["Status"] = "Failed"
};
validator.ValidateInPlace(log); // Tags log with violations and metadata
With ILogger Extensions:
logger.LogInformation(validator, "Processing order", Guid.NewGuid().ToString());
🔄 Environment Metadata Support
The following environment variables are optionally read for ILogger extension tagging:
CERBI_APP_ID→ overridesApplicationIdCERBI_REGION→ overridesRegionCERBI_CLOUD→ overridesCloudProvider
Fallbacks include:
MachineNameforInstanceId- Default literals (
"Unknown") if unset
🔌 Extending the Source
Use IRuntimeGovernanceSource to support custom loading strategies:
public interface IRuntimeGovernanceSource
{
CerbiGovernance? Load();
DateTime GetLastUpdatedUtc();
}
Provided:
FileGovernanceSource(reloads when modified)
Future support planned:
- Azure Blob, GitHub raw JSON, GCS, S3
🔒 Relaxation Mode
Set GovernanceRelaxed = true in log data to bypass enforcement. Log will still be tagged as relaxed for audit:
{
"GovernanceRelaxed": true,
"GovernanceEnforced": false,
"GovernanceProfileUsed": "Orders",
"GovernanceMode": "Strict"
}
📄 License
MIT
This package is part of the Cerbi Suite – enabling governed, observable, and secure logging from the source.
Contact: hello@cerbi.io
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Cerbi.Governance.Core (>= 1.0.2)
- Microsoft.Extensions.Logging (>= 9.0.5)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Cerbi.Governance.Runtime:
| Package | Downloads |
|---|---|
|
CerbiStream
CerbiStream.Logging - Secure, Scalable, and Standardized Logging for Modern Applications. |
|
|
Cerbi.MEL.Governance
Real-time governance enforcement for Microsoft.Extensions.Logging (MEL) using the Cerbi validation engine. |
|
|
Cerbi.Serilog.GovernanceAnalyzer
Serilog governance analyzer plugin: runtime validation, filtering, enrichment, live reload, correlation, relaxed diagnostics, and high-throughput score shipping with ArrayPool optimizations. Supports .NET 9.0+ |
|
|
Cerbi.Serilog.Governance
Serilog plugin that enforces Cerbi governance at runtime. Provides filtering to block non-compliant logs and enrichment to tag governance metadata. |
GitHub repositories
This package is not used by any popular GitHub repositories.