]>
git.ipfire.org Git - thirdparty/suricata.git/log
Victor Julien [Fri, 15 May 2020 07:57:42 +0000 (09:57 +0200)]
smb: fix 'dangling' files in lossy sessions
In case of lossy connections the SMB state would properly clean up
transactions, including file transactions. However for files the
state was never set to 'truncated', leading to files to stay 'active'.
This would lead these files staying in the SMB's state. In long running
sessions with lots of files this would lead to performance and memory
use issues.
This patch cleans truncates the file that was being transmitted when
a file transaction is being closed.
Victor Julien [Sun, 17 May 2020 12:24:07 +0000 (14:24 +0200)]
smb: check post-gap timeouts once a second at most
Victor Julien [Sun, 17 May 2020 12:48:52 +0000 (14:48 +0200)]
smb: update ts only if it changed
Jeff Lucovsky [Thu, 2 Jul 2020 14:01:12 +0000 (10:01 -0400)]
output/tftp: Convert to JsonBuilder
This commit converts the TFTP logging mechanisms to JsonBuilder.
Philippe Antoine [Sat, 2 May 2020 13:55:23 +0000 (15:55 +0200)]
signature: fix linked list for bidirectional signatures
Bidirectional signatures are really two signatures with one id
This needs to be handled with care when changing a linked list
Philippe Antoine [Fri, 19 Jun 2020 07:34:46 +0000 (09:34 +0200)]
detect: fail properly on invalid transform pcrexform
Antti Tönkyrä [Fri, 26 Jun 2020 10:37:45 +0000 (10:37 +0000)]
detect/flowbits: fix stack overflow in analyzer
Fix stack overflow in DetectFlowbitsAnalyze.
Use dynamically allocated array instead of stack and free
it after it is no longer needed.
Jason Ish [Wed, 1 Jul 2020 15:55:53 +0000 (09:55 -0600)]
netflow/eve: convert to JsonBuilder
Jeff Lucovsky [Wed, 17 Jun 2020 14:15:41 +0000 (10:15 -0400)]
doc: Correct typos
Jeff Lucovsky [Wed, 17 Jun 2020 14:15:06 +0000 (10:15 -0400)]
doc: Update byte_extract doc
Jeff Lucovsky [Fri, 12 Jun 2020 12:37:51 +0000 (08:37 -0400)]
doc: Fix spelling error
Jeff Lucovsky [Fri, 12 Jun 2020 12:37:23 +0000 (08:37 -0400)]
general: Fix spelling error
Jeff Lucovsky [Thu, 11 Jun 2020 13:08:42 +0000 (09:08 -0400)]
detect/content: Validate content byte array
This commit checks whether the content byte array is compatible with the
transforms, if any, for the rule.
Jeff Lucovsky [Thu, 11 Jun 2020 13:07:43 +0000 (09:07 -0400)]
detect: Add transform validation api
This commit extends the API with a function that validates arguments
against the transforms for the SM list (if any).
Jeff Lucovsky [Thu, 11 Jun 2020 13:05:08 +0000 (09:05 -0400)]
detect/transform: Add validation function
This commit adds a function to pre-validate buffers. If a content
buffer contains whitespace, the validation fails.
Jeff Lucovsky [Thu, 11 Jun 2020 12:31:55 +0000 (08:31 -0400)]
detect/transform: Add transform "validate" function
This commit adds an (optional) entry for a validation function. The
validation function, if present, will be used during rule processing.
Its role is to determine if the arguments are compatible with the
transform. E.g., a content string of "this string has whitespace" is not
compatible with the `strip_whitespace` transform.
Jason Ish [Mon, 29 Jun 2020 17:11:36 +0000 (11:11 -0600)]
dhcp/eve: remove erroneous jsonbuilder close
The JsonBuilder was being closed to early.
Jason Ish [Mon, 29 Jun 2020 17:10:40 +0000 (11:10 -0600)]
jsonbuilder: add debug_validate to state
If debug validation is enabled, panic on invalid state errors.
For example, calling close on an already closed jsonbuilder
object.
Jason Ish [Mon, 29 Jun 2020 17:09:16 +0000 (11:09 -0600)]
rust: macro debug_validate_fail to fail with message
Add a new debug_validate macro that unconditionally panics
with a message. Useful in Rust pattern matching.
Jeff Lucovsky [Mon, 29 Jun 2020 13:54:15 +0000 (09:54 -0400)]
output/fileinfo: Optimize filename output
This commit optimizes the JSON preparation of the file name by
eliminating the temporary copy before adding to the Json builder buffer.
Jeff Lucovsky [Mon, 29 Jun 2020 13:51:35 +0000 (09:51 -0400)]
output/rdp: Include common output options
This commit will cause common metadata values and the community id to be
included in log output when configured.
Jeff Lucovsky [Mon, 29 Jun 2020 13:50:53 +0000 (09:50 -0400)]
output/dhcp: Include common output options
This commit will cause common metadata values and the community id to be
included in log output when configured.
Jeff Lucovsky [Mon, 29 Jun 2020 13:50:21 +0000 (09:50 -0400)]
output/smb: Include common output options
This commit will cause common metadata values and the community id to be
included in log output when configured.
Jeff Lucovsky [Mon, 29 Jun 2020 13:48:20 +0000 (09:48 -0400)]
output/tftp: Include common options
This commit will cause common metadata values and the community id to be
included in log output when configured.
Angelo Mirabella [Tue, 16 Jun 2020 09:04:06 +0000 (10:04 +0100)]
detect/http_raw_header: Correct type mismatch
This changeset fixes a bug on the computation of the buffer
lenght for raw http headers. The bug is due to a mismatch
on the data type of the length (uint8_t vs uint32_t) and it
was causing signature misses.
Victor Julien [Sun, 14 Jun 2020 08:56:43 +0000 (10:56 +0200)]
doc/manpage: improve intro, add examples
Victor Julien [Sat, 13 Jun 2020 21:39:56 +0000 (23:39 +0200)]
rule/parse: minor action parsing cleanup
Victor Julien [Sat, 13 Jun 2020 21:36:28 +0000 (23:36 +0200)]
doc/manpage: add --reject-dev option
Victor Julien [Sat, 13 Jun 2020 21:36:13 +0000 (23:36 +0200)]
doc/userguide: update app-proto list
Victor Julien [Sat, 13 Jun 2020 21:35:40 +0000 (23:35 +0200)]
doc/userguide: list valid rule actions
Victor Julien [Sat, 13 Jun 2020 15:20:14 +0000 (17:20 +0200)]
reject: support single vlan layer
Support sending RST/ICMP errors for packet with a single VLAN header.
Victor Julien [Fri, 12 Jun 2020 13:52:00 +0000 (15:52 +0200)]
reject: get MTU for reject-dev and use it
Victor Julien [Fri, 12 Jun 2020 10:16:47 +0000 (12:16 +0200)]
reject: minor optimization of reset entry code
Victor Julien [Fri, 12 Jun 2020 10:14:01 +0000 (12:14 +0200)]
reject: remove L3 from function names
Victor Julien [Thu, 11 Jun 2020 09:27:29 +0000 (11:27 +0200)]
reject: allow configuration of the reject interface
Using the '--reject-dev <dev>' commandline option. This is a global option
that applies to all 'reject' actions.
If the interface specified is using ethernet, libnet will use the faster
L2 (link) layer. Suricata sets up the ethernet header based on the packet.
When the interface is specified, cache libnet_t ctx for (much) better
performance.
Victor Julien [Fri, 12 Jun 2020 13:51:30 +0000 (15:51 +0200)]
reject: don't respond to tunnel packets
Victor Julien [Thu, 11 Jun 2020 09:31:21 +0000 (11:31 +0200)]
reject: check tcp header sooner to avoid potential leak
Victor Julien [Mon, 9 Feb 2015 07:36:07 +0000 (08:36 +0100)]
reject: optimize and simplify run test
Victor Julien [Thu, 11 Jun 2020 07:22:10 +0000 (09:22 +0200)]
reject: never return error
Errors by thread modules are not handled.
Jason Ish [Fri, 26 Jun 2020 17:45:38 +0000 (11:45 -0600)]
file-hash-common: fix rule_file truncation
Loading file hash lists uses dirname(3) on the
de_ctx->rule_file which modifies the contents,
removing the last part of the path. So on subsequent
calls the rule_file no longer contains the rule_file,
but instead just the directory name.
Mostly noticed when using "-S" with rule files outside
of the default-rule-path which requires more hunting for
the rule file.
Jeff Lucovsky [Sun, 14 Jun 2020 14:17:43 +0000 (10:17 -0400)]
output/ftp: Use "Eve" prefix with FTP helpers
This commit changes the prefix of the FTP helper routines from Json to
Eve.
Jeff Lucovsky [Sat, 6 Jun 2020 18:06:43 +0000 (14:06 -0400)]
output/eve: Remove unused helper function
This commit removes an unused helper function no longer required/used
after conversion to JsonBuilder.
Jeff Lucovsky [Sat, 6 Jun 2020 18:05:39 +0000 (14:05 -0400)]
ftp/eve: Convert FTP logging to use JsonBuilder
This commit converts the FTP logging mechanisms to use JsonBuilder.
Shivani Bhardwaj [Sat, 6 Jun 2020 16:37:01 +0000 (22:07 +0530)]
smb/eve: convert to jsonbuilder
Closes redmine ticket 3712.
Jeff Lucovsky [Fri, 12 Jun 2020 14:13:10 +0000 (10:13 -0400)]
output/anomaly: Use helpers for string output
Jeff Lucovsky [Fri, 12 Jun 2020 14:12:15 +0000 (10:12 -0400)]
output/flow: Use helpers for string output
Jeff Lucovsky [Thu, 4 Jun 2020 12:37:12 +0000 (08:37 -0400)]
output/json: Include fileinfo in alerts
This commit adds fileinfo to alerts when `metadata` is configured.
Jeff Lucovsky [Sat, 13 Jun 2020 12:08:28 +0000 (08:08 -0400)]
json: macro for setting formatted false value
Jeff Lucovsky [Thu, 4 Jun 2020 11:45:05 +0000 (07:45 -0400)]
output/json: Refactor file output helper
This commit creates a common file output helper function based on the
logic in output-file-info.c:BuildBuildFileInfoRecord
The refactored helper will be used to create "fileinfo" information
during the alert output path.
Shivani Bhardwaj [Wed, 17 Jun 2020 13:11:51 +0000 (18:41 +0530)]
util: check if parsed data is in range
Shivani Bhardwaj [Sat, 21 Dec 2019 08:37:58 +0000 (14:07 +0530)]
src: remove multiple uses of atoi
atoi() and related functions lack a mechanism for reporting errors for
invalid values. Replace them with calls to the appropriate
ByteExtractString* and StringParse* functions.
Partially closes redmine ticket #3053.
Shivani Bhardwaj [Sat, 20 Jun 2020 14:39:17 +0000 (20:09 +0530)]
affinity: Convert nb_threads to uint32_t
Shivani Bhardwaj [Fri, 26 Jun 2020 06:59:23 +0000 (12:29 +0530)]
napatech: make stream_id uint8_t
Shivani Bhardwaj [Tue, 12 May 2020 18:50:37 +0000 (00:20 +0530)]
redis: Change port type to uint16_t
Jason Ish [Tue, 16 Jun 2020 14:04:49 +0000 (08:04 -0600)]
rust: lock to nom 5.1.1
5.1.2 pulls in dependencies that don't build on Rust 1.34.
Victor Julien [Tue, 26 May 2020 08:35:34 +0000 (10:35 +0200)]
app-layer: remove old MPMId API calls
Had been deprecated and non-functional since 2017.
Jason Ish [Mon, 8 Jun 2020 18:28:02 +0000 (12:28 -0600)]
json: macros for setting formatted true and string values
JB_SET_TRUE(jb, key), and JB_SET_STRING(string, key, val) are C macros
around jb_set_formatted to set static string and true values as a
(micro) optimization.
Jason Ish [Mon, 8 Jun 2020 18:27:05 +0000 (12:27 -0600)]
jsonbuilder: setter for formatted data
Create a method to set preformatted data that contains the key
and the value already formatted.
This is an optimization for static data.
Jason Ish [Mon, 8 Jun 2020 17:11:28 +0000 (11:11 -0600)]
jsonbuilder: export {set,append}_string_from_bytes to C
Jason Ish [Mon, 8 Jun 2020 16:57:00 +0000 (10:57 -0600)]
jsonbuilder: use Box::from_raw instead of transmute to free
I think this is a bad use of transmute, while the end result
is the same, Box::from_raw is more correct as we created this
pointer with Box::into_raw.
Philippe Antoine [Fri, 1 May 2020 08:54:51 +0000 (10:54 +0200)]
signature: adds file flag for file_data keyword
So that SigValidate can check if a protocol not supporting
files was set after this keyword
Philippe Antoine [Sat, 6 Jun 2020 20:02:26 +0000 (22:02 +0200)]
ssh/eve: convert to jsonbuilder
Jeff Lucovsky [Sat, 2 May 2020 14:09:12 +0000 (10:09 -0400)]
doc: Improve tos description
This commit improves the description of the `tos` keyword by emphasizing
that the value used should adhere to the guidelines in RFC2474. Instead
of specifying the DSCP value directly, right shift the DSCP value and
use that.
Jeff Lucovsky [Mon, 24 Feb 2020 13:22:33 +0000 (08:22 -0500)]
doc: pcrexform documentation
Jeff Lucovsky [Sat, 7 Mar 2020 14:03:44 +0000 (09:03 -0500)]
detect: Register pcrexform
This commit registers the `pcrexform` transform.
Jeff Lucovsky [Mon, 24 Feb 2020 13:22:52 +0000 (08:22 -0500)]
transform/pcrexform: Add pcrexform source files
Jeff Lucovsky [Mon, 24 Feb 2020 13:19:05 +0000 (08:19 -0500)]
detect/pcrexform: New transform: applies RE
This commit adds a new transform -- pcrexform -- that applies a regular
expression to the transformation buffer. If an expression was captured,
that is output to the transformation buffer. Otherwise, the
transformation buffer is unchanged.
Jeff Lucovsky [Sat, 7 Mar 2020 14:03:01 +0000 (09:03 -0500)]
detect: Add constant for new transform
This commit adds the definition of the new `pcrexform` transform.
Jeff Lucovsky [Fri, 31 Jan 2020 15:21:57 +0000 (10:21 -0500)]
detect/transform: Support transform options
This commit adds support for transform-specific options. During Setup,
transforms have the signature string available for options detection.
When a transform detects an option, it should convert the option into an
internal format and supply a pointer to this format as the last argument
to DetectSignatureAddTransform.
Transforms that support options must provide a function in their
Sigmatch table entry. When the transform is freed, a pointer to the
internal format of the option is passed to this function.
Jeff Lucovsky [Fri, 31 Jan 2020 14:59:29 +0000 (09:59 -0500)]
general: Correct typos
Jeff Lucovsky [Fri, 31 Jan 2020 14:57:23 +0000 (09:57 -0500)]
general: Update copyright year
Emmanuel Thompson [Tue, 28 Apr 2020 18:03:26 +0000 (14:03 -0400)]
detect/asn1: Fix relative_offset keyword option
- Fix relative_offset keyword option to be relative in regards to the
last content match
- Change relative_offset to int32_t with bounds check to allow the full
range of the packet buffer size (uint16_t)
- Added checks for over/underflows
- Changed the offset type to uint16_t because the offset is applied to
the payload length, which is a uint16_t
- Adjusted test cases to work relative to the content match
- Added test case to verify bounds
Eric Leblond [Thu, 23 Jan 2020 12:30:29 +0000 (13:30 +0100)]
redis: ensure a dump per second
In sync mode, Suricata was waiting to have batch size alerts before
logging them. This was introducing delay in some configuration with
low traffic.
Eric Leblond [Thu, 23 Jan 2020 12:10:44 +0000 (13:10 +0100)]
redis: fix reconnect in batch mode
In case of redis outage, the redis session was reset but the replies
were still fetch even if there is none replies in the new session.
Eric Leblond [Fri, 29 May 2020 10:08:31 +0000 (12:08 +0200)]
redis: add support for unix socket
If there is a '/' in the redis server string then we consider that
the connection should be done other a unix socket.
Joshua Lumb [Wed, 3 Jun 2020 12:24:40 +0000 (08:24 -0400)]
cmdline: --list-app-layer-protos respects -c arg
Victor Julien [Thu, 4 Jun 2020 20:50:38 +0000 (22:50 +0200)]
htp: enforce body limits more exact
Victor Julien [Fri, 5 Jun 2020 05:24:40 +0000 (07:24 +0200)]
eve/alert: convert decoder event logging to jsonbuilder
Victor Julien [Fri, 5 Jun 2020 05:14:20 +0000 (07:14 +0200)]
eve/anomaly: don't add timestamp twice
Timestamp is added unconditionally by CreateEveHeader(), so no need
to have a local timestamp in case of non-IP packets.
Victor Julien [Fri, 5 Jun 2020 04:58:55 +0000 (06:58 +0200)]
eve/alert: clean up decoder event logging
Victor Julien [Thu, 4 Jun 2020 12:28:59 +0000 (14:28 +0200)]
eve/nfs: switch output to jsonbuilder
Giuseppe Longo [Thu, 4 Jun 2020 19:20:23 +0000 (21:20 +0200)]
jsonbuilder: fix build error
Clang's build in travis-ci is actually failing because of this error:
output-json-alert.c:476:40: error: missing field 'state_index' initializer
[-Werror,-Wmissing-field-initializers]
JsonBuilderMark mark = { 0 };
Jason Ish [Tue, 2 Jun 2020 17:01:42 +0000 (11:01 -0600)]
userguide: remove old drop-log documentation
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2381
Jason Ish [Tue, 2 Jun 2020 16:58:09 +0000 (10:58 -0600)]
drop-log: remove drop log (deprecated)
Remove the old style line based drop log.
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2381
Jason Ish [Tue, 2 Jun 2020 16:19:37 +0000 (10:19 -0600)]
userguide: RDP now enabled by default
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3255
Jason Ish [Tue, 2 Jun 2020 16:16:17 +0000 (10:16 -0600)]
rdp: enable by default
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3255
Jason Ish [Tue, 2 Jun 2020 16:08:23 +0000 (10:08 -0600)]
userguide: SIP now enabled by default
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3256
Jason Ish [Tue, 2 Jun 2020 16:08:32 +0000 (10:08 -0600)]
sip: enable by default
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3256
Phil Young [Mon, 1 Jun 2020 15:02:49 +0000 (11:02 -0400)]
Napatech: Fix network byte order when comparing addresses
This fixes an issue where the "endieness" was not properly accounted for
when comparing two IPv4 addresses to be sorted.
Phil Young [Mon, 1 Jun 2020 15:01:06 +0000 (11:01 -0400)]
Napatech: Change to use separate FlowStream handle for each thread
Previously a single handle to the FlowStream (which is used to program
flows to the card) was shared between the threads. This resulted
in contention between the threads where sometimes programming the flow would
silently fail.
Victor Julien [Tue, 12 May 2020 08:19:55 +0000 (10:19 +0200)]
doc/userguide: add IPS with BPF info, minor cleanups
Victor Julien [Sat, 23 May 2020 13:12:45 +0000 (15:12 +0200)]
eve: print interface info for vxlan and other tunnel pkts
Jason Ish [Tue, 2 Jun 2020 14:28:15 +0000 (08:28 -0600)]
github-ci: allow pull-request to be referenced in pr body
For example, to use suricata-verify pr #239:
suricata-verify-pr: 239
Also update the pull request template to contain the available
parameters that can be set.
Jason Ish [Fri, 22 May 2020 17:26:53 +0000 (11:26 -0600)]
rfb/eve: convert to jsonbuilder
Jason Ish [Thu, 21 May 2020 19:11:17 +0000 (13:11 -0600)]
smtp/eve: convert to jsonbuilder
Jason Ish [Thu, 21 May 2020 19:06:50 +0000 (13:06 -0600)]
jsonbuilder: add reset marks
Add methods to get the state of a JsonBuilder (called a mark),
then allow restoring to the mark.
Jason Ish [Mon, 4 May 2020 20:20:33 +0000 (14:20 -0600)]
anomaly/eve: convert to jsonbuilder
Jason Ish [Mon, 4 May 2020 20:01:12 +0000 (14:01 -0600)]
tls/eve: convert to jsonbuilder
Jason Ish [Mon, 4 May 2020 18:14:36 +0000 (12:14 -0600)]
http/eve: remove jansson version of metadata logger
With fileinfo converted over to JsonBuilder, these
Jansson versions are no longer needed.
Jason Ish [Mon, 4 May 2020 18:07:18 +0000 (12:07 -0600)]
fileinfo-filestore/eve: convert to jsonbuilder