Skip to content

Commit

Permalink
add test for extra tls alert
Browse files Browse the repository at this point in the history
  • Loading branch information
inashivb committed Oct 4, 2024
1 parent 3be0daf commit 216e3e0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/tls-extra-alert/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Test Description

This test shows that Suricata generates an additional alert for TLS
for the given PCAP which shouldn't be there.

## PCAP

Provided by AWS.

## Related issues

None so far. State: Trying to establish what's the issue.
Binary file added tests/tls-extra-alert/input.pcap
Binary file not shown.
5 changes: 5 additions & 0 deletions tests/tls-extra-alert/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alert tcp any any -> any 443 (flow: to_server; flags: S,CE; flowbits:set, tls_tracker; flowbits: noalert; sid:09901001; )
alert tcp any any -> any 443 (flowbits:isset, tls_tracker; content: "|15 03 01 00 02 02|"; startswith; flowbits:set, tls_error; sid:09901031; rev:1; msg:"TLS 1.2 Fatal Alert (outgoing packet)"; )
alert tcp any 443 -> any any (flowbits:isset, tls_tracker; content: "|15 03 01 00 02 02|"; startswith; flowbits:set, tls_error; sid:09901032; rev:1; msg:"TLS 1.2 Fatal Alert (incoming packet)"; )
alert tcp any any -> any 443 (flow: to_server; flowbits:isset, tls_error; sid:09901033; rev:1; msg:"Allow TLS error handling (outgoing packet)"; )
alert tcp any 443 -> any any (flow: to_client; flowbits:isset, tls_error; sid:09901034; rev:1; msg:"Allow TLS error handling (incoming packet)"; )
16 changes: 16 additions & 0 deletions tests/tls-extra-alert/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
args:
- -k none
- --simulate-ips

checks:
- filter:
count: 2
match:
event_type: alert
alert.signature_id: 9901033
pkt_src: wire/pcap
- filter:
count: 0
match:
event_type: alert
not-has-key: pcap_cnt

0 comments on commit 216e3e0

Please sign in to comment.