CerbiStream.GovernanceAnalyzer
1.1.9
See the version list below for details.
dotnet add package CerbiStream.GovernanceAnalyzer --version 1.1.9
NuGet\Install-Package CerbiStream.GovernanceAnalyzer -Version 1.1.9
<PackageReference Include="CerbiStream.GovernanceAnalyzer" Version="1.1.9" />
<PackageVersion Include="CerbiStream.GovernanceAnalyzer" Version="1.1.9" />
<PackageReference Include="CerbiStream.GovernanceAnalyzer" />
paket add CerbiStream.GovernanceAnalyzer --version 1.1.9
#r "nuget: CerbiStream.GovernanceAnalyzer, 1.1.9"
#addin nuget:?package=CerbiStream.GovernanceAnalyzer&version=1.1.9
#tool nuget:?package=CerbiStream.GovernanceAnalyzer&version=1.1.9
CerbiStream Governance Analyzer
π‘οΈ CerbiStream Governance Analyzer
CerbiStream-GovernanceAnalyzer is a high-performance, plugin-extensible governance engine for structured logging in .NET. It enables both runtime enforcement and compile-time analysis (via Roslyn Analyzer) to ensure logging consistency, security, and observability compliance.
β Whatβs New?
- π Live Reloading of JSON governance configs
- π§ Plugin Architecture β inject dynamic validation rules (per environment, compliance, etc.)
- π’ Per-field Type & Enum Enforcement (Roslyn-only)
- β DisallowedFields Support (Roslyn-only)
- π Governance Modes: Permissive, WarnOnly, Strict
- π Impact Scoring for governance violations (coming soon)
- π Roslyn Analyzer to catch issues at build-time
π¦ Installation
dotnet add package CerbiStream.GovernanceAnalyzer
π₯ Why Use CerbiStream-GovernanceAnalyzer?
- Compile-Time Log Validation β Prevents misformatted logs before deployment.
- Structured Logging Enforcement β Ensures consistent log structures across teams.
- Customizable Rules via JSON β Allows organizations to define mandatory fields for logs.
- Seamless Integration with CerbiStream β Works alongside CerbiStream for log governance.
- Lightweight & Fast β Runs at build time, avoiding runtime performance impact.
π How It Works
1. Governance via JSON Profiles
- Runtime only enforces EncryptionSettings (e.g., AES, Base64).
- Compile-time (Roslyn) enforcement includes:
- Required / Forbidden fields
- Field types and enums
- Encryption validation
2. Build-Time Roslyn Enforcement
Validates log usage against governance profile during compilation.
// Valid log
logger.LogInformation("User login successful | UserId: {UserId}", userId);
// Invalid log (missing required UserId)
logger.LogInformation("User login successful"); // β Build fails
3. Runtime Use (Optional)
var isValid = GovernanceHelper.TryValidate("PIILog", logData, out var errors);
if (!isValid)
{
Console.WriteLine("Governance violations:");
errors.ForEach(Console.WriteLine);
}
π§ Runtime Enforcement Summary
Rule Type | Enforced at Runtime | Enforced by Roslyn |
---|---|---|
Encryption Mode | β Yes | β Yes |
Required Fields | β No | β Yes |
Forbidden Fields | β No | β Yes |
FieldTypes (e.g., Guid) | β No | β Yes |
FieldEnums | β No | β Yes |
π Config Format (Simplified)
{
"EnforcementMode": "Strict",
"LoggingProfiles": {
"PIILog": {
"AllowedLevels": ["Information", "Error"],
"FieldSeverities": {
"userId": "Required",
"ssn": "Forbidden"
},
"FieldTypes": {
"userId": "Guid"
},
"EncryptionSettings": {
"Mode": "AES",
"FieldSeverity": "Required"
}
}
}
}
ποΈ Plugin Support
public class TeamIdPlugin : ICustomGovernancePlugin
{
public bool Validate(string profile, Dictionary<string, object> logData, out List<string> failures, out int impactScore)
{
failures = new();
impactScore = 0;
if (logData.TryGetValue("Environment", out var env) &&
env?.ToString() == "Production" &&
!logData.ContainsKey("TeamId"))
{
failures.Add("MissingField: TeamId is required in Production");
impactScore = 5;
return false;
}
return true;
}
}
π§ Governance Analyzer Goals
Feature | Status |
---|---|
Compile-time enforcement | β Done |
Runtime encryption check | β Done |
Plugin engine | β Done |
Governance score output | π§ Coming soon |
ποΈ Roadmap
- π Roslyn-based preview tooling
- π CerbIQ impact scoring dashboard integration
- π Governance metrics via CerbiShield
- π§ Plugin SDK + CI integrations
β οΈ Known Limitations
Area | Detail |
---|---|
Roslyn Type Inference | Roslyn cannot validate runtime conversions (e.g., string β Guid). Explicit typing recommended. |
Runtime Validation | Full runtime validation (including parsing and type checking) matches governance JSON expectations. |
Build-Time Failures | Static analysis errs on the side of caution to prefer strict failures over runtime surprises. |
Note: This strictness ensures enterprise-grade logging and compliance.
π’ License & Contact
- License: MIT
- NuGet Packages:
- Website: cerbi.systems
- Contact: hello@cerbi.io
Secure. Structured. Compliant.
CerbiStream Governance Analyzer β By Cerbi LLC
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. |
-
net8.0
- Microsoft.CodeAnalysis.CSharp (>= 4.13.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.10 | 129 | 4/29/2025 |
1.1.9 | 129 | 4/29/2025 |
1.1.8 | 141 | 4/24/2025 |
1.1.7 | 131 | 4/24/2025 |
1.1.6 | 133 | 4/24/2025 |
1.1.5 | 139 | 4/24/2025 |
1.1.4 | 73 | 4/19/2025 |
1.1.0 | 160 | 4/18/2025 |
1.0.5 | 117 | 3/28/2025 |
1.0.4 | 457 | 3/26/2025 |
1.0.3 | 148 | 3/23/2025 |
1.0.2 | 139 | 3/20/2025 |
1.0.1 | 195 | 3/19/2025 |
1.0.0 | 139 | 3/19/2025 |