Commit Graph

9567 Commits (83a8df90f3723f8625dfe1d2cdd35cebc4caf832)
 

Author SHA1 Message Date
Eric Leblond 83a8df90f3 doc: improvement of xbits documentation page 6 years ago
Eric Leblond 43ede4db7f doc: xbits:noalert is not a valid syntax 6 years ago
Eric Leblond 2b1fa53c66 detect-hostbits: error on some invalid config 6 years ago
Eric Leblond e09fa43ba5 detect-xbits: error on some invalid config 6 years ago
Eric Leblond 910c3691af detect-flowbits: error on some invalid syntax
The regular expression was accepting something like
"flowbits:!isset,isma;" without complaining even if it is not
correct and don't have the expected result.
6 years ago
Eric Leblond 033fbc0f85 suricata: fix list keywords URL in release mode
The tags are suricata-X.X.X so we need to update the chain to get
URLs right.
6 years ago
Shivani Bhardwaj bb08040df6 unix-socket: Fix the message for unregister-tenant-handler 6 years ago
Shivani Bhardwaj 2483331a5d doc/unix-socket: Add missing commands and detail
Add missing commands and their corresponding details in unix-socket
userguide.

Closes redmine ticket #2800
6 years ago
Shivani Bhardwaj 342f3d5eec suricatactl: Clean up parser, improve help
So far the suricatactl parser was unclear about the options to use and
did not well display the required and optional param difference. Fix
that to make it legible for any user.

Before
```
└─ $ ▶ ./bin/suricatactl filestore -h
usage: suricatactl filestore [-h] {prune} ...

positional arguments:
  {prune}

optional arguments:
  -h, --help  show this help message and exit

└─ $ ▶ ./bin/suricatactl filestore prune -h
usage: suricatactl filestore prune [-h] [-d DIRECTORY] [--age AGE] [-n] [-v]
                                   [-q]

optional arguments:
  -h, --help            show this help message and exit
  -d DIRECTORY, --directory DIRECTORY
                        filestore directory
  --age AGE             prune files older than age
  -n, --dry-run         only print what would happen
  -v, --verbose         increase verbosity
  -q, --quiet           be quiet, log warnings and errors only
```

After
```
└─ $ ▶ ./bin/suricatactl filestore -h
usage: suricatactl filestore [-h] {prune} ...

positional arguments:
  {prune}     sub-command help
    prune     Remove files in specified directory older than specified age

optional arguments:
  -h, --help  show this help message and exit

└─ $ ▶ ./bin/suricatactl filestore prune -h
usage: suricatactl filestore prune [-h] -d DIRECTORY [--age AGE] [-n] [-v]
                                   [-q]

optional arguments:
  -h, --help            show this help message and exit
  -n, --dry-run         only print what would happen
  -v, --verbose         increase verbosity
  -q, --quiet           be quiet, log warnings and errors only

required arguments:
  -d DIRECTORY, --directory DIRECTORY
                        filestore directory
  --age AGE             prune files older than age, units: s, m, h, d
```
6 years ago
Shivani Bhardwaj 2b05f315e1 suricatactl: Fix PyLint issues
Pylint is a tool to make sure we do not regress the support for Python
3. The following conventions, warnings, errors, refactors have been
fixed.

W0301: Unnecessary semicolon (unnecessary-semicolon)
C0303: Trailing whitespace (trailing-whitespace)
W1401: Anomalous backslash in string
C0103: Variable name doesn't conform to snake_case naming style
R1705: Unnecessary "elif" after "return"
W1201: Specify string format arguments as logging function parameters
W0611: Unused import
R1710: Either all return statements in a function should return an expression, or none of them should
W0612: Unused variable
C0103: Method name doesn't conform to snake_case naming style
R0201: Method could be a function
6 years ago
Shivani Bhardwaj ccea7fe50a suricatactl: Make code compatible with Python 3
Call to suricatactl was failing with Python3 with the following error:
```
Traceback (most recent call last):
  File "bin/suricatactl", line 40, in <module>
    sys.exit(main())
  File "./suricata/ctl/main.py", line 50, in main
    args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'
```
Fix this by making it run with Py3 just like it does with Py2.

Closes redmine ticket #2793
6 years ago
Victor Julien c47164ebc8 doc: add table for custom values of eve/http 6 years ago
Victor Julien 74a42f683c eve/http: add proxy related custom headers 6 years ago
Victor Julien ac7ab4ef01 eve/http: fix custom header table 6 years ago
Victor Julien e99063b6b8 smtp: minor code cleanup and debug addition 6 years ago
Victor Julien bf905bcbca checksum: use u64 types 6 years ago
Victor Julien 02ba360903 ips/stream: handle low mem(cap) crash
In low memory or memcap reached conditions a crash could happen in
inline stream detection.

The crash had the following path:

A packet would come in and it's data was added to the stream. Due
to earlier packet loss, the stream buffer uses a stream buffer block
tree to track the data blocks. When trying to add the current packets
block to the tree, the memory limit was reached and the add fails.

A bit later in the pipeline for the same packet, the inline stream
mpm inspection function gets the data to inspect. For inline mode
this is the current packet + stream data before and after the packet,
if available.

The code looking up the packets data in the stream would not
consider the possibility that the stream block returned wasn't
the right one. The tree search returns either the correct or the
next block. In adjusting the returned block to add the extra stream
data it would miscalculate offsets leading to a corrupt pointer to the
data.

