CerbiStream.GovernanceAnalyzer 1.1.32

There is a newer version of this package available.
See the version list below for details.
dotnet add package CerbiStream.GovernanceAnalyzer --version 1.1.32
                    
NuGet\Install-Package CerbiStream.GovernanceAnalyzer -Version 1.1.32
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CerbiStream.GovernanceAnalyzer" Version="1.1.32" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CerbiStream.GovernanceAnalyzer" Version="1.1.32" />
                    
Directory.Packages.props
<PackageReference Include="CerbiStream.GovernanceAnalyzer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CerbiStream.GovernanceAnalyzer --version 1.1.32
                    
#r "nuget: CerbiStream.GovernanceAnalyzer, 1.1.32"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CerbiStream.GovernanceAnalyzer@1.1.32
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CerbiStream.GovernanceAnalyzer&version=1.1.32
                    
Install as a Cake Addin
#tool nuget:?package=CerbiStream.GovernanceAnalyzer&version=1.1.32
                    
Install as a Cake Tool

CerbiStream Governance Analyzer


πŸ›‘οΈ What is CerbiStream Governance Analyzer?

A high-performance Roslyn analyzer that enforces your organization’s structured-logging governance rules at build-time – before code reaches production. It supports customizable config files, flexible placement, and actionable diagnostics.

  • Prevents PII leakage and missing telemetry fields
  • Guarantees encryption settings for sensitive profiles
  • Emits build errors with clear CERBI-IDs your CI pipeline can fail on

Zero code changes required. Add the NuGet package, define a governance profile, and compile.


🧐 For Stakeholders

Cerbi helps your teams log securely, consistently, and in compliance with privacy laws.

Concern Cerbi Helps By...
Security Blocking logs with PII/PHI or insecure data
Compliance (HIPAA/GDPR) Enforcing encryption and structure for audit-readiness
Developer productivity Catching errors early so bugs don’t ship or waste debugging time
Incident response Making logs consistent, complete, and searchable during outages
CI/CD Integrity Preventing risky changes from merging via automated checks

Cerbi is a seatbelt for your logs: invisible until something goes wrong β€” and essential when it does.


πŸš€ Quick-start

# Add to your project
$ dotnet add package CerbiStream.GovernanceAnalyzer

πŸ“‚ Define Your Governance File

Create a profile (e.g. Configs/my_profile.json):

{
  "EnforcementMode": "Strict",
  "LoggingProfiles": {
    "default": {
      "RequireTopic": true,
      "AllowedTopics": ["Auth", "Payments"],
      "FieldSeverities": {
        "userId": "Required",
        "password": "Forbidden"
      },
      "EncryptionSettings": {
        "Mode": "AES",
        "FieldSeverity": "Required"
      },
      "AllowRelax": true
    }
  }
}

Then tell the analyzer where to find it:

πŸ” Declare Config File in Your App

[assembly: Cerbi.Governance.CerbiGovernanceConfig("Configs/my_profile.json")]

βœ… Place this at the top of any .cs file (before the namespace) or in Properties/AssemblyInfo.cs

The analyzer will automatically find and load the file relative to the source path.


πŸ“„ Real-world Examples

// Works with plain structured logs
logger.LogInformation(new {
  Topic = "Auth",
  userId = "user-123"
});
// Works with [CerbiTopic] at the class level
[CerbiTopic("Payments")]
public class PaymentService
{
  public void Charge()
  {
    _logger.LogInformation(new { userId }); // Topic = "Payments"
  }
}
// Triggers governance error: missing 'email'
logger.LogInformation(new {
  userId = "abc-123"
});
// Developer bypass with Relaxation flag (analyzer sees this)
logger.LogInformation(new Dictionary<string, object> {
  ["Topic"] = "Payments",
  ["GovernanceRelaxed"] = true,
  ["userId"] = "abc-123"
});

✨ Relaxation works only if the profile allows it via "AllowRelax": true.


πŸ—‚οΈ Diagnostics

ID Description Severity
CERBI000 Governance relaxed (allowed) Info
CERBI001 Required field missing Error
CERBI002 Forbidden field present Error
CERBI007 Relaxation not allowed Error
CERBI020 Unknown topic Error
CERBI021 Topic missing Error

πŸ›€ Config Path Options

Location Works? Recommended
Properties/AssemblyInfo.cs βœ… βœ… βœ… βœ…
Top of Program.cs βœ… βœ…
Any .cs file (before namespace) βœ… πŸ‘Œ Optional
[assembly: Cerbi.Governance.CerbiGovernanceConfig("Configs/gdpr-profile.json")]

The path is relative to the file being analyzed, not to the build output.


πŸ—±οΈ Multi-Profile Support

Multiple profiles are supported. Each log statement is matched to a governance profile using its Topic field (or [CerbiTopic("...")] if the topic is declared at the class level). The analyzer enforces rules from the matched profile accordingly.


πŸ‘ Plugin & Reload Support

  • Live reloading via file watcher
  • Runtime validation supported via GovernanceHelper.TryValidate(...)
  • Plugin hooks available via ICustomGovernancePlugin

🚧 Phase 2: Coming Soon

  • Governance scoring
  • IDE integration (log field hints)
  • CI dashboards for governance health

⛔️ Limitations

  • ❌ Build-time analyzers require the JSON config to be local. Remote configs (e.g., Blob Storage, GitHub) are not supported during compilation.
  • βœ… Runtime validation (via CerbiStream) can support local or remote config loading (e.g., Azure Blob, GitHub URLs).
  • Analyzer supports one config file per project (resolved via [assembly: CerbiGovernanceConfig(...)])
  • Analyzer uses file-based JSON only β€” no centralized store (yet)

πŸ“ Package Info

Package Source
CerbiStream.GovernanceAnalyzer NuGet
CerbiStream NuGet

πŸ“’ Support & Contact

Secure β€’ Structured β€’ Compliant

CerbiStream Governance Analyzer β€” Β© Cerbi LLC 2025

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.34 159 5/18/2025
1.1.33 119 5/18/2025
1.1.32 107 5/17/2025
1.1.31 124 5/17/2025
1.1.30 228 5/15/2025
1.1.29 234 5/15/2025
1.1.28 225 5/15/2025
1.1.27 226 5/15/2025
1.1.25 231 5/15/2025
1.1.24 239 5/13/2025
1.1.23 223 5/13/2025
1.1.22 224 5/13/2025
1.1.21 287 5/12/2025
1.1.10 159 4/29/2025
1.1.9 158 4/29/2025
1.1.8 164 4/24/2025
1.1.7 151 4/24/2025
1.1.6 159 4/24/2025
1.1.5 168 4/24/2025
1.1.4 91 4/19/2025
1.1.0 181 4/18/2025
1.0.5 132 3/28/2025
1.0.4 474 3/26/2025
1.0.3 168 3/23/2025
1.0.2 156 3/20/2025
1.0.1 219 3/19/2025
1.0.0 159 3/19/2025