Skip to content

Commit

Permalink
work in progress for idaholab#395, added ZEEK_DISABLE_STATS environme…
Browse files Browse the repository at this point in the history
…nt variable
  • Loading branch information
mmguero committed Feb 6, 2024
1 parent 1ea5296 commit e5f39f2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfiles/zeek.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ ENV PCAP_FILTER $PCAP_FILTER
ENV PCAP_NODE_NAME $PCAP_NODE_NAME

# environment variables for zeek runtime tweaks (used in local.zeek)
ARG ZEEK_DISABLE_STATS=true
ARG ZEEK_DISABLE_HASH_ALL_FILES=
ARG ZEEK_DISABLE_LOG_PASSWORDS=
ARG ZEEK_DISABLE_SSL_VALIDATE_CERTS=
Expand All @@ -256,6 +257,7 @@ ARG ZEEK_DISABLE_SPICY_TFTP=
ARG ZEEK_DISABLE_SPICY_WIREGUARD=
ARG ZEEK_SYNCHROPHASOR_DETAILED=

ENV ZEEK_DISABLE_STATS $ZEEK_DISABLE_STATS
ENV ZEEK_DISABLE_HASH_ALL_FILES $ZEEK_DISABLE_HASH_ALL_FILES
ENV ZEEK_DISABLE_LOG_PASSWORDS $ZEEK_DISABLE_LOG_PASSWORDS
ENV ZEEK_DISABLE_SSL_VALIDATE_CERTS $ZEEK_DISABLE_SSL_VALIDATE_CERTS
Expand Down
2 changes: 2 additions & 0 deletions config/zeek-live.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Whether or not Zeek should monitor live traffic on a local
# interface (PCAP_IFACE variable below specifies capture interfaces)
ZEEK_LIVE_CAPTURE=false
# Set ZEEK_DISABLE_STATS to blank to generate stats.log and capture_loss.log
ZEEK_DISABLE_STATS=true

ZEEK_PCAP_PROCESSOR=false
ZEEK_CRON=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
##! https://docs.zeek.org/en/stable/script-reference/scripts.html
##! https://github.com/zeek/zeek/blob/master/scripts/site/local.zeek

global disable_stats = (getenv("ZEEK_DISABLE_STATS") == "") ? F : T;
global disable_hash_all_files = (getenv("ZEEK_DISABLE_HASH_ALL_FILES") == "") ? F : T;
global disable_log_passwords = (getenv("ZEEK_DISABLE_LOG_PASSWORDS") == "") ? F : T;
global disable_ssl_validate_certs = (getenv("ZEEK_DISABLE_SSL_VALIDATE_CERTS") == "") ? F : T;
Expand Down Expand Up @@ -78,6 +79,10 @@ redef ignore_checksums = T;
@if (!disable_hash_all_files)
@load frameworks/files/hash-all-files
@endif
@if (!disable_stats)
@load policy/misc/stats
@load policy/misc/capture-loss
@endif
@load policy/protocols/conn/vlan-logging
@load policy/protocols/conn/mac-logging
@load policy/protocols/modbus/known-masters-slaves
Expand Down
1 change: 1 addition & 0 deletions sensor-iso/interface/sensor_ctl/control_vars.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export ZEEK_EXTRACTOR_OVERRIDE_FILE=
export EXTRACTED_FILE_MIN_BYTES=64
export EXTRACTED_FILE_MAX_BYTES=134217728
export EXTRACTED_FILE_PRESERVATION=quarantined
export ZEEK_DISABLE_STATS=true
export ZEEK_DISABLE_HASH_ALL_FILES=
export ZEEK_DISABLE_LOG_PASSWORDS=
export ZEEK_DISABLE_SSL_VALIDATE_CERTS=
Expand Down
5 changes: 5 additions & 0 deletions zeek/config/local.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
##! https://docs.zeek.org/en/stable/script-reference/scripts.html
##! https://github.com/zeek/zeek/blob/master/scripts/site/local.zeek

global disable_stats = (getenv("ZEEK_DISABLE_STATS") == "") ? F : T;
global disable_hash_all_files = (getenv("ZEEK_DISABLE_HASH_ALL_FILES") == "") ? F : T;
global disable_log_passwords = (getenv("ZEEK_DISABLE_LOG_PASSWORDS") == "") ? F : T;
global disable_ssl_validate_certs = (getenv("ZEEK_DISABLE_SSL_VALIDATE_CERTS") == "") ? F : T;
Expand Down Expand Up @@ -78,6 +79,10 @@ redef ignore_checksums = T;
@if (!disable_hash_all_files)
@load frameworks/files/hash-all-files
@endif
@if (!disable_stats)
@load policy/misc/stats
@load policy/misc/capture-loss
@endif
@load policy/protocols/conn/vlan-logging
@load policy/protocols/conn/mac-logging
@load policy/protocols/modbus/known-masters-slaves
Expand Down

0 comments on commit e5f39f2

Please sign in to comment.