This patch more carefully checks the result of the lookup, and
falls back to simply inspecting the packet payload if the lookup
didn't produce the expected result.

Bug 2842.

Reported-by: Ad Schellevis <ad@opnsense.org>
6 years ago
Victor Julien ff920472f6 stream-buffer: fix block search compare func
Sbb search function could return the wrong block due to an off by
one error.
6 years ago
Victor Julien c306c02f8f stream-buffer: fix streaming buffer size issue
It was using buffer size instead of the real usage of the buffer.
6 years ago
Victor Julien 034724ec72 flow-manager: improve thread shutdown loops 6 years ago
Victor Julien 8a9cbb37a0 threads: move sleep macros into common header 6 years ago
Victor Julien 7b3e1d5354 github: update codeowners 6 years ago
Victor Julien aab03dde87 mpm/ac-ks: rename files from -tile to -ks 6 years ago
Victor Julien 6fcd2db043 tile: remove files 6 years ago
Victor Julien 3f253cb8c0 mpm: rename internal id for ac-tile to ac-ks 6 years ago
Victor Julien 2bd23bc1d5 detect/pcre: fix false positive
Fix case where a HTTP modifier in PCRE statements would lead to
the rule alerting when it should not.

Bug #2769
6 years ago
Victor Julien 43698a975a decoder: improve stats hash error handling 6 years ago
Victor Julien 517b45ea2d netmap: switch to nm_* API
Process multiple packets at nm_dispatch. Use zero copy for workers
recv mode.

Add configure check netmap check for API 11+ and find netmap api version.

Add netmap guide to the userguide.
6 years ago
magenbluten 1378f376a1 filestore v2: print sid in json output 6 years ago
Travis Green 1743cf5dcd engine-analysis: add support for http_host buffer
Add support for http_host buffer for more accurate reporting.
Bug: #2798
6 years ago
Eric Leblond 699fd6cbd7 configure: rust support requires Python
Add error message to warn the user.
6 years ago
Alexander Gozman 2869f8a746 nfqueue: more descriptive queue names (e.g. 'NFQ#1' instead of '1')
This will also make 'iface-list' output more informative.
6 years ago
Alexander Gozman 86d7dddfab nfqueue: added received packets counter for 'iface-stat' command
Previously nfqueue did not update received packets counter in a
livedev so 'iface-stat' UNIX-socket command always showed zeros.
6 years ago
Victor Julien dadac4ae4f eve/fileinfo: don't alloc filename during logging 6 years ago
Victor Julien 7e1235c9c8 eve/ftp: don't alloc memory to log filename 6 years ago
Victor Julien 3749caadd7 eve/http: use stack for buffer to string conversions 6 years ago
Victor Julien 20f9b0d9c6 byte: add bytes to string w/o allocation 6 years ago
Mats Klepsland d62d33cdff app-layer-ssl: check that cipher suites length is divisible by two
Cipher suites length should always be divisible by two. If it is a
odd number, which should not happen with normal traffic, it ends up
reading one byte too much.
6 years ago
Mats Klepsland 22d8fc802e util-ja3: fix AddressSanitizer heap-buffer-overflow
No resizing is done in Ja3BufferResizeIfFull() when the buffer is
empty. This leads to a potential overflow when this happens, since
a ',' is appended even when the buffer is empty.

Bug #2762
6 years ago
Victor Julien 932e5dedc2 windows: msys/mingw based appveyor support
Add rust but have it disabled as it is broken.

Add windivert, winpcap and npcap builds.

Run unittests on one of the builds.

Use reasonably strict CFLAGS.
6 years ago
Victor Julien d143ac6e89 windows/syscall: fix unused function warning 6 years ago
Victor Julien 759040a75a windows/syscall: convert file to use unix newlines
ran: dos2unix src/win32-syscall.[ch]
6 years ago
Victor Julien bae83e61f8 configure: support msys target 6 years ago
Victor Julien d522746c01 windows: fix sc_log_stream_lock handling 6 years ago
Victor Julien 7811498d49 windows: allow multiple pcap devices on commandline
Ticket #2774
6 years ago
Victor Julien 3d4d2ecc0e ips: set host mode only after engine mode
Make sure it is set after the final engine mode update.
6 years ago
Victor Julien 0a106fe2ea stream: fix 'stream.inline=auto' for L2 IPS
Make sure the livedev setup is finalized before initializing the
stream engine.

Bug #2811

Reported-by: Ad Schellevis
6 years ago
Victor Julien f98b5ecd6a flow: log gap state per direction 6 years ago
Victor Julien 2a3cb32071 stream: no more stream events after known issue
No longer set stream events after a gap or wrong thread. We know
we lost sync and are now in 'lets make the best of it'-mode. No
point in flooding the system with stream events.

Ticket #2484
6 years ago
Shivani Bhardwaj b0b12021d3 suricatasc: Fix command failures
This commit addresses the following three cases:

1. Do not use maxsplit keyword arg
maxsplit argument to the split command was not a part of Python 2
and using it with Python 2 causes the following failure:
```
TypeError: split() takes no keyword arguments
```
Avoid this by eliminating all the named arguments from split.

2. Fix failure on extra arguments
Up until now, suricatasc fails if any command which is not supposed to
take args is given args.
Fix this by ignoring any extra params.
Closes redmine ticket #2813

3. Fix failure on different type of args
If a command was given a string argument where it expected an int, it
would fail and the process would exit.
Fix this by handling the exception caused in such cases.
Closes redmine ticket #2812
6 years ago