Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect/csum: Test interaction btw csum/stream setting #2241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/detect-chksum-01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Test Description

Contributed by Hans Vermeer

Verify that `stream.checksum-validation` setting does not affect csum validation keyword checks.

This test enables `stream.checksum-validatin`

## PCAP

Contributed by Hans Vermeer
Binary file added tests/detect-chksum-01/input.pcap
Binary file not shown.
1 change: 1 addition & 0 deletions tests/detect-chksum-01/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert tcp any any -> any any (msg:"SURICATA TCPv4 invalid checksum"; tcpv4-csum:invalid; classtype:protocol-command-decode; sid:1;)
32 changes: 32 additions & 0 deletions tests/detect-chksum-01/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
requires:
min-version: 7

args:
- --set stream.checksum-validation=yes

checks:
- filter:
count: 1
match:
alert.action: allowed
alert.category: Generic Protocol Command Decode
alert.gid: 1
alert.severity: 3
alert.signature: SURICATA TCPv4 invalid checksum
alert.signature_id: 1
dest_ip: 209.85.225.105
dest_port: 80
direction: to_server
event_type: alert
flow.bytes_toclient: 0
flow.bytes_toserver: 74
flow.dest_ip: 209.85.225.105
flow.dest_port: 80
flow.pkts_toclient: 0
flow.pkts_toserver: 1
flow.src_ip: 192.168.2.3
flow.src_port: 39867
pcap_cnt: 1
proto: TCP
src_ip: 192.168.2.3
src_port: 39867
11 changes: 11 additions & 0 deletions tests/detect-chksum-02/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Test Description

Contributed by Hans Vermeer

Verify that `stream.checksum-validation` setting does not affect csum validation keyword checks.

This test disables `stream.checksum-validatin`

## PCAP

Contributed by Hans Vermeer
1 change: 1 addition & 0 deletions tests/detect-chksum-02/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert tcp any any -> any any (msg:"SURICATA TCPv4 invalid checksum"; tcpv4-csum:invalid; classtype:protocol-command-decode; sid:1;)
34 changes: 34 additions & 0 deletions tests/detect-chksum-02/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
requires:
min-version: 7

pcap: ../detect-chksum-01/input.pcap

args:
- --set stream.checksum-validation=no

checks:
- filter:
count: 1
match:
alert.action: allowed
alert.category: Generic Protocol Command Decode
alert.gid: 1
alert.severity: 3
alert.signature: SURICATA TCPv4 invalid checksum
alert.signature_id: 1
dest_ip: 209.85.225.105
dest_port: 80
direction: to_server
event_type: alert
flow.bytes_toclient: 0
flow.bytes_toserver: 74
flow.dest_ip: 209.85.225.105
flow.dest_port: 80
flow.pkts_toclient: 0
flow.pkts_toserver: 1
flow.src_ip: 192.168.2.3
flow.src_port: 39867
pcap_cnt: 1
proto: TCP
src_ip: 192.168.2.3
src_port: 39867
Loading