Commit Graph

17 Commits (823f6b35d05b7ecc0218d2de788ba8970096891c)

Author SHA1 Message Date
Jeff Lucovsky 823f6b35d0 filestore: Validate stream-depth when non-zero
Make sure that configured non-zero values for stream-depth are
greater than stream_config.depth
6 years ago
Jeff Lucovsky ac70d925f5 filestore: Correct Coverity RESOURCE_LEAK issue
This commit corrects the RESOURCE_LEAK issue (CID 1465222) of the `FILE`
pointer.
6 years ago
Jason Ish fb7ee888bc fileinfo-filestore/eve: convert to jsonbuilder 6 years ago
Jason Ish ca88e4d0e3 filestore v1: remove
File store v1 has been deprecated and was scheduled for removal
by June 2020.

Log an error if a file-store configuration is loaded without
version set to 2.
7 years ago
Victor Julien 3ba4afd40b threads: make thread local storage manadatory
Support either the __thread GNUism or the C11 _Thread_local.

Use 'thread_local' to point to the one that is used. Convert existing
__thread user to 'thread_local'.

Remove non-thread-local code from the packet pool code.
7 years ago
Jeff Lucovsky 9631808b04 output/filestore: announce provided features 7 years ago
Jason Ish 9d8eb7b5f0 filestore: remove jansson ifdefs
Jansson is now required.
8 years ago
Jason Ish 961931e73a filestore: fix compiler truncation warnings
And error out if the constructed filename is truncated.
8 years ago
Victor Julien f97bf298b2 coverity: fix filestore v2 memleak 8 years ago
Jason Ish cf33c9975a filestore: fix truncation warnings 8 years ago
Maurizio Abba 2543930d74 xff: Use XFF configuration in eve and filestore
XFF configuration is already set in app-layer-htp-xff, and in
output-json-alert. Extending XFF configuration to files and HTTP allow
to get the same behavior as for alerts.

Extend the configuration of filestore json to let filestore metafile
dump be aware of xff. This is available only if write-fileinfo is set
to yes and file-store version is 2.
9 years ago
Eric Leblond 1012fc4466 file: update logger API to log direction
By adding the flow direction to the logger we can have an accurate
logging of fileinfo events that has source and destination IP
correctly set.
9 years ago
Victor Julien d05355db3d filestore: minor cleanups and warning fixes 9 years ago
Jason Ish aa0760a8d5 filestore: only allow one filestore to be enabled
There is probably not too much bad about enabling both, but
open file counts can get messy with both enabled. And v1
should be schedule for deprecation soon enough.
9 years ago
Jason Ish 9b1d268071 filestore2: warn once for file errors
Track each type of error warning and only log it once. Also create
a new stat, file_store.fs_errors to count each file system type
error (open, rename, unlink).

Also remove exit stats, they are of limited value.
9 years ago
Jason Ish f7c3f30186 filestore v2: use fileinfo records as metadata
As fileinfo records are logged to the main eve log, disable
metadata by default. But when enabled, just use the fileinfo
record.

Metadata is stored in a file named:
  <sha256>.<seconds>.<file_id>.json

where the sha256 is the same as the file logged, the seconds
is the unix timestamp in seconds for the fileinfo record,
and the file_id is an atomically incremented integer per
Suricata instance.

This should allow for each occurrence of the same file to have
its own metadata file. But a collision is expected when running
Suricata repeatedly over the same pcap, as that would be the
exact same occurrence of a file.
9 years ago
Jason Ish 4a97315057 filestore v2 - initial version
Filestore v2 is starts as a copy of log-filestore with the
following changes.

- NSS is required as file names as based on the SHA256.
- Work/tmp files are stored in a temp. directory, then
  moved into a directory tree where the directory names
  are the first 2 characters of the hex SHA256.
- Removes the need for a waldo file or pid in the filenames.
9 years ago