Commit Graph

171 Commits (954e3e1f3ff9da4ee3ab3108f916a1df5e5548ec)

Author SHA1 Message Date
Philippe Antoine 02f2602dde src: rework includes as per cppclean 4 years ago
Eric Leblond faab853685 log/pcap and eve/alert: get pcap filename to support multi mode
This patch adds a function to get the current pcap file name that
will be used to current packet. This patch also  updates EVE
alerts to add pcap output filename when pcap capture is done in
multi or normal mode.
4 years ago
Eric Leblond b416a4455c stream: conditionally add packet header to segment
This patch optionally adds packet header to the TCP segment
and update the for each segment function by changing the
callback.

This patch is based on the work by Scott Jordan <scottfgjordan@gmail.com>
4 years ago
Eric Leblond 4cab5e5262 log/pcap: conditional logging
Add an option to only write to pcap packets with alerts and flow
that have alerted.
4 years ago
Victor Julien b50d5eb8c8 eve/alert: add pkt_src/pcap_cnt to tunnel
Makes it easier to correlate an alert to the original packet.
4 years ago
Philippe Antoine cfcade58ad http: move xff logging to alert object
Ticket: 4860

instead of root field
4 years ago
Victor Julien 27cd54dc0d frames: address coverity issue
Minor cleanups to assist coverity.

Bug: #5065.
5 years ago
Victor Julien c96d22e8a1 frames: support UDP frames
UDP frames point to the UDP packet payloads.

The frames are removed after each packet.

Ticket: #4983.
5 years ago
Emmanuel Thompson 7e51987263 quic: Add QUIC App Layer
Parses quic and logs a CYU hash for gquic frames
5 years ago
Victor Julien c0ec3984fa eve/alert: add support for logging frame
If detection was done in a frame, the frame will be added to the
eve.alert output.
5 years ago
Eric Leblond 264eddb81f output/alert: don't call basic logging twice
Issue: 4106
5 years ago
Jason Ish 6392216f6b base64: use the Rust base64 encode implementation
Replace our internal base64 implementation with a ffi wrapper
around the Rust implementation provided by an external crate.
5 years ago
Jason Ish 6d3dcf27a6 eve: use JsonBuilder for encoding base64
Replaces all usages of Base64Encode just before writing to a
JsonBuilder with jb_set_base64 and jb_append_base64.
5 years ago
Philippe Antoine 27dd0c6b3d eve/ftp-data: log alert metadata in ftp-data object
Ticket: 4860

instead of directly in root
5 years ago
Victor Julien 4c7eb64411 decode: convert 'action' macros to inline funcs
Make sure most common branch is handled first to assist branch
prediction.

Macros still play a small role to please our 'action' cocci check.
5 years ago
Simon Dugas a8a51dc004 modbus: add eve logging 5 years ago
Jason Ish 06f58650d6 eve: refactor OutputJsonBuilderBuffer to take context
All callers of OutputJsonBuilderBuffer are now calling it
using fields from an OutputJsonThreadCtx, so just pass
a pointer to the thread context now.
5 years ago
Jason Ish 08eee26d27 eve: convert many loggers to use generate thread context
- mqtt
- dnp3
- smtp
- ike
- dns
- alert
- tls
- anomaly
- drop
- file
- http
- http2
- templates
- dhcp

The idea is to factor out the commom code for setting
up the output file objects, which is repetitive, and
often done wrong when it comes to threading.
5 years ago
Jason Ish 06ba611667 eve cleanup: remove duplicate/redundant code
The first change was to have CreateEveHeader add the common options
as this was left out in a few loggers. While update all the loggers
that use CreateEveHeader, remove redundant code, in particular
from loggers that don't need to use their own context but
can use the generic one.
5 years ago
Sascha Steinbiss 37940180a8 ikev1: add metadata to alerts 5 years ago
Philippe Antoine 707f027231 protos: renaming ALPROTO_HTTP* constants
Having now ALPROTO_HTTP1, ALPROTO_HTTP2 and ALPROTO_HTTP

Run with 3 sed commands
git grep ALPROTO_HTTP | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP/ALPROTO_HTTP1/g'
git grep ALPROTO_HTTP12 | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP12/ALPROTO_HTTP2/g'
git grep ALPROTO_HTTP1_ANY | cut -d: -f1 | uniq |
 xargs sed -i -e 's/ALPROTO_HTTP1_ANY/ALPROTO_HTTP/g'

