Audit.NET.ImmuDB 30.0.2

dotnet add package Audit.NET.ImmuDB --version 30.0.2
                    
NuGet\Install-Package Audit.NET.ImmuDB -Version 30.0.2
                    
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="Audit.NET.ImmuDB" Version="30.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Audit.NET.ImmuDB" Version="30.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Audit.NET.ImmuDB" />
                    
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 Audit.NET.ImmuDB --version 30.0.2
                    
#r "nuget: Audit.NET.ImmuDB, 30.0.2"
                    
#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 Audit.NET.ImmuDB@30.0.2
                    
#: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=Audit.NET.ImmuDB&version=30.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Audit.NET.ImmuDB&version=30.0.2
                    
Install as a Cake Tool

Audit.NET.ImmuDB

ImmuDB provider for Audit.NET

Store audit events in an ImmuDB database.

ImmuDB is an immutable, tamper-evident database ideal for audit trails and compliance.

See the ImmuDB documentation for more details.

Install

NuGet Package

PM> Install-Package Audit.NET.ImmuDB

NuGet Status NuGet Count

Usage

Please see the Audit.NET Readme

Configuration

Set the static Audit.Core.Configuration.DataProvider property to set the Immu DB data provider, or call the UseImmuDb method on the fluent configuration. This should be done before any AuditScope creation, i.e. during application startup.

For example:

Audit.Core.Configuration.DataProvider = new ImmuDbDataProvider()
{
    ClientBuilderAction = b => b
        .WithServerUrl("localhost")
        .WithServerPort(3322)
        .WithDatabase("db")
        .WithCredentials("admin", "password"),
    UseVerifiedMethods = true,
    KeySelector = _ => Guid.NewGuid().ToByteArray()
};

Or by using the fluent configuration API:

Audit.Core.Configuration.Setup()
    .UseImmuDb(config => config
        .ClientBuilder(b => b
            .WithServerUrl("localhost")
            .WithServerPort(3322)
            .WithDatabase("db")
            .WithCredentials("admin", "password"))
        .UseVerifiedMethods()
        .KeySelector(_ => Guid.NewGuid().ToByteArray()));

You can also configure the provider to use different database and credentials based on an audit event criteria. For example:

Audit.Core.Configuration.Setup()
    .UseImmuDb(config => config
        .ClientBuilder(b => b
            .WithServerUrl("localhost")
            .WithServerPort(3322))
        .Database(auditEvent => auditEvent.EventType == "Http" ? "db1" : "db2")
        .Username(auditEvent => auditEvent.EventType == "Http" ? "user1" : "user2")
        .Password(auditEvent => auditEvent.EventType == "Http" ? "password1" : "password2")
        .UseVerifiedMethods()
        .KeySelector(_ => Guid.NewGuid().ToByteArray()));

The key used to store the audit event in the ImmuDB database is generated by the KeySelector function. If not specified, a random Guid is used.

The value stored in the ImmuDB database is generated by the ValueSelector function. If not specified, the serialized audit event in UTF8 JSON format is used.

You can customize the value stored by providing a ValueSelector function that extracts the desired data from the audit event.

For example:

Audit.Core.Configuration.Setup()
    .UseImmuDb(config => config
        .ClientBuilder(b => b
            .WithServerUrl("localhost")
            .WithServerPort(3322)
            .WithDatabase("db")
            .WithCredentials("admin", "password"))
        .ValueSelector(auditEvent => $"{auditEvent.StartDate}: {auditEvent.EventType}"));

Provider options

  • ClientBuilder: A function to create the ImmuDB client. If not set, a client with the default settings will be used.
  • DatabaseName: The name of the database to use when connecting to the ImmuDB server. If not specified, the value defined in the client builder is used, which defaults to "defaultdb".
  • Username: The username to use when connecting to the ImmuDB server. If not specified, the value defined in the client builder is used, which defaults to "immudb".
  • Password: The password to use when connecting to the ImmuDB server. If not specified, the value defined in the client builder is used, which defaults to "immudb".
  • KeySelector: A function to select the key for the audit event. If not specified, the default key selector is used, which generates a unique key based on the event's ID.
  • ValueSelector: A function to select the value to store from the audit event. If not specified, the default value selector is used, which serializes the event to UTF8 JSON format.
  • UseVerifiedMethods: A boolean indicating whether to use verified methods for writing events. If set to true, uses verified writes for tamper-evidence. Default is false
  • ExpirationTimeout: An optional expiration timeout for the audit events. If set, the events will be automatically deleted after the specified time. The value is a TimeSpan representing the duration after which the event should expire. If not set, events will not expire.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
30.0.2 146 6/26/2025
30.0.1 144 5/29/2025