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

[SSC-395] XDP filter for bypassed traffic #10

Open
wants to merge 6 commits into
base: suricata-6.0.18-awn
Choose a base branch
from

Conversation

scott-kiester
Copy link

@scott-kiester scott-kiester commented Dec 4, 2024

This PR includes the initial implementation of the XDP stream filter, which will drop traffic that has been bypassed by Suricata.

Once a flow hits a bypass rule in Suricata, it's added to "flow_table_v4", which is an ebpf table that allows flows to be looked up by tuple. The XDP stream filter checks the table when it gets new traffic; if the flow matches, then the traffic is dropped, which saves CPU cycles.

The XDP stream filter currently only works with mirroring deployments. Support for internal tap will be added later. An HLD is needed for that work.

Related PRs:
Add the stream filter to the build (awn)

Testing has been performed on both virtual and physical sensors.

There are no plans to merge these changes back to the OSIF Suricata repo.

Make sure these boxes are signed before submitting your Pull Request -- thank you.

Link to redmine ticket:

Describe changes:

Provide values to any of the below to override the defaults.

To use a pull request use a branch name like pr/N where N is the
pull request number.

Alternatively, SV_BRANCH may also be a link to an
OISF/suricata-verify pull-request.

SV_REPO=
SV_BRANCH=
SU_REPO=
SU_BRANCH=
LIBHTP_REPO=
LIBHTP_BRANCH=


# A simple script to speed up build/test/debug iterations for XDP stuff.

if [ "$#" -lt 1 ]; then

Choose a reason for hiding this comment

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

not equal to 1 so it breaks if too many args are supplied

if [ -z ${RTK_SENSOR_HOSTNAME} ]; then
echo "RTK_SENSOR_HOSTNAME is not set. Skipping scp."
exit 0
else

Choose a reason for hiding this comment

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

else can be removed

Also added a "--debug" flag to build-xdp.sh which will generate a BPF with debug symbols. llvm-objdump can then be used to generate an annotated assembly listing, which can be used in conjunction with syslog messages to determine what happened when the kernel refuses to load a given BPF program.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants