FalcoSecurity.Plugin.Sdk 0.1.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package FalcoSecurity.Plugin.Sdk --version 0.1.3
NuGet\Install-Package FalcoSecurity.Plugin.Sdk -Version 0.1.3
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="FalcoSecurity.Plugin.Sdk" Version="0.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FalcoSecurity.Plugin.Sdk --version 0.1.3
#r "nuget: FalcoSecurity.Plugin.Sdk, 0.1.3"
#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.
// Install FalcoSecurity.Plugin.Sdk as a Cake Addin
#addin nuget:?package=FalcoSecurity.Plugin.Sdk&version=0.1.3

// Install FalcoSecurity.Plugin.Sdk as a Cake Tool
#tool nuget:?package=FalcoSecurity.Plugin.Sdk&version=0.1.3

FalcoSecurity.Plugin.Sdk

Custom badge

Unofficial Falco plugin SDK for .NET, powered by DNNE native exports

NuGet packages

desc
FalcoSecurity.Plugin.Sdk alternate text is missing from this package README image Core Plugin SDK types
FalcoSecurity.Plugin.Sdk.Generators alternate text is missing from this package README image Source generators for native exports
FalcoSecurity.Plugin.Sdk.Template alternate text is missing from this package README image Project template dotnet new falcoplugin

Dummy plugin sneak-peek

[FalcoPlugin(
    Id = 999,
    Name = "dummy_plugin",
    Description = "A dummy plugin",
    Contacts = "mvenditto",
    RequiredApiVersion = "2.0.0",
    Version = "1.0.0")]
public class Plugin: PluginBase, IEventSource, IFieldExtractor {
    public string EventSourceName => "dummy_source";

    public IEnumerable<string> EventSourcesToExtract 
        => Enumerable.Empty<string>(); // only consume ourselves event-source

    public IEnumerable<OpenParam> OpenParameters => 
        => Enumerable.Empty<string>(); // no specific open-params

    public IEnumerable<ExtractionField> Fields => new List<ExtractionField> {
        new(type: "uint64",
            name: "dummy.counter",
            display: "Counter value",
            desc: "Current value of the internal counter")
    };

    public IEventSourceInstance Open(IEnumerable<OpenParam> ? openParams) {
        return new CounterInstance();
    }
    
    public void Close(IEventSourceInstance instance) {
        instance.Dispose();
    }

    public void Extract(IExtractionRequest extraction, IEventReader evt) {
        var counter = BitConverter.ToInt32(evt.Data);
        extraction.SetValue((ulong) counter);
    }
}

public class CounterInstance: PullEventSourceInstance {
    public int Counter {get; set;}

    public CounterInstance(): base(batchSize: 10, eventSize: 8) {
        Counter = 1;
    }

    protected override void PullEvent(EventSourceInstanceContext ctx, IEventWriter evt) {
        var unixNano = (ulong) DateTimeOffset.Now.ToUnixTimeSeconds() * 1000000000;

        evt.Write(BitConverter.GetBytes(Counter));

        evt.SetTimestamp(unixNano);

        if (Counter >= 50) {
            ctx.IsEof = true;
        }

        Counter += 1;
    }
}

Note

This sdk is Unofficial and is not associated nor endorsed by Sysdig and falcosecurity/falco

Product Compatible and additional computed target framework versions.
.NET 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. 
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.4.1 329 11/19/2022
0.1.3 355 11/11/2022