Commit Graph

16358 Commits (1591ad4408a68f86b4c928ed33993a64686ba637)
 

Author SHA1 Message Date
Philippe Antoine bce8f4b853 detect/ssh: remove deprecated keywords
Ticket: 2377
2 years ago
Philippe Antoine 0a1062fad2 detect/mqtt: move keywords to rust
Ticket: 4863

On the way, convert some keywords to use the first-class integer
support.
And helpers for pure rust the support for multi-buffer.

Move the C unit tests about keyword mqtt.protocol_version
to unit tests for generic integer parsing, and test version 5
instead of testing twice version 3.

Also iterate all tx's messages for reason code as is done for other
keywords.

And allow detection on empty topics.
2 years ago
Philippe Antoine f4e7d1e217 detect: helper function for multibuffer registration
So that rust does not need to know about SIG_FLAG_TOCLIENT value
2 years ago
Philippe Antoine 4e074b8f38 output/alert: remove now unused include
Including the mqtt one, now that it is almost rust only
2 years ago
Philippe Antoine ad08309c75 mqtt: parse and store raw connect flags
for easier later matching
2 years ago
Philippe Antoine 9adf4224e4 rust/derive: string enumeration become case insensitive
As needed for MQTTTypeCode which accepts both CONNECT uppercase
and unassigned lowercase
2 years ago
Philippe Antoine 3c5ad7a23d rust/derive: transform all uppercase names the right way
So that MQTTTypeCode::CONNECT does not become c_o_n_n_e_c_t
2 years ago
Philippe Antoine daad7f2d41 detect/integers: harmonize parser return handling
Ticket: 7172

When parsing an integer for a rule keyword fails, we return error
straight away, without bothering to try to free the NULL pointer.

On the way, remove some one-line wrapper around DetectUxParse
2 years ago
Jason Ish fcc1b1067b eve/dns: make version required
The "eve.version" field is not always logged. Update the schema to
enforce that it is, and fix it for records that don't log it.

Ticket: #7167
2 years ago
Jason Ish 6d5022cd1e github-ci: pf-ring build 2 years ago
Jason Ish 5f516c5896 doc: add pf-ring plugin upgrade notes
Ticket: #7162
2 years ago
Jason Ish 4d0e09c6b2 configure: fail on --enable-pfring and --disable-shared
Plugins can't be build using the standard autoconf/automake
methods. We can get around this by creating our own Makefiles, but
they're often less portable.

For now, fail during ./configure instead of during compile.
2 years ago
Jason Ish b318e78b3a pf-ring: bring back command line arguments
Bring back the pf-ring command line arguments, but instead of
initializing the pfring runmode, initialize the capture plugin runmode
with a plugin named "pfring".

Ticket: #7162
2 years ago
Jason Ish 1173bb788e .gitignore: globally ignore .la files
With automake and libraries, these files are creeping in.
2 years ago
Jason Ish 155501f250 pf-ring: load plugin by default
Ticket: #7162
2 years ago
Jason Ish 79df4b4c89 pf-ring: add as plugin
Ticket: #7162
2 years ago
Jason Ish c3092b6e5a pf-ring: remove, to make room for plugin
Ticket: #7162
2 years ago
Victor Julien 223a4194ea config: switch default config to IEEE 1541 notation 2 years ago
Victor Julien 342aec8f1c parse/size: support IEEE 1541 size units
Introduce KiB, MiB and GiB. They are case sensitive as a lower case 'b'
means bits in the IEEE 1541 scheme.

KiB = 1024
MiB = 1048576
GiB = 1073741824

Ticket: #1457.
2 years ago
Victor Julien 0e03691fdb parse/size: fix unit test checks 2 years ago
Jason Ish ca6e73830c suricata.yaml: set dns log version to 3; link to docs
Missed in the original PR, but update the commented out version to
reflect the default, and a link to the upgrade notes.
2 years ago
Victor Julien 855cc89636 profiling: allow absolute paths
Ticket #6490.
2 years ago
Victor Julien a404fd26af tcp: fix 'broken ack' on flow timeout
Don't set an ACK value if ACK flag is no longer set. This avoids a bogus
`pkt_broken_ack` event set.

Fixes: ebf465a11b ("tcp: do not assign TCP flags to pseudopackets")

Ticket: #7158.
2 years ago
Shivani Bhardwaj f2de3e01cb src: remove truncate fn and glue code
truncate fn is only active and used by dcerpc and smb parsers. In case
stream depth is reached for any side, truncate fn is supposed to set the
tx entity (request/response) in the same direction as complete so the
other side is not forever waiting for data.

However, whether the stream depth is reached is already checked by
AppLayerParserGetStateProgress fn which is called by:
- DetectTx
- DetectEngineInspectBufferGeneric
- AppLayerParserSetTransactionInspectId
- OutputTxLog
- AppLayerParserTransactionsCleanup

and, in such a case, StateGetProgressCompletionStatus is returned for
the respective direction. This fn following efc9a7a, always returns 1
as long as the direction is valid meaning that the progress for the
current direction is marked complete. So, there is no need for the additional
callback to mark the entities as done in case of depth or a gap.
Remove all such glue code and callbacks for truncate fns.

