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

chore(derive/http): change log level when packets are malformed #3780

Conversation

NDStrahilevitz
Copy link
Collaborator

@NDStrahilevitz NDStrahilevitz commented Dec 26, 2023

1. Explain what the PR does

Deriving a net packet event for HTTP when given a malformed request/response would previously return an error. This error is useless for users as there always exists a chance for packet corruption when passing through the eBPF perf buffer. As such, log in WARN level instead.

2. Explain how to test it

Before net_packet_helpers.go:632 add the following line:
image
Then compile and note the logs working.
tracee --events net_packet_http_request
{"level":"warn","ts":1703593308.6970172,"msg":"attempted to derive net_packet_http_request event from malformed packet, event will be skipped","error":"invalid method \"G\\x00T\""}

Deriving a net packet event for HTTP when given a malformed request/response would previously return an error.
This error is useless for users as there always exists a chance for packet corruption when passing through the eBPF perf buffer.
As such, log in WARN level instead.
@NDStrahilevitz NDStrahilevitz changed the title feat(derive/http): change log level when packets are malformed chore(derive/http): change log level when packets are malformed Dec 26, 2023
Copy link
Collaborator

@AlonZivony AlonZivony left a comment

Choose a reason for hiding this comment

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

LGTM

@NDStrahilevitz NDStrahilevitz merged commit 61d3628 into aquasecurity:main Dec 26, 2023
31 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.

None yet

2 participants