Cerbi.Governance.Runtime
1.1.1
dotnet add package Cerbi.Governance.Runtime --version 1.1.1
NuGet\Install-Package Cerbi.Governance.Runtime -Version 1.1.1
<PackageReference Include="Cerbi.Governance.Runtime" Version="1.1.1" />
<PackageVersion Include="Cerbi.Governance.Runtime" Version="1.1.1" />
<PackageReference Include="Cerbi.Governance.Runtime" />
paket add Cerbi.Governance.Runtime --version 1.1.1
#r "nuget: Cerbi.Governance.Runtime, 1.1.1"
#addin nuget:?package=Cerbi.Governance.Runtime&version=1.1.1
#tool nuget:?package=Cerbi.Governance.Runtime&version=1.1.1
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 = true
override with proper tagging - Tags every log with enforcement metadata:
GovernanceProfileUsed
GovernanceViolations
GovernanceEnforced
GovernanceMode
- 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
→ overridesApplicationId
CERBI_REGION
→ overridesRegion
CERBI_CLOUD
→ overridesCloudProvider
Fallbacks include:
MachineName
forInstanceId
- 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.1)
- Microsoft.Extensions.Logging (>= 9.0.5)
NuGet packages (3)
Showing the top 3 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
Roslyn analyzer that enforces structured logging governance for Serilog-based CerbiStream apps. Prevents forbidden fields, ensures required fields, and enables enterprise-grade compliance enforcement. |
GitHub repositories
This package is not used by any popular GitHub repositories.