Bug 7044
2 years ago
Shivani Bhardwaj 80159eb519 applayer: remove truncation logic
as its functionality is already covered by the generic code.
This removes APP_LAYER_PARSER_TRUNC_TC and APP_LAYER_PARSER_TRUNC_TS
flags as well as FlowGetDisruptionFlags sets STREAM_DEPTH flag in case
the respective stream depth was reached. This flag tells that whether
all the open files should be truncated or not.

Bug 7044
2 years ago
Philippe Antoine 090079cdd8 decode: fix -Wshorten-64-to-32 warnings
Ticket: #6186
2 years ago
Philippe Antoine eeb290384a flow: fix -Wshorten-64-to-32 warnings
Ticket: #6186
2 years ago
Philippe Antoine 9c0875b2a4 features: fix -Wshorten-64-to-32 warnings
Ticket: #6186
2 years ago
Philippe Antoine b5140c43ca counters: fix -Wshorten-64-to-32 warnings
Ticket: #6186
2 years ago
Philippe Antoine e0fd59a20d doc: state that payload-length includes the gaps 2 years ago
Philippe Antoine d28c646662 output/dcerpc: call jb_get_mark just before jb_open_object 2 years ago
Jason Ish 4d3d57249a doc: update dns section of the eve format documentation 2 years ago
Jason Ish d3c08b9643 doc: upgrade guide for dns logging changes
Bug: #6281
2 years ago
Jason Ish b32f6bf381 eve/dns: allow version to be set with environment variable
There is no sane way to set override the DNS eve version in Suricata
tests without using a copy of the configuration file, and many of the
tests by design use the configuration file of the Suricata under test,
so making a copy would break this assumption.

To get around this, respect the SURICATA_EVE_DNS_VERSION environment
variable as a way to set the version if not explicitly set in the
configuration file.
2 years ago
Jason Ish 575e5b471f dns: add v3 dns logging
DNS v3 logging fixes the discrepancies between request and response
logging with the main difference being queries always being placed in an
array.

Bug: #6281
2 years ago
Jason Ish df656324ba dns: new v3 style logging for alerts
V3 style DNS logging fixes the discrepancies between request and
response logging better dns records and alert records.

The main change is that queries and answers are always logged as
arrays, and header fields are not logged in array items.

For alerts this means that answers are now logged as arrays, queries
already were.

DNS records will get this new format as well, but with a configuration
parameter.

Bug: #6281
2 years ago
Nathan Scrivens 9ecc3573a7 dns: parse and populate OPT rdata struct
Feature: 7017
Add DNSRDataOPT struct and DNSRData enum type OPT.
Add OPT parsing function and test function.
Add DNSRData OPT type to lua.rs match.
Log OPT rdata.
2 years ago
Nathan Scrivens 4598ca164d dns log: add additional section
Feature: 7011
dns_log_json_answer: log additional section records.
update schema.json with new "additionals" section.
2 years ago
Nathan Scrivens 1cd89640ef dns parsing: add additional section
Feature: 7011
Add additionals to DNSMessage struct.
Add parsing logic to populate additional section data.
Patch dns tests to account for additional section parsing.
2 years ago
Sascha Steinbiss 53c62432c6 doc: update MQTT configuration 2 years ago
Sascha Steinbiss e047ad25e2 mqtt: run rustfmt 2 years ago
Sascha Steinbiss ad02040860 mqtt: enable limiting of logged message length
Ticket: #6984
2 years ago
Sascha Steinbiss dd972f72dd rust: add JsonBuilder::set_string_limited() 2 years ago
dependabot[bot] a28666db4e github-actions: bump actions/download-artifact from 4.1.4 to 4.1.8
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.4 to 4.1.8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.4...fa0a91b85d4f404e444e00e005971372dc801d16)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years ago
dependabot[bot] e83a1cf34c github-actions: bump actions/upload-artifact from 4.3.3 to 4.3.4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65462800fd...0b2256b8c0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years ago
Jeff Lucovsky 99f9451be3 detect: Use Option where appropriate
This commit uses Option instead of Result.

Issue: 6873
2 years ago
Jeff Lucovsky 70bdc37f96 detect/byte_extract: Move keyword parser to Rust
Implement the keyword parser in Rust.

Issue: 6873
2 years ago
Jeff Lucovsky 73dfc58772 detect/byte: Refactor endian, base
Issue: 6873

Refactor the enums for endian and base handling for broader use.
2 years ago
Philippe Antoine eeec609ac8 util/thash: decrease memuse if array was allocated
THashInitConfig may not allocate array and increase memuse.
Such a failure leads to THashShutdown which should not decrease
the memuse.

Ticket: 7135
2 years ago
Lukas Sismis 35dffc6b32 dpdk: replace TSC clock with GetTime (gettimeofday) function
Getting clock through Time Stamp Counter (TSC) can be precise and fast,
however only for a short duration of time.
The implementation across CPUs seems to vary. The original idea is to
increment the counter with every tick. Then dividing the delta of CPU ticks
by the CPU frequency can return the time that passed.
However, the CPU clock/frequency can change over time, resulting in uneven
incrementation of TSC. On some CPUs this is handled by extra logic.
As a result, obtaining time through this method might drift from the real
time.

This commit therefore substitues TSC time retrieval by the standard system
call wrapped in GetTime function - on Linux it is gettimeofday.

Ticket: 7115
2 years ago