<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>The Wombelix Post - FluentBit</title><link href="https://dominik.wombacher.cc/" rel="alternate"/><link href="/feeds/tag_fluentbit.atom.xml" rel="self"/><id>https://dominik.wombacher.cc/</id><updated>2024-11-12T00:00:00+01:00</updated><entry><title>Fluent Bit: Output Plugin for AWS CloudTrail Data Service</title><link href="https://dominik.wombacher.cc/posts/fluent-bit-output-plugin-for-aws-cloudtrail-data-service.html" rel="alternate"/><published>2024-11-12T00:00:00+01:00</published><updated>2024-11-12T00:00:00+01:00</updated><author><name>Dominik Wombacher</name></author><id>tag:dominik.wombacher.cc,2024-11-12:/posts/fluent-bit-output-plugin-for-aws-cloudtrail-data-service.html</id><summary type="html">&lt;!-- SPDX-FileCopyrightText: 2024 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;I recently wrote a &lt;a class="reference external" href="https://git.sr.ht/~wombelix/fluent-bit-output-plugin-aws-cloudtrail-data"&gt;AWS CloudTrail Data Service output plugin&lt;/a&gt;
(Mirror: &lt;a class="reference external" href="https://github.com/wombelix/fluent-bit-output-plugin-aws-cloudtrail-data"&gt;[1]&lt;/a&gt;,
&lt;a class="reference external" href="https://gitlab.com/wombelix/fluent-bit-output-plugin-aws-cloudtrail-data"&gt;[2]&lt;/a&gt;,
&lt;a class="reference external" href="https://codeberg.org/wombelix/fluent-bit-output-plugin-aws-cloudtrail-data"&gt;[3]&lt;/a&gt;)
in Golang for &lt;a class="reference external" href="https://fluentbit.io/"&gt;Fluent Bit&lt;/a&gt;. It's Open Source under the Apache-2.0 license.
The plugin ingest  ... &lt;a class="read-more" href="/posts/fluent-bit-output-plugin-for-aws-cloudtrail-data-service.html"&gt; [read more]&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;!-- SPDX-FileCopyrightText: 2024 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;I recently wrote a &lt;a class="reference external" href="https://git.sr.ht/~wombelix/fluent-bit-output-plugin-aws-cloudtrail-data"&gt;AWS CloudTrail Data Service output plugin&lt;/a&gt;
(Mirror: &lt;a class="reference external" href="https://github.com/wombelix/fluent-bit-output-plugin-aws-cloudtrail-data"&gt;[1]&lt;/a&gt;,
&lt;a class="reference external" href="https://gitlab.com/wombelix/fluent-bit-output-plugin-aws-cloudtrail-data"&gt;[2]&lt;/a&gt;,
&lt;a class="reference external" href="https://codeberg.org/wombelix/fluent-bit-output-plugin-aws-cloudtrail-data"&gt;[3]&lt;/a&gt;)
in Golang for &lt;a class="reference external" href="https://fluentbit.io/"&gt;Fluent Bit&lt;/a&gt;. It's Open Source under the Apache-2.0 license.
The plugin ingest events into &lt;a class="reference external" href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake.html"&gt;AWS CloudTrail Lake&lt;/a&gt;
through the CloudTrail Data Service by making a
&lt;a class="reference external" href="https://docs.aws.amazon.com/awscloudtraildata/latest/APIReference/API_PutAuditEvents.html"&gt;PutAuditEvents&lt;/a&gt; API call.&lt;/p&gt;
&lt;p&gt;I wrote a guest Article in the SUSE Blog:
&lt;a class="reference external" href="https://www.suse.com/c/send-suse-security-neuvector-events-to-aws-cloudtrail-lake/"&gt;Send SUSE Security (NeuVector) events to AWS CloudTrail Lake&lt;/a&gt;
(Archive: &lt;a class="reference external" href="https://web.archive.org/web/20241117122619/https://www.suse.com/c/send-suse-security-neuvector-events-to-aws-cloudtrail-lake/"&gt;[1]&lt;/a&gt;,
&lt;a class="reference external" href="https://archive.today/2024.11.17-122935/https://www.suse.com/c/send-suse-security-neuvector-events-to-aws-cloudtrail-lake/"&gt;[2]&lt;/a&gt;).
It covers the Architecture and usage, in the context of SUSE Security (NeuVector) and Syslog as Fluent Bit input.
But given the modular nature of Fluent Bit, your Input can be one of the other &lt;a class="reference external" href="https://docs.fluentbit.io/manual/pipeline/inputs"&gt;over 40 sources&lt;/a&gt;.
Which makes the Blog a blueprint for other use-cases too.&lt;/p&gt;
&lt;p&gt;The Heart and Soul of the plugin is &lt;a class="reference external" href="https://git.sr.ht/~wombelix/fluent-bit-output-plugin-aws-cloudtrail-data/tree/main/item/out_aws-cloudtrail-data.go"&gt;out_aws-cloudtrail-data.go&lt;/a&gt;,
which is based on the boilerplate example &lt;a class="reference external" href="https://github.com/fluent/fluent-bit-go/blob/master/examples/out_gstdout/out_gstdout.go"&gt;out_gstdout.go&lt;/a&gt;.
It's my first Fluent Bit plugin and I enjoyed the nice coding exercise to hack a first working version together and release it.
There is, as always in life, room for improvement but it does the job and is more than enough to get started.&lt;/p&gt;
&lt;p&gt;Looking forward for feedback to improve the plugin and to the next opportunity to write another one.&lt;/p&gt;
&lt;p&gt;Helpful resources to understand the Fluent Bit concepts and to write a plugin in Go:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;a class="reference external" href="https://docs.fluentbit.io/manual/concepts/key-concepts"&gt;Fluent Bit - Key Concepts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://docs.fluentbit.io/manual/development/golang-output-plugins"&gt;Fluent Bit - Golang Output Plugins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://github.com/fluent/fluent-bit-go/tree/master/examples"&gt;fluent-bit-go / examples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Recommended resources to learn more about the AWS CloudTrail Data Service and the API to ingest events into AWS CloudTrail Lake:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;a class="reference external" href="https://docs.aws.amazon.com/awscloudtraildata/latest/APIReference/API_PutAuditEvents.html"&gt;AWS CloudTrail – API Reference – PutAuditEvents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration-custom.html"&gt;AWS CloudTrail – User Guide – Create a custom integration with the console&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-integration-event-schema.html"&gt;CloudTrail Lake integrations event schema&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content><category term="Code"/><category term="FluentBit"/><category term="Go"/><category term="Coding"/><category term="Plugin"/><category term="AWS"/><category term="CloudTrail"/><category term="OpenSource"/></entry></feed>