Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dynamic data arguments #3777

Merged

Conversation

josedonizetti
Copy link
Collaborator

@josedonizetti josedonizetti commented Dec 20, 2023

Fix #3771

This PR fixes the parsing of types on arguments (signatures) that aren't supported by grpc event data. The idea is that users can create signature and pass whatever information as finding.Data to fit their needs, but this information must be converted properly to protobuf so the GRPC api can return it when streaming events.

I've tried a few solutions, but it always endup using reflection if tracee was the one responsible to convert the type, which is slow and cubersome, for example, we are only able to read exported fields, nested need deeper logic for convertion. So instead a better solution is to ask the user which information he wants to send on the grpc by implementing an interface, if the interface is implemented tracee calls it and use that data for the argument (kuddos to @NDStrahilevitz for the idea).

Also, we don't break the logic anymore if we can't parse an argument, we log and send the event with the missing data if needed.

Depends

#3776

go.mod Outdated Show resolved Hide resolved
@josedonizetti josedonizetti marked this pull request as ready for review December 20, 2023 13:47
Copy link
Collaborator

@yanivagman yanivagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@josedonizetti josedonizetti merged commit 17c1924 into aquasecurity:main Dec 22, 2023
30 checks passed
@josedonizetti josedonizetti deleted the fix-dynamic-data-arguments2 branch December 22, 2023 02:56
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.

finding.Data parsing to event data fails if not one of the expected types
2 participants