MCPcopy Index your code
hub / github.com/OISF/suricata

github.com/OISF/suricata @suricata-8.0.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release suricata-8.0.5 ↗ · + Follow
16,855 symbols 59,701 edges 1,597 files 4,932 documented · 29%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Suricata

Fuzzing Status codecov

Introduction

Suricata is a network IDS, IPS and NSM engine developed by the OISF and the Suricata community.

Resources

Contributing

We're happily taking patches and other contributions. Please see our Contribution Process for how to get started.

Suricata is a complex piece of software dealing with mostly untrusted input. Mishandling this input will have serious consequences:

  • in IPS mode a crash may knock a network offline
  • in passive mode a compromise of the IDS may lead to loss of critical and confidential data
  • missed detection may lead to undetected compromise of the network

In other words, we think the stakes are pretty high, especially since in many common cases the IDS/IPS will be directly reachable by an attacker.

For this reason, we have developed a QA process that is quite extensive. A consequence is that contributing to Suricata can be a somewhat lengthy process.

On a high level, the steps are:

  1. GitHub-CI based checks. This runs automatically when a pull request is made.
  2. Review by devs from the team and community
  3. QA runs from private QA setups. These are private due to the nature of the test traffic.

Overview of Suricata's QA steps

OISF team members are able to submit builds to our private QA setup. It will run a series of build tests and a regression suite to confirm no existing features break.

The final QA runs takes a few hours minimally, and generally runs overnight. It currently runs:

  • extensive build tests on different OS', compilers, optimization levels, configure features
  • static code analysis using cppcheck, scan-build
  • runtime code analysis using valgrind, AddressSanitizer, LeakSanitizer
  • regression tests for past bugs
  • output validation of logging
  • unix socket testing
  • pcap based fuzz testing using ASAN and LSAN
  • traffic replay based IDS and IPS tests

Next to these tests, based on the type of code change further tests can be run manually:

  • traffic replay testing (multi-gigabit)
  • large pcap collection processing (multi-terabytes)
  • fuzz testing (might take multiple days or even weeks)
  • pcap based performance testing
  • live performance testing
  • various other manual tests based on evaluation of the proposed changes

It's important to realize that almost all of the tests above are used as acceptance tests. If something fails, it's up to you to address this in your code.

One step of the QA is currently run post-merge. We submit builds to the Coverity Scan program. Due to limitations of this (free) service, we can submit once a day max. Of course it can happen that after the merge the community will find issues. For both cases we request you to help address the issues as they may come up.

FAQ

Q: Will you accept my PR?

A: That depends on a number of things, including the code quality. With new features it also depends on whether the team and/or the community think the feature is useful, how much it affects other code and features, the risk of performance regressions, etc.

Q: When will my PR be merged?

A: It depends, if it's a major feature or considered a high risk change, it will probably go into the next major version.

Q: Why was my PR closed?

A: As documented in the Suricata GitHub workflow, we expect a new pull request for every change.

Normally, the team (or community) will give feedback on a pull request after which it is expected to be replaced by an improved PR. So look at the comments. If you disagree with the comments we can still discuss them in the closed PR.

If the PR was closed without comments it's likely due to QA failure. If the GitHub-CI checks failed, the PR should be fixed right away. No need for a discussion about it, unless you believe the QA failure is incorrect.

Q: The compiler/code analyser/tool is wrong, what now?

A: To assist in the automation of the QA, we're not accepting warnings or errors to stay. In some cases this could mean that we add a suppression if the tool supports that (e.g. valgrind, DrMemory). Some warnings can be disabled. In some exceptional cases the only 'solution' is to refactor the code to work around a static code checker limitation false positive. While frustrating, we prefer this over leaving warnings in the output. Warnings tend to get ignored and then increase risk of hiding other warnings.

Q: I think your QA test is wrong

A: If you really think it is, we can discuss how to improve it. But don't come to this conclusion too quickly, more often it's the code that turns out to be wrong.

Q: Do you require signing of a contributor license agreement?

A: Yes, we do this to keep the ownership of Suricata in one hand: the Open Information Security Foundation. See http://suricata.io/about/open-source/ and http://suricata.io/about/contribution-agreement/

Extension points exported contracts — how you extend this code

Transaction (Interface)
Transaction trait. This trait defines methods that a Transaction struct must implement in order to define some generic [23 …
rust/src/applayer.rs
BufWriter (Interface)
Trait that represents the decompression writers (gzip, deflate, etc.) and methods needed to write to a temporary buffer. [6 …
rust/htp/src/decompressors.rs
State (Interface)
(no doc) [24 implementers]
rust/src/applayer.rs
Decompress (Interface)
Describes a decompressor that is able to restart and passthrough data. Actual decompression is done using the `Write` tr [2 …
rust/htp/src/decompressors.rs
GetMutCursor (Interface)
(no doc) [3 implementers]
rust/src/http2/decompression.rs
SubIterator (Interface)
A trait that lets us find the byte index of slices in a generic way. This layer of abstraction is motivated by the need [2 …
rust/htp/src/bstr.rs
JA4Impl (Interface)
(no doc) [2 implementers]
rust/src/ja4.rs
FlagOperations (Interface)
Trait to allow interacting with flags. [2 implementers]
rust/htp/src/util.rs

Core symbols most depended-on inside this repo

len
called by 1153
rust/src/applayer.rs
SCJbSetUint
called by 1116
rust/src/jsonbuilder.rs
PacketAlertCheck
called by 933
src/detect-engine-alert.c
DetectEngineCtxInit
called by 813
src/detect-engine.c
DetectEngineCtxFree
called by 813
src/detect-engine.c
SigMatchSignatures
called by 810
src/detect.c
AppLayerParserParse
called by 779
src/app-layer-parser.c
DetectEngineAppendSig
called by 633
src/detect-parse.c

Shape

Function 13,148
Class 2,139
Method 1,118
Enum 435
Interface 15

Languages

C63%
Rust30%
C++7%
Python1%
PHP1%

Modules by API surface

src/detect-engine.c185 symbols
src/detect-engine-address.c176 symbols
rust/htp/src/test/main.rs166 symbols
src/app-layer-dnp3-objects.c165 symbols
rust/src/nfs/nfs4_records.rs164 symbols
src/detect-parse.c159 symbols
src/app-layer-dnp3-objects.h151 symbols
rust/src/smb/smb.rs117 symbols
src/detect.h116 symbols
src/app-layer-htp.c112 symbols
src/detect-content.c109 symbols
src/stream-tcp.c107 symbols

For agents

$ claude mcp add suricata \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page