Falco.Plugin.Sdk 1.0.3

Suggested Alternatives

FalcoSecurity.Plugin.Sdk

dotnet add package Falco.Plugin.Sdk --version 1.0.3
NuGet\Install-Package Falco.Plugin.Sdk -Version 1.0.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="Falco.Plugin.Sdk" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Falco.Plugin.Sdk --version 1.0.3
#r "nuget: Falco.Plugin.Sdk, 1.0.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 Falco.Plugin.Sdk as a Cake Addin
#addin nuget:?package=Falco.Plugin.Sdk&version=1.0.3

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

Falco.Plugin.Sdk

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

✨ Early development stage alert

Wiki 📖

For a full example and addition information on how this works, check out the Wiki!

NuGet packages

Package Latest version Optional Notes
Falco.Plugin.Sdk alternate text is missing from this package README image Core Plugin SDK types
Falco.Plugin.Sdk.Generators alternate text is missing from this package README image Source generators for native exports
Falco.Plugin.Sdk.Template alternate text is missing from this package README image X 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
1.0.3 416 11/7/2022