Commit Graph

14782 Commits (a748164d5863937580dde41785663b1d3f3b78b7)
 

Author SHA1 Message Date
liaozhiyuan a748164d58 dpdk: support multiple same EAL arguments
DPDK apps can specify multiple arguments of the same
type. YAML format only allows unique keys within a single
node. This commit adds support for multiple EAL arguments
of the same type to be used within suricata.yaml.

Ticket: #5964
2 years ago
Philippe Antoine e75956717d detect/files: centralize definition of protocols
Protocols supporting files are only defined in one place, which
gets used by all keywords, which can handle some exceptions
(like HTTP2 not having file names)
2 years ago
Philippe Antoine 71bab65496 detect/files: reuse AppLayerParserSupportsFiles
rather than relisting the protocols
2 years ago
Jason Ish 83afccd932 github-ci: update action: setup-msys2
Use @v2, hopefully the dependency bot will keep it up to date now.
2 years ago
Jason Ish 37d68230f8 github-ci: use latest version of actions/upload-artifact 2 years ago
Jason Ish d576be2452 github-ci: update actions/cache to v3.3.1 2 years ago
Jason Ish 3dfd5ddaed github-ci: use same version (3.0.2) for actions/download-artifact 2 years ago
Jason Ish 04ba1a7ef6 github-ci: update actions/checkout to v3.5.3 2 years ago
Juliana Fajardini feb47f9a89 exceptions: fix 'auto' for master switch in IDS
If the master exception policy was set to 'auto' in IDS mode, instead of
just setting the master switch to the default in this case, which is
'ignore', the engine would switch a warning saying that auto wasn't a
valid config and then set the policy to ignore.

This makes 'auto' work for the master switch in IDS, removes function
for setting IPS option and handles the valid IDS options directly from
the function that parses the master policy, as this was the only place
where the function was still called.

Bug #6149
2 years ago
Jason Ish 5f598931ac doc/userguide: start on a security chapter
This is the start of a security consideration chapter, starting with
directions on how to run Suricata as a non-root user.
2 years ago
Victor Julien ab667d4d19 pcap: fix reopen logic
Bug: #6081.
2 years ago
Victor Julien 5f187cba82 pcap/runmodes: silence some info messages 2 years ago
Victor Julien 3049151bc2 pcap: free per thread resources
Bug: #4750.
2 years ago
Victor Julien 6c1408c3c2 pcap/file: minor code cleanup 2 years ago
Victor Julien 25396dcd09 threads: cleanup decode_pq handling 2 years ago
Victor Julien 639c5cc4df version: start development towards 7.0.0-rc3 2 years ago
Shivani Bhardwaj da99a69c5b release: 7.0.0-rc2; update changelog 2 years ago
Jason Ish 14daa42e0b doc/userguide: dataset upgrade notes 2 years ago
Jason Ish ed4d27fdc1 config: uncomment datasets configuration
Uncomment the datasets configuration for easier editing by users.  The
values are left commented out as their defaults.
2 years ago
Jason Ish 93b64939d1 datasets: flag to disable "write" actions
Add a new configuration flag, "datasets.rules.allow-write" to control
if rules can contain "save" or "state" rules which allow write access
to the file system.

Ticket: #6123
2 years ago
Jason Ish f0885a2a2e install: create runtime data directory
On installation, make sure the data directory is created. This will
usually be /var/lib/suricata/data, but otherwise follows the
autoconf/automake instructions.

This directory is for runtime state information, which for now is
datasets but may be expanded in the future.  Suricata already expects
this directory to exist for "state" and "save" datasets, but it has
been up to the user to create it.
2 years ago
Jason Ish fd79b337ca datasets: don't allow absolute or paths with directory traversal
For dataset filenames coming from rules, do not allow filenames that
are absolute or contain a directory traversal with "..". This prevents
datasets from escaping the define data-directory which may allow a bad
rule to overwrite any file that Suricata has permission to write to.

Add a new configuration option,
"datasets.rules.allow-absolute-filenames" to allow absolute filenames
in dataset rules. This will be a way to revert back to the pre 6.0.13
behavior where save/state rules could use any filename.

Ticket: #6118
2 years ago
Jason Ish 4a97461f9a doc/userguide: notes about Lua rules being disabled by default 2 years ago
Jason Ish f119b29701 lua: disable lua rules by default
To protect against possible supply chain attacks, disable Lua rules by
default. They can be enabled under the "security" section of
suricata.yaml.

Ticket: #6122
2 years ago
Philippe Antoine 0d0f6cde6e fuzz: fuzz HTTP1 target
As we use the name taken from list-app-layer-protos output,
we want http to translate to HTTP1
2 years ago
Philippe Antoine d40dca5e55 dcerpc: maximum number of live transactions also for UDP
Ticket: #6129

Avoids that quadratic complexity gets too bad
2 years ago
Shivani Bhardwaj 3aaf37b749 smtp: handle long lines per direction
Issue:
Currently, while handling of long lines, if the line exceeded the limit,
we'd set a variable state->discard_till_lf which will be reset in the
later stages based on the data that arrives. However, because there was
one variable per state, this meant that a later stage in the other
direction could also modify it which is incorrect.

Fix:
Use separate variables for each direction.

Bug 6053
2 years ago
Shivani Bhardwaj 046a192c1f smtp: handle following cmd if LF was found in long line
If a long line had LF post the limit, it should be considered complete
and not wait for the next line to complete it. However, currently, any
following lines were skipped which could sometimes also be important
commands for the entire transaction.

Fix this by setting a flag in case we're truncating a long line but
after having found the LF character.

Bug 5989
2 years ago
Shivani Bhardwaj d83a34397b smtp: add function docs 2 years ago
Shivani Bhardwaj 073f616feb smtp: handle DATA mode in middle of input parsing
Before:
If the input was such that we'd enter DATA mode in the middle, the
entire data would be passed through SMTPGetLine fn and be processed with
line limits etc in place.

After:
Since we don't want any limits to be enforced on DATA, we pass it to
SMTPPreProcessCommands fn to take care of it differently from the
commands.

Bug 5981
2 years ago
Victor Julien 6b5da30d9d streaming/buffer: set errno in allocators
Add wrappers for the default allocators to set SC_ENOMEM.

The stream reassembly wrappers can set both SC_ENOMEM (alloc failed)
and SC_ELIMIT (memcap reached).
2 years ago
Victor Julien 55c6c45ea7 streaming/buffer: turn BUG_ON's into validate checks 2 years ago
Victor Julien db1cb2a032 stream: update insert error checking 2 years ago
Victor Julien 06419cecbc streaming: use error codes to indicate error reason 2 years ago
Victor Julien c3ee3d513f error: SC_ELIMIT for when a limit is reached 2 years ago
Victor Julien 376ebda36c exception/policy: fix midstream default handling 2 years ago
Victor Julien 479fa609fa exception/policy: minor code cleanup 2 years ago
Juliana Fajardini 106b885d88 stream/tcp: don't accept pass-packet policy
This is no longer valid for midstream exception policies.

Part of
Bug #5825
2 years ago
Juliana Fajardini 69d3750aaf stream/tcp: re-enable midstream-policy usage
We were always setting it to ignore, due to bug 5825.

The engine will now issue an initialization error if an invalid value
is passed in the configuration file for midstream exception policy.

'pass-packet' or 'drop-packet' are never valid, as the midstream policy
concerns the whole flow, not making sense for just a packet.

If midstream is enabled, only two actual config values are allowed:
'ignore' and 'pass-flow', both in IDS and in IPS mode. In default mode
('auto' or if no policy is defined), midstream-policy is set to
'ignore'. All other values will lead to initialization error.

In IDS mode, 'drop-flow' will also lead to initialization error.

Part of
Bug #5825
2 years ago
Juliana Fajardini e849afbda1 exceptions: extract 'auto' check to function
Part of
Bug #5825
2 years ago
Juliana Fajardini 69311ab02f exceptions: use mix of logconfig/info/warning
Use a mix of SCLogConfig, Warning and Info.
This mix works as follows: when something unnexpected for the user
happens - for instance, the engine ignoring an invalid config value, we
use warning. For indicating the value for the master switch, which
happens only once, we use Info. For all the other cases, we use
SCLogConfig.

It is possible that SCLogConfig isn't showing at the moment, this is a
possible bug to investigate further.

Related to
Bug #5825
2 years ago
Juliana Fajardini 7f8536b81c exceptions: parse config values, don't post process
Get the enum values from the config file. Update the new extracted
functions. Post-process the config values based on runmode and policy.
Also handle 'auto' enum value in these.

Related to
Bug #5825
2 years ago
Juliana Fajardini f97af0c0b1 exceptions/midstream: parse midstream policy alone
As the midstream exception policy has its own specific scenarios, have a
dedicated function to parse and process its config values, and check for
midstream enabled when needed.

Related to
Bug #5825
2 years ago
Juliana Fajardini bf22129a0f exceptions: refactor exception policy parse fn
Split up ExceptionPolicyParse to try to improve readability.

Related to
Bug #5825
2 years ago
Juliana Fajardini c0db25d055 userguide: update exception policy behaviors table
Some exception policies can only be applied to the triggering packet or
only make sense considering the whole flow. Highlight such cases in the
table showing each exception policy.

Related to
Bug #5825
2 years ago
Juliana Fajardini 0c2922f02e doc: add midstream scenarios for exception policy
The different interactions between midstream pick-up sessions and the
exception policy can be quite difficult to visualize. Add a section for
that in the userguide.

Related to
Bug #5825
2 years ago
Juliana Fajardini f511a4ae3f misc: fix typos, doc, update copyright years
Updated FlowGetNew documentation, where it said NULL was only returned
in case of error.
2 years ago
Juliana Fajardini a37a88dcd5 defrag: clean up existing stats counters
7a044a99ee removed the lines that incremented these defrag
counters, but kept the entities themselves. This commit removes counters
that we judge too complex to maintain, given the current state of the
code, and re-adds incrementing max_hit (memcap related).

Related to
Task #5816
2 years ago
Juliana Fajardini 05417407b3 schema: add missing flow event property: emergency 2 years ago
Jason Ish 68d0d6ca24 rust: fix unit test link error on Rust 1.70
Rust 1.70 appears to now link code on both branches of `if cfg!(test)`
now causing Rust unit tests to fail as that pattern was used to
disable functions only available when linked with the Suricata C code.

To work-around this issue, provide two versions of the `new` function,
one for unit tests and one when running as an application.
2 years ago