mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Add btests for ip_proto policy files
This commit is contained in:
parent
2125a1f558
commit
fbaf438a1d
3 changed files with 25 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
unknown-ip-proto-500
|
|
@ -0,0 +1,8 @@
|
||||||
|
# @TEST-DOC: Test the policy for removing the unknown IP protocol field and connections from conn.log
|
||||||
|
# @TEST-EXEC: zeek -r $TRACES/cisco-fabric-path.pcap %INPUT
|
||||||
|
# @TEST-EXEC: test $(head -1 conn.log | jq 'has("ip_proto")') = "false"
|
||||||
|
# @TEST-EXEC-FAIL: cat conn.log | jq .proto | sort | uniq | grep unknown_transport
|
||||||
|
|
||||||
|
@load policy/protocols/conn/disable-unknown-ip-proto-support
|
||||||
|
|
||||||
|
redef LogAscii::use_json = T;
|
|
@ -0,0 +1,15 @@
|
||||||
|
# @TEST-DOC: Tests the ip-proto-name-logging policy file
|
||||||
|
# @TEST-EXEC: zeek -r $TRACES/cisco-fabric-path.pcap %INPUT > out
|
||||||
|
|
||||||
|
# @TEST-EXEC-FAIL: cat conn.log | jq 'has("ip_proto_name")' | grep "false"
|
||||||
|
# @TEST-EXEC: cat conn.log | jq .ip_proto_name | sort | uniq | grep private-encryption
|
||||||
|
# @TEST-EXEC: btest-diff out
|
||||||
|
|
||||||
|
@load policy/protocols/conn/ip-proto-name-logging
|
||||||
|
|
||||||
|
redef LogAscii::use_json = T;
|
||||||
|
|
||||||
|
event zeek_init() {
|
||||||
|
# Test printing out an unknown value from the protocol_names table
|
||||||
|
print IP::protocol_names[500];
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue