Files
securityonion/salt/common/tools/sbin/so-zeek-logs
2022-11-11 12:15:54 -08:00

119 lines
4.3 KiB
Bash
Executable File

#!/bin/bash
local_salt_dir=/opt/so/saltstack/local
zeek_logs_enabled() {
echo "zeeklogs:" > $local_salt_dir/pillar/zeeklogs.sls
echo " enabled:" >> $local_salt_dir/pillar/zeeklogs.sls
for BLOG in "${BLOGS[@]}"; do
echo " - $BLOG" | tr -d '"' >> $local_salt_dir/pillar/zeeklogs.sls
done
}
whiptail_manager_adv_service_zeeklogs() {
BLOGS=$(whiptail --title "so-zeek-logs" --checklist "Please Select Logs to Send:" 24 78 12 \
"conn" "Connection Logging" ON \
"dce_rpc" "RPC Logs" ON \
"dhcp" "DHCP Logs" ON \
"dnp3" "DNP3 Logs" ON \
"dns" "DNS Logs" ON \
"dpd" "DPD Logs" ON \
"files" "Files Logs" ON \
"ftp" "FTP Logs" ON \
"http" "HTTP Logs" ON \
"intel" "Intel Hits Logs" ON \
"irc" "IRC Chat Logs" ON \
"kerberos" "Kerberos Logs" ON \
"modbus" "MODBUS Logs" ON \
"notice" "Zeek Notice Logs" ON \
"ntlm" "NTLM Logs" ON \
"pe" "PE Logs" ON \
"radius" "Radius Logs" ON \
"rfb" "RFB Logs" ON \
"rdp" "RDP Logs" ON \
"sip" "SIP Logs" ON \
"smb_files" "SMB Files Logs" ON \
"smb_mapping" "SMB Mapping Logs" ON \
"smtp" "SMTP Logs" ON \
"snmp" "SNMP Logs" ON \
"ssh" "SSH Logs" ON \
"ssl" "SSL Logs" ON \
"syslog" "Syslog Logs" ON \
"tunnel" "Tunnel Logs" ON \
"weird" "Zeek Weird Logs" ON \
"mysql" "MySQL Logs" ON \
"socks" "SOCKS Logs" ON \
"x509" "x.509 Logs" ON \
"modbus_detailed" "MODBUS Details" ON \
"modbus_mask_write_register" "MODBUS Write Register" ON \
"modbus_read_write_multiple_registers" "MODBUS Multi Registers" ON \
"dnp3_objects" "DNP3 Objections" ON \
"bacnet" "BACnet" ON \
"bacnet_discovery" "BACnet Discovery" ON \
"bacnet_property" "BACnet Property" ON \
"bsap_ip_header" "BSAP IP Header" ON \
"bsap_ip_rdb" "BSAP IP RDB" ON \
"bsap_ip_unknown" "BSAP IP Unknown" ON \
"bsap_serial_header" "BSAP Serial Header" ON \
"bsap_serial_rdb" "BSAP Serial RDB" ON \
"bsap_serial_rdb_ext" "BSAP Serial RDB Extenstion" ON \
"bsap_serial_unknown" "BSAP Serial Unknown" ON \
"ecat_registers" "Ethercat Registers" ON \
"ecat_log_address" "Ethercat Address Read Write" ON \
"ecat_dev_info" "Ethercat Device Info" ON \
"ecat_aoe_info" "Ethercat AoE Info" ON \
"ecat_coe_info" "Ethercat CoE Info" ON \
"ecat_foe_info" "Ethercat FoE Info" ON \
"ecat_soe_info" "Ethercat SoE Info" ON \
"ecat_arp_info" "Ethercat ARP Info" ON \
"enip" "ENIP Header" ON \
"cip" "CIP Header" ON \
"cip_io" "CIP I/O" ON \
"cip_identity" "CIP Identity" ON \
"opcua_binary.log" "OPC UA Binary Encoding" ON \
"opcua_binary_status_code_detail" "OPC UA Detail" ON \
"opcua_binary_diag_info_detail" "OPC UA Diag" ON \
"opcua_binary_get_endpoints" "OPC UA Endpoints" ON \
"opcua_binary_get_endpoints_discovery" "OPC UA Endpoints" ON \
"opcua_binary_get_endpoints_user_token" "OPC UA Endpoints" ON \
"opcua_binary_get_endpoints_description" "OPC UA Endpoints" ON \
"opcua_binary_get_endpoints_locale_id" "OPC UA Endpoints" ON \
"opcua_binary_get_endpoints_profile_uri" "OPC UA Endpoints" ON \
"opcua_binary_create_session" "OPC UA Session" ON \
"opcua_binary_create_session_user_token" "OPC UA Session" ON \
"opcua_binary_create_session_endpoints" "OPC UA Session" ON \
"opcua_binary_create_session_discovery" "OPC UA Session" ON \
"opcua_binary_activate_session" "OPC UA Session" ON \
"opcua_binary_activate_session_client_software_cert" "OPC UA Session" ON \
"opcua_binary_activate_session_locale_id" "OPC UA Session" ON \
"opcua_binary_activate_session_diagnostic_info" "OPC UA Session" ON \
"opcua_binary_browse" "OPC UA Browse" ON \
"opcua_binary_browse_description" "OPC UA Browse" ON \
"opcua_binary_browse_request_continuation_point" "OPC UA Browse" ON \
"opcua_binary_browse_result" "OPC UA Browse" ON \
"opcua_binary_browse_response_references" "OPC UA Browse" ON \
"opcua_binary_browse_diagnostic_info" "OPC UA Browse" ON \
"opcua_binary_create_subscription" "OPC UA UA Browse" ON \
"opcua_binary_read" "OPC UA Read" ON 3>&1 1>&2 2>&3 )
local exitstatus=$?
IFS=' ' read -ra BLOGS <<< "$BLOGS"
return $exitstatus
}
whiptail_manager_adv_service_zeeklogs
return_code=$?
case $return_code in
1)
whiptail --title "so-zeek-logs" --msgbox "Cancelling. No changes have been made." 8 75
;;
255)
whiptail --title "so-zeek-logs" --msgbox "Whiptail error occured, exiting." 8 75
;;
*)
zeek_logs_enabled
;;
esac