Skip to content

Add Rust versions of the cloudtrail and gcpaudit plugins#1340

Open
geraldcombs wants to merge 10 commits intofalcosecurity:mainfrom
geraldcombs:gcpaudit-rs
Open

Add Rust versions of the cloudtrail and gcpaudit plugins#1340
geraldcombs wants to merge 10 commits intofalcosecurity:mainfrom
geraldcombs:gcpaudit-rs

Conversation

@geraldcombs
Copy link
Copy Markdown
Contributor

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area plugins

/area registry

/area build

/area documentation

/area automation

What this PR does / why we need it:

This is an AI-aided translation of the cloudtrail and gcpaudit plugins from Go to Rust. Why do this? Go doesn't officially support loading multiple c-shared libraries, and while this works on most platforms it crashes on macOS on x64, and the Go team has no plans to fix this:

golang/go#65050

Fortunately this doesn't really affect Falco, but it does affect Stratoshark, which loads multiple Falco plugins at startup:

https://gitlab.com/wireshark/wireshark/-/work_items/20869

I've been shipping these plugins with Stratoshark's development installers for macOS and Windows, and so far they seem to work well. I don't have any large capture files available for performance testing, but haven't run into any issues so far. If you have a large cloudtrail or gcpaudit file suitable for testing that you can share I would be grateful.

Questions and outstanding issues:

  • cloudtrail_rs and gcpaudit_rs currently have the same IDs and names as their Go counterparts. Should these have different IDs and/or names?

  • The cloudtrail Go plugin has a source test, which is absent from the Rust plugin.

Which issue(s) this PR fixes:

https://gitlab.com/wireshark/wireshark/-/work_items/20869

Fixes #

Special notes for your reviewer:

geraldcombs added 10 commits May 8, 2026 16:35
Try translating the gcpaudit plugin from Go to Rust in order to work
around

golang/go#65050

This is an inital attempt using Claude Opus, and doesn't currently
build.

Signed-off-by: Gerald Combs <gerald@wireshark.org>
Signed-off-by: Gerald Combs <gerald@wireshark.org>
Signed-off-by: Gerald Combs <gerald@wireshark.org>
Return None instead of an error if we don't find a field.

Signed-off-by: Gerald Combs <gerald@wireshark.org>
Signed-off-by: Gerald Combs <gerald@wireshark.org>
The gcpaudit translation worked well, so let's try CloudTrail.

Signed-off-by: Gerald Combs <gerald@wireshark.org>
Rename gcpaudit-rs to gcpaudit_rs and cloudtrail-rs to cloudtrail_rs to
conform to our plugin directory naming convention.

Signed-off-by: Gerald Combs <gerald@wireshark.org>
Signed-off-by: Gerald Combs <gerald@wireshark.org>
Add the following changes from the Golang plugin:

78e3a89 fix(plugins/cloudtrail): replace ct.user.sessionname with ct.originaluser
07a9f40 fix(plugins/cloudtrail): restore role name for ct.user on AssumedRole events
bfee0e3 doc(plugins/cloudtrail): Assumed role user from session name, falling back to the identity userName
9c58bb2 fix(plugins/cloudtrail): Assumed role user from session name, falling back to the identity userName

The following issues were not applicable:

8608166 fix(plugins/cloudtrail): prevent panics during sqs message parsing
2f0a3bf fix(plugins/cloudtrail): preserve records when strings contain braces

Mostly generated using Claude Opus 4.6, with minor fixes.

Signed-off-by: Gerald Combs <gerald@wireshark.org>
Copy the README.md files from cloudtrail and gcpaudit, and note that
these are Rust versions of those plugins.

Signed-off-by: Gerald Combs <gerald@wireshark.org>
@poiana poiana added kind/bug Something isn't working dco-signoff: yes kind/feature New feature or request labels May 8, 2026
@poiana
Copy link
Copy Markdown
Contributor

poiana commented May 8, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: geraldcombs
Once this PR has been reviewed and has the lgtm label, please assign jasondellaluce for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants