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

Add socket and sockaddr types #3358

Merged
merged 8 commits into from
Feb 3, 2025
Merged

Conversation

kevsecurity
Copy link
Contributor

Description

The security_socket_* functions take pointers to struct socket and struct sockaddr, but we don't currently support these types. This series adds support for them. The socket support resolves the socket's struct sock pointer and uses that as per struct sock support. The sockaddr support uses the SAddr and SPort matchArgs operators to represent SinAddr and SinPort.

Changelog

Add support for struct socket and struct sockaddr.

Add support for struct socket and struct sockaddr.

@kevsecurity kevsecurity added the release-note/minor This PR introduces a minor user-visible change label Jan 30, 2025
Copy link

netlify bot commented Jan 30, 2025

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 2865fb0
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/679b95c2e569660008b2148e
😎 Deploy Preview https://deploy-preview-3358--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kevsecurity kevsecurity force-pushed the pr/kevsecurity/add-sockaddr-support branch 2 times, most recently from 504a8a5 to 0c92303 Compare January 30, 2025 16:08
Some security_socket_* functions take a struct sockaddr * as an
argument. We don't currently support this type. This commit adds support
in BPF for kprobes and tracepoints.

Signed-off-by: Kevin Sheldrake <[email protected]>
Some security_socket_* functions take a struct sockaddr * as an
argument. We don't currently support this type. This commit adds
sockaddr types to user space for kprobes and tracepoints.

Signed-off-by: Kevin Sheldrake <[email protected]>
Some security_socket_* functions take a struct sockaddr * as an
argument. We don't currently support this type. This commit adds
configuration for the sockaddr types.

Signed-off-by: Kevin Sheldrake <[email protected]>
security_socket_* functions take a struct socket * as an argument. We
don't currently support this type. This commit adds support in BPF for
kprobes and tracepoints. We just access the struct sock linked from the
struct socket and handle it as a struct sock.

Signed-off-by: Kevin Sheldrake <[email protected]>
security_socket_* functions take a struct socket * as an argument. We
don't currently support this type. This commit adds socket types to
user space for kprobes and tracepoints.

Signed-off-by: Kevin Sheldrake <[email protected]>
security_socket_* functions take a struct socket * as an argument. We
don't currently support this type. This commit adds configuration for
the socket types.

Signed-off-by: Kevin Sheldrake <[email protected]>
The sockaddr and socket types were added. This commit adds a test and
two example policies.

Signed-off-by: Kevin Sheldrake <[email protected]>
Signed-off-by: Kevin Sheldrake <[email protected]>
@kevsecurity kevsecurity force-pushed the pr/kevsecurity/add-sockaddr-support branch from 0c92303 to ccef91f Compare January 30, 2025 16:14
@kevsecurity kevsecurity marked this pull request as ready for review January 30, 2025 17:06
@kevsecurity kevsecurity requested review from a team and mtardy as code owners January 30, 2025 17:06
@kkourt kkourt self-requested a review January 31, 2025 11:56
Copy link
Contributor

@will-isovalent will-isovalent left a comment

Choose a reason for hiding this comment

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

LGTM

@kevsecurity kevsecurity merged commit fde6cb5 into main Feb 3, 2025
53 checks passed
@kevsecurity kevsecurity deleted the pr/kevsecurity/add-sockaddr-support branch February 3, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants