Commit Graph

9061 Commits (64b6ff7392341f1f5abe81f7942351df4900ec57)
 

Author SHA1 Message Date
Jason Ish 64b6ff7392 config: better default rule file configuration
Move the rule file configuration down near the bottom of the
configuration file under advanced settings. With the bundling
of Suricata-Update, any rule file configuration within
suricata.yaml could be considered advanced.

Add extra comments to the yaml to make it more clear which was
enabled at installation time.
6 years ago
Danny Browning cd40a3f7ac detect-parse: fix missing space in error message (2541)
Fix missing space in error message.
6 years ago
Victor Julien f68bf3301a enip: harden byte parsing code
Make sure we never read more than we have.

Reported-by: Henning Perl
6 years ago
Victor Julien 9ba89a31ef ssh: fix out of bounds read in banner parsing
Reported-by: Henning Perl
6 years ago
Victor Julien 843d0b7a10 stream: support RST getting lost/ignored
In case of a valid RST on a SYN, the state is switched to 'TCP_CLOSED'.
However, the target of the RST may not have received it, or may not
have accepted it. Also, the RST may have been injected, so the supposed
sender may not actually be aware of the RST that was sent in it's name.

In this case the previous behavior was to switch the state to CLOSED and
accept no further TCP updates or stream reassembly.

This patch changes this. It still switches the state to CLOSED, as this
is by far the most likely to be correct. However, it will reconsider
the state if the receiver continues to talk.

To do this on each state change the previous state will be recorded in
TcpSession::pstate. If a non-RST packet is received after a RST, this
TcpSession::pstate is used to try to continue the conversation.

If the (supposed) sender of the RST is also continueing the conversation
as normal, it's highly likely it didn't send the RST. In this case
a stream event is generated.

Ticket: #2501

Reported-By: Kirill Shipulin
6 years ago
Victor Julien 33614fcae0 stream-events: fix mapping 6 years ago
Victor Julien 2b581cd6db smb: log trans2 that enable delete on close 6 years ago
Victor Julien eefac0ef95 smb1: add support for trans2 set_path_info rename 6 years ago
Victor Julien 1b86d4e1a2 smb: improve dcerpc logic
Detect whether a pipe is a dcerpc channel based on the name of the
pipe.
6 years ago
Victor Julien 7c8a078a2c smb1: improve NT Create response record parsing 6 years ago
Victor Julien 83e7ddf41f http: fix setting event on the last tx 6 years ago
Victor Julien 62e6e0eb3c pcap-file: fix segv on bad pcap format 6 years ago
Victor Julien d0cded2523 http: set events for too many layers of compression
libhtp would already issue warnings, but these were not mapped
to events yet.
6 years ago
Danny Browning 2dc6b6ee14 source-pcap-file: delete when done (2417)
https://redmine.openinfosecfoundation.org/issues/2417

Add option to have pcap files deleted after they have been processed.
This option combines well with pcap file continuous and streaming
files to a directory being processed.
6 years ago
Victor Julien 84fc43842f detect: fix memory leak in app-layer-event keyword
Bug #2515.
6 years ago
Victor Julien 5c584c2b74 app-layer/tcp: set STREAM_MIDSTREAM flag 6 years ago
Victor Julien 2e6014b15c rust/smb: search for record on midstream start
Calls with both START and MIDSTREAM mean the record might be cut and the
start of it could be missing. For this case, enable the same logic as is
used when catching up after a GAP. Search for the start of the record
instead of assuming it sits exactly at the start of the input data.
6 years ago
Victor Julien 905d9a1dd8 rust: define all STREAM_* types 6 years ago
Victor Julien 7bc3c3ac6e app-layer: pass STREAM_* flags to parser
Pass the STREAM_* flags to the app-layer parser functions so that
the parser can know more about how it is called.
6 years ago
Victor Julien df88c048ba detect: fix delayed detect
Last multi-detect changes broken delayed-detect by refusing to reload
a 'stub' detect engine. This patch distinguishes between a stub for
multi-tenancy and for delayed detect.
6 years ago
jason taylor a2bc008093 add note about eve-alert metadata
Signed-off-by: jason taylor <jtfas90@gmail.com>
6 years ago
Jason Ish ede94e1f66 doc: alphabetize EXTRA_DIST 6 years ago
Jason Ish ff73d908aa doc: add window ips inline doc to extra_dist 6 years ago
Jason Ish d2142cf433 doc: make warnings errors when building man page 6 years ago
Jason Ish 01f477786e doc: link in windows ips setup page 6 years ago
Victor Julien 5bcae21653 detect: reload-rules shouldn't reload a stub 6 years ago
Victor Julien 4eaec2dff0 detect/debug: suppress noisy info messages 6 years ago
Victor Julien 8c918a4bea detect/multi-tenant: fix mix of default detect engine and tenants 6 years ago
Victor Julien 6e9d81289d detect: make detect engine types explicit
There are 3 types of detect engine objects:
    1. normal
       The normal detection engine if no multi-tenancy is in use

    2. tenant
       A per tenant detection engine

    3. stub
       A stub (or minimal as it was called before) detect engine
       that is needed to have something in place when there are
       only tenants.

       A stub is also used in case of 'delayed detect', where we
       need a minimal detect engine to start up which is replaced
       by a full (normal type) detect engine after startup.

This patch adds a new field 'type' to the DetectEngineCtx object
to distinguish between the types. This replaces the boolean 'minimal'.
6 years ago
Victor Julien b5bc509857 dhcp: suppress notice message at startup 6 years ago
Jason Ish d83707bef9 rust/dns - remove extra parantheses
Removes rust compiler warning.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2521
6 years ago
Jason Ish 7d5f8295bc yaml-loader: fix memory leak on fail include
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/1929

If an include failed to load, either by the file not existing or
a parse error, the file pointer and yaml parser instance were
leaked.
6 years ago
Eric Leblond ec0a7b22a5 output-json-alert: log correct dns and dnp3 tx
Using transaction log entry is not correct to log the transaction
that did cause the alert. The tx_id in the PacketAlert is correct
so let's use that.
6 years ago
Victor Julien d377eba254 detect/multi-tenant: fix removing of tenant id 0 6 years ago
Victor Julien f8ebcac736 unix/multi-tenant: improve (log) messages 6 years ago
Victor Julien 4866295bfb detect/tenants: fix crash when adding mapping
When no tenants and mappings are defined in 'live' mode, adding a
mapping resulted in a crash.
6 years ago
Victor Julien 663549d02c detect: remove lock from global keyword logic
The global keyword registration and per thread init handling used
the lock from the DetectEngineMasterCtx. This lead to a dead lock
situation at multi-tenancy tenant reloads.

The lock was unnecessary however, as the only time the registration
list is updated is at engine initialization. At that time Suricata
is still running in a single thread. After this, the data structure
doesn't change anymore.

Bug #2516.
6 years ago
Jacob Masen-Smith ec77632e84 Adds WinDivert support to Windows builds
Enables IPS functionality on Windows using the open-source
(LGPLv3/GPLv2) WinDivert driver and API.

From https://www.reqrypt.org/windivert-doc.html : "WinDivert is a
user-mode capture/sniffing/modification/blocking/re-injection package
for Windows Vista, Windows Server 2008, Windows 7, and Windows 8.
WinDivert can be used to implement user-mode packet filters, packet
sniffers, firewalls, NAT, VPNs, tunneling applications, etc., without
the need to write kernel-mode code."

- adds `--windivert [filter string]` and `--windivert-forward [filter
    string]` command-line options to enable WinDivert IPS mode.
    `--windivert[-forward] true` will open a filter for all traffic. See
    https://www.reqrypt.org/windivert-doc.html#filter_language for more
    information.

Limitation: currently limited to `autofp` runmode.

Additionally:
- `tmm_modules` now zeroed during `RegisterAllModules`
- fixed Windows Vista+ `inet_ntop` call in `PrintInet`
- fixed `GetRandom` bug (nonexistent keys) on fresh Windows installs
- fixed `RandomGetClock` building on Windows builds
- Added WMI queries for MTU
6 years ago
Jason Ish 55ad4e4ece travis: use gcc-7 on cocci build
Catches more errors, like switch statements fall throughs
that are caught in private QA.
6 years ago
Chris Speidel 1e8959b465 doc: fix minor typo 6 years ago
Jason Ish cf33c9975a filestore: fix truncation warnings 6 years ago
fooinha f67aa5deaa packet: gre over ip link type 6 years ago
Victor Julien 693a3df031 tls: document encrypt-handling option
Document in sample yaml and user guide.
6 years ago
Victor Julien 2d50fe499a tls: new config for dealing with encrypted traffic
Much of encrypted traffic is uninteresting to Suricata. Once encrypted
communication starts, inspecting the packet payloads is generally
not interesting anymore. The default behavior is to disable the parts
of the detection engine and stream reassembly that relate to raw content
inspection.

The tls app-layer parser also had a crude option to affect this behavior:
set 'no-reassemble' to true went much further than the default behavior.
It disabled the TCP reassembly on the flow completely, disabled all
inspection on the flow and enabled bypass if available.

This patch adds a new option: full inspection. This continues to treat
a TLS session as any other, so without any limits to inspection.

The new option is implemented in a new config option 'encrypt-handling',
that replaces 'no-reassemble'. The new option has 3 values:
'default', 'full' and 'bypass'. Default is the current default behavior,
'bypass' is the current 'no-reassemble = true' behavior and 'full'
is the new full inspection mode.
6 years ago
Victor Julien e6a009ae7f detect/stream_size: code cleanups 6 years ago
Victor Julien f30f038179 detect/stream_size: apply rule to packets & stream
The use of stream_size in combination with raw content matches is an
indication that the rule needs to be evaluated per packet, not just
per reassembled stream chunk.
6 years ago
Victor Julien c677e07d3e kerberos: minor doc updates, add author 6 years ago
Victor Julien b61e9c2173 dhcp: add author 6 years ago
Jason Ish fb85822730 dhcp: update user guide 6 years ago
Jason Ish c052e23348 dhcp: add dhcp app-layer rules file 6 years ago