TortisDev.Ocsf 0.1.0-preview.12

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

Tortis OCSF

Build Status

Known Vulnerabilities

A C#/.Net implementation of the Open Cybersecurity Schema Framework (OCSF) for creating security events in .Net applications for export to a SIEM.

User Access Management Events Example

// Create a user access management event for assigning privileges
var user = new User 
{
    Uid = "john.doe",
    Name = "John Doe",
    Domain = "example.com"
};

var resources = new[] 
{
    new Resource 
    { 
        Name = "financial-reports",
        Type = "folder"
    }
};

var userAccessEvent = new UserAccessManagementEvent(user, UserAccessManagementEvent.Activity.AssignPrivileges)
{
    Resources = resources,
    Privileges = new[] { "read", "write" }
};

// Publishing the event to Kafka
using var producer = new ProducerBuilder<string, string>(producerConfig).Build();
var jsonString = JsonSerializer.Serialize(userAccessEvent, new JsonSerializerOptions 
{ 
    WriteIndented = true 
});

await producer.ProduceAsync("user-access-events", new Message<string, string> 
{ 
    Key = user.UserId,
    Value = jsonString 
});

This example demonstrates creating an event that logs when a user is granted read and write privileges to a specific resource and publishing the event to a Kafka topic using the Confluent.Kafka client.

Validation

It is recommended to validate the event before publishing.

IEnumerable<ValidationResult> results = userAccessEvent.Validate();

bool isValid = !results.Any();
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 is compatible.  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 Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 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
0.1.0-preview.12 116 6/15/2025
0.1.0-preview.11 116 6/15/2025