Commit Graph

17186 Commits (deb761367df0f98f00d35abce6cd1a6a8d0b32dd)
 

Author SHA1 Message Date
James deb761367d doc: Update bypass docs to use new keyword format
Ticket: #7143

Update documentation to reflect new sticky buffer keyword format
3 months ago
Victor Julien e3c6554ee6 detect/app-layer-protocol: allow matching on 'unknown' 3 months ago
Victor Julien 8f9c05243c firewall: detect: set firewall support flag on select keywords 3 months ago
Victor Julien f96e97205c firewall: detect: add feature flag for keywords supporting firewall 3 months ago
Victor Julien e6bd69b419 firewall: detect: set per rule table
For firewall mode, set the pseudo table in the rule and use this
in alert queue ordering, so that rule actions are applied in the
expected order:

        packet:filter -> packet:td -> app:filter -> app:td

This makes sure that a packet:td drop is applied before a app:filter
accept.
3 months ago
Victor Julien 1643b017b6 detect: don't set conflicting packet/flow actions
If for the same a packet a drop rule and a pass rule would match,
the applying of actions could be contradictionary:

- the drop would be applied to the packet
- the pass rule would also be considered, not overriding the drop,
  but still setting the flow pass flag.

This would lead to the packet being dropped, but the rest of the
flow getting passed, including retransmissions of the dropped
packet.

This patch only sets drop/pass actions if no conflicting action
has been set on the packet before. It respects the action-order.

Bug: #7653.
3 months ago
Victor Julien d6e61b6690 firewall: detect: add explanation 3 months ago
Victor Julien 49979587ce detect/alert: minor cleanup 3 months ago
Alice Akaki ca429ef5e3 detect: add email.url keyword
email.url matches on URLs extracted from an email
This keyword maps to the EVE field email.url[]
Supports multiple buffer matching
Supports prefiltering

Ticket: #7597
3 months ago
Jason Ish bea685bfcd rust/htp: remove authors; fix homepage
Remove the authors field as it is deprecated.

Update the repository page to the Suricata repository.

Remove the homepage, it can be found via the reposistory page.
3 months ago
Jason Ish e3a400a581 htp: rename to suricata-htp; allow publishing to crates.io
As the "suricata" crate depends on htp, we need to publish htp to
crates.io first, however "htp" name is already taken. So rename "htp" to
"suricata-htp".
3 months ago
Jason Ish b98b44a576 suricatactl: add description to Cargo.toml
For publishing to crates.io.
3 months ago
Jason Ish 0e65cccc09 rust: always update Cargo.lock.in
On a normal project where the Cargo.lock is checked in, it would be
normal to see an updated Cargo.lock in git status and the like. As we
use autoconf to generate this file, we should just copy it back to the
input file so we get the same convenience of seeing when it is
updated, which usually means it needs to be checked in.

However, to satisfy "make distcheck", only copy it if the input
template exists, if the input template does not exist we are in an out
of tree build.
3 months ago
Shivani Bhardwaj cff611a284 workflows: use aggressive-cleanup option w s-v
on the Fedora 41 + codecov job to avoid running out of disk space.
3 months ago
Jason Ish 87ce5ea8b5 configure: pickup pre-release versions from changelog
Pickup release versions like 8.0.0-beta1 and 8.0.0-rc1 from the
ChangeLog. This version is used in the generated documentation.
3 months ago
Victor Julien 95b079ae0d github-actions: f41 codecov improvements
Add missing gpg package.

Reduce disk space usage.
3 months ago
Victor Julien 88e96c9d49 detect/domain: move transform fully to rust 3 months ago
Victor Julien 679d25ccd2 detect/prefilter: fix coverity issue
** CID 1646448:  Null pointer dereferences  (NULL_RETURNS)
/src/detect-engine-prefilter.c: 944 in SetupNonPrefilter()

