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: net_tcp_connect event #4573

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

rscampos
Copy link
Collaborator

@rscampos rscampos commented Feb 4, 2025

1. Explain what the PR does

The code attempted to cast "type" as a string, which caused issues when the actual value was of a different type. So this PR changes the type to int32, aligning it with parsers.SOCK_STREAM.Value(), and adds an integration test.

8845c70 test: add test for event net_tcp_connect
3ff2560 fix: type parsing net_tcp_connect

3ff2560 fix: type parsing net_tcp_connect

The code attempted to cast "type" as a string, which caused issues
when the actual value was of a different type. So this commit changes
the type to int32, aligning it with parsers.SOCK_STREAM.Value().

2. Explain how to test it

cmd:

nc -zv localhost 7777

Tracee:

sudo ./dist/tracee -e net_tcp_connect
TIME             UID    COMM             PID     TID     RET              EVENT                     ARGS
16:12:03:441124  1000   nc               2561853 2561853 0                net_tcp_connect           dst: 127.0.0.1, dst_port: 7777, dst_dns: []

3. Other comments

fix #4568

Thansk @oshaked1 to report this issue.

Copy link
Member

@geyslan geyslan left a comment

Choose a reason for hiding this comment

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

LGTM

The code attempted to cast "type" as a string, which caused issues
when the actual value was of a different type. So this commit changes
the type to int32, aligning it with parsers.SOCK_STREAM.Value().
@rscampos rscampos force-pushed the fix_net_tcp_connect branch from dc3a7a8 to 8845c70 Compare February 5, 2025 14:47
@rscampos
Copy link
Collaborator Author

rscampos commented Feb 5, 2025

/fast-forward

@github-actions github-actions bot merged commit 8845c70 into aquasecurity:main Feb 5, 2025
41 checks passed
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.

net_tcp_connect does not work
2 participants