and then running clang-format
6 years ago
Shivani Bhardwaj ea0936199d output: use BASE64_BUFFER_SIZE macro
Base64Encode function requires the maximum length of the output string
as its last parameter. Use the macro BASE64_BUFFER_SIZE to calculate it
correctly.
6 years ago
Victor Julien a8fc481cd3 http2: avoid null pointer deref in alert output
Bug #4120.
6 years ago
Jeff Lucovsky c5ace81a27 log/eve: Rename fileinfo alert object to files
This commit changes the name of the "fileinfo" array in the alert object
to "files" to better support legacy use of "fileinfo" in reporting and
elsewhere.

The "fileinfo" event type is not an array while the alert "fileinfo"
member was.
6 years ago
Jeff Lucovsky ff29345527 output: Remove unused output functions
This commit removes registration, initialization, and de-initialization
functions no longer needed
6 years ago
Jeff Lucovsky 15caf3eea5 log: Remove standalone output registration
Remove standalone output logger registration since eve is
multi-instance.
6 years ago
Jason Ish f26d6eaf98 http2: log as http to abstract http and http2 a little
This commit logs http2 as an http event. The idea is to somewhat
normalize http/http2 so common info can be version agnostic.

This puts the http2 specific fields in an "http2" object inside
the "http" object.

HTTP2 headers/values that are in common with HTTP1 are logged
under the "http" object to be compatible with HTTP1 logging.
6 years ago
Philippe Antoine 1422b18a99 http2: initial support 6 years ago
Jason Ish fd5d8b78d0 alert/eve: add snmp metadata for rdp alerts
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3441
6 years ago
Jason Ish ef0ebc9550 alert/eve: add snmp metadata for snmp alerts
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/3441
6 years ago
Sascha Steinbiss c31360070b rust/mqtt: add MQTT parser 6 years ago
Jeff Lucovsky 30ae98f658 output/json: Multi-threaded EVE logging support
This commit modifies the JSON loggers with changes necessary to support
multi-threaded EVE output.

Each "thread-init" function sets up the per-thread log file context for
subsequent calls to the JSON output to buffer function.
6 years ago
Victor Julien a8e2399ea9 eve/metadata: create preformatted json string at start up
Avoid runtime overhead of assembling metadata json string by
pre-creating it at rule parsing time.
6 years ago
Jason Ish ccc057fdc9 dnp3/eve: convert to jsonbuilder (non generated code)
First step of converting DNP3 to JsonBuilder by first converting
the non-generated code.
6 years ago
Victor Julien c1673908ac eve/alert: minor cleanups 6 years ago
Victor Julien d2c48d4faf eve/alert: move files logging into util func 6 years ago
Victor Julien 3dacbcddef eve/alert: move app-layer logic into a util func 6 years ago
Jeff Lucovsky b2c1dab2da output/alert: Correct FORWARD_NULL Coverity issue.
This commit corrects the FORWARD_NULL issue in AlertJson by
null-checking p->flow
6 years ago
Jeff Lucovsky 648bd5afff output/ftp: Use "Eve" prefix with FTP helpers
This commit changes the prefix of the FTP helper routines from Json to
Eve.
6 years ago
Jeff Lucovsky 03de315bc2 ftp/eve: Convert FTP logging to use JsonBuilder
This commit converts the FTP logging mechanisms to use JsonBuilder.
6 years ago
Shivani Bhardwaj a7535099b4 smb/eve: convert to jsonbuilder
Closes redmine ticket 3712.
6 years ago
Jeff Lucovsky ff92745851 output/json: Include fileinfo in alerts
This commit adds fileinfo to alerts when `metadata` is configured.
6 years ago
Philippe Antoine baf5f52f22 ssh/eve: convert to jsonbuilder 6 years ago
Victor Julien 0db3ee26d0 eve/alert: convert decoder event logging to jsonbuilder 6 years ago
Victor Julien bd3fdeb53f eve/alert: clean up decoder event logging 6 years ago
Victor Julien b3b5802c85 eve/nfs: switch output to jsonbuilder 6 years ago
Giuseppe Longo cb7e72e602 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 };
6 years ago
Jason Ish 36d687580a rfb/eve: convert to jsonbuilder 6 years ago
Jason Ish 49f7dc93bd smtp/eve: convert to jsonbuilder 6 years ago
Jason Ish 037c449b85 tls/eve: convert to jsonbuilder 6 years ago