________________________________________________________________________________________________________
*** CID 1646448:  Null pointer dereferences  (NULL_RETURNS)
/src/detect-engine-prefilter.c: 944 in SetupNonPrefilter()
938                 const DetectBufferType *buf = DetectEngineBufferTypeGetById(de_ctx, list_id);
939                 /* for now, exclude app-layer-events, as they are not tied to a specific
940                  * progress value like other keywords. */
941                 SCLogDebug("list_id %d buf %p", list_id, buf);
942                 if (list_id == app_events_list_id)
943                     continue;
>>>     CID 1646448:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "buf", which is known to be "NULL".
944                 if (buf->packet) {
945                     SCLogDebug("packet buf");
946                     /* packet is handled below */
947                     pkt_non_pf = true;
948                 } else if (buf->frame) {
949                     for (DetectEngineFrameInspectionEngine *f = de_ctx->frame_inspect_engines;
3 months ago
Jason Ish 1f57bd2c1b log-pcap: error out if malloc fails for bpf filter 3 months ago
Jason Ish b23c96198d doc/userguide: type in pfring upgrade notes 3 months ago
Jason Ish 8b2fafcfa2 version: start development towards 8.0.0-rc1 3 months ago
Shivani Bhardwaj c965c5687d release: 8.0.0-beta1; update changelog 3 months ago
Victor Julien 57c73880db lua: enable lua rules by default
Now that sandboxing is in place, lua rule support is enabled by default.
3 months ago
Alice Akaki d4ec5b9765 detect: add ldap.responses.attribute_type
ldap.responses.attribute_type matches on LDAP attribute type/description
This keyword maps the eve field ldap.responses[].search_result_entry.attributes[].type
It is a sticky buffer
Supports multiple buffer matching
Supports prefiltering

Ticket: #7533
3 months ago
Alice Akaki 75fb352bde detect: add ldap.request.attribute_type
ldap.request.attribute_type matches on LDAP attribute type/description
This keyword maps the following eve fields:
ldap.request.search_request.attributes[]
ldap.request.modify_request.changes[].modification.attribute_type
ldap.request.add_request.attributes[].name
ldap.request.compare_request.attribute_value_assertion.description
It is a sticky buffer
Supports multiple buffer matching
Supports prefiltering

Ticket: #7533
3 months ago
Alice Akaki 6d48acdd63 rustfmt: rust/src/ldap/detect.rs 3 months ago
Jeff Lucovsky fdc43e5ac4 app/ftp: Eliminate scan-build warning
Scan-build reports that FTPRealloc could be called with size=0. Modify
the logic so it's never passed 0.
3 months ago
Jeff Lucovsky 88c38fc4a0 doc/ftp: Document the ftp.reply keyword
Issue: 7508
3 months ago
Jeff Lucovsky e0131f6098 detect/ftp: Add ftp.reply rule keyword
Issue: 7508

Add the rule detection keyword "ftp.reply". This is a multi-buffer
command.
3 months ago
Jeff Lucovsky d674ce2510 app/ftp: Use Rust FTP response line handling
Use the Rust logic to parse FTP response lines with the goal to support
multi-buffer matches better.

A side effect is that the completion codes are no longer strings; the
schema update reflects this.

Issue: 4082
3 months ago
Jeff Lucovsky dfc896e2a7 app/ftp: Move FTP response handling to rust
Move handling of FTP responses to Rust to improve support for FTP
keyword matching. Parsing the response line when encountered
simplifies multi-buffer matching and metadata output.

Issue: 4082
3 months ago
Juliana Fajardini 63adfc6b1e userguide/pop3: minor typo and formatting fixing 3 months ago
Alex Savage 778053876b pop3: app-layer parser using sawp-pop3
This module uses the sawp-pop3 crate to parse POP3 requests and responses
Features:
- eve logging
- events for parsable but non-RFC-compliant messages

Ticket: 3243
3 months ago
Eric Leblond ed20e7cfe4 doc/userguide: doc domain and tld transforms 3 months ago
Eric Leblond 585c624482 tld: add new transform
Extract the TLD from a buffer.

Ticket: #5639
3 months ago
Eric Leblond 0b031a33c6 domain: add new transformation
Ticket: #5639
3 months ago
Philippe Antoine 8cb6a4b82b plugin: document app-layer plugins
Ticket: 7149
Ticket: 7150
Ticket: 7153
3 months ago
Philippe Antoine 5e87b6bd51 plugin: add in-tree app-layer template plugin for testing
Ticket: 7151
Ticket: 7152
Ticket: 7154
3 months ago
Philippe Antoine 51859050cb rust: export jsonbuilder API in sys crate
using cbindgen + bindgen
3 months ago
Victor Julien 5c7173c6df doc/firewall: start of documentation 3 months ago
Victor Julien 98372b6599 firewall: beginning of ruleset analyzer
Output a `firewall.json` with a per table list of rules.

Also output a sorted list of the threat detection rules.
3 months ago
Victor Julien 31d048ed4b firewall: start of firewall rules support
Config:

Firewall rules are like normal rule, with some key differences.

They are loaded separate, and first, from:

```yaml
firewall-rule-path: /etc/suricata/firewall/
firewall-rule-files:
  - fw.rules
```

Can also be loaded with --firewall-rules-exclusive: Mostly for QA purposes.

Allow -S with --firewall-rules-exclusive, so that firewall and threat detection
rules can be tested together.

Rules:

Differences with regular "threat detection" rules:

1. these rules are evaluated before threat detection rules

2. these rules are evaluated in the order as they appear in the rule file

3. currently only rules specifying an explicit hook at supported

   a. as a consequence, no rules will be treated as (like) IP-only, PD-only or
      DE-only

Require explicit action scope for firewall rules. Default policy is
drop for the firewall tables.

Actions:

New action "accept" is added to allow traffic in the filter tables.

New scope "accept:tx" is added to allow accepting a transaction.

Tables:

Rulesets are per table.

Table processing order: `packet:filter` -> `packet:td` -> `app:*:*` -> `app:td`.

Each of the tables has some unique properties:

`packet:filter`:
- default policy is `drop:packet`
- rules are process in order
- action scopes are explicit
- `drop` or `accept` is immediate
- `accept:hook` continues to `packet:td`

`packet:td`:
- default policy is `accept:hook`
- rules are ordered by IDS/IPS ordering logic
- action scopes are implicit
- actions are queued
- continues to `app:*:*` or `alert/action finalize`

`app:*:*`:
- default policy is `drop:flow`
- rules are process in order
- action scopes are explicit
- `drop` is immediate
- `accept` is conditional on possible `drop` from `packet:td`
- `accept:hook` continues to `app:td`, `accept:packet` or `accept:flow`
  continues to `alert/action finalize`

`app:td`:
- default policy is `accept:hook`
- rules are ordered by IDS/IPS ordering logic
- action scopes are implicit
- actions are queued
- continues to `alert/action finalize`

Implementation:

During sigorder, split into packet:filter, app:*:* and general td.

Allow fw rules to work when in pass:flow mode. When firewall mode is enabled,
`pass:flow` will not skip the detection engine anymore, but instead
process the firewall rules and then apply the pass before inspecting threat
detect rules.
3 months ago
Victor Julien 10dcc383ae detect/xbits: implement tx bits
Implement `xbits:set,mybit,track tx;` and `xbits:isset,mybit,track tx;`.

Store these in the AppLayerTxData.

Ticket: #6455.
3 months ago
Victor Julien 7c8a55de54 eve/alert: log ts_progress/tc_progress
This is mostly to help with debugging firewall rules, but
can be useful in other places.
3 months ago
Victor Julien 6f5fd77cb9 detect/app-layer-state: keyword for protocol state
Allow matching on the app-layer protocol state.
3 months ago
Victor Julien fff65c5e40 detect/prefilter: allow special engine for each app update
Allow registering the progress as -1, which means it will be invoked
each time the app prefilters are called.
3 months ago
Victor Julien f60e1efc8a detect: start of pkt hooks
New facility to allow a user to specify where to hook a rule
into the engine. This patch adds this for packets, adding two
hooks:

- `all`: to let a rule be evaluated by all rules
- `flow_start`: to have a rule be evaluated only for the first
  packet in both directions

Implemented by adding a hook flags field in the packet.
3 months ago
Victor Julien 95ed975cca detect/tls.version: allow using rule hook
tls.version isn't hooked to a specific state by default. Allow it
to register at the rule hook.
3 months ago
Victor Julien 4071acd659 detect: explicit action scopes
For drop and pass allow setting the scope explicitly:

        drop:flow
        drop:packet

        pass:flow
        pass:packet

Ticket: #7481.
3 months ago
Victor Julien 9539002b39 detect/tls: more precise state registration for keywords 3 months ago