Malcolm's runtime settings are stored (with a few exceptions) as environment variables in configuration files ending with a .env
suffix in the ./config
directory. The ./scripts/configure
script can help users configure and tune these settings.
Run ./scripts/configure
and answer the questions to configure Malcolm. For an in-depth treatment of these configuration questions, see the Configuration section in End-to-end Malcolm and Hedgehog Linux ISO Installation.
Although the configuration script automates many of the following configuration and tuning parameters, some environment variables of particular interest are listed here for reference.
arkime.env
andarkime-secret.env
- settings for ArkimeARKIME_ANALYZE_PCAP_THREADS
– the number of threads available to Arkime for analyzing PCAP files (default1
)MANAGE_PCAP_FILES
– if set totrue
, all PCAP files imported into Malcolm will be marked as available for deletion by Arkime if available storage space becomes too low (defaultfalse
)MAXMIND_GEOIP_DB_LICENSE_KEY
- Malcolm uses MaxMind's free GeoLite2 databases for GeoIP lookups. As of December 30, 2019, these databases are no longer available for download via a public URL. Instead, they must be downloaded using a MaxMind license key (available without charge from MaxMind). The license key can be specified here for GeoIP database downloads during build- and run-time.
auth-common.env
- authentication-related settingsNGINX_BASIC_AUTH
- if set totrue
, use TLS-encrypted HTTP basic authentication (default); if set tofalse
, use Lightweight Directory Access Protocol (LDAP) authentication
auth.env
- stores the Malcolm administrator's username and password hash for its nginx reverse proxybeats-common.env
- settings for interactions between Logstash and FilebeatBEATS_SSL
– if set totrue
, Logstash will use require encrypted communications for any external Beats-based forwarders from which it will accept logs (defaulttrue
)
dashboards-helper.env
- settings for the container that helps configure and maintain OpenSearch and OpenSearch DashboardsDASHBOARDS_DARKMODE
– if set totrue
, OpenSearch Dashboards will be set to dark mode upon initialization (defaulttrue
)
filebeat.env
- settings specific to Filebeat, particularly for how Filebeat watches for new log files to parse and how it receives and stores third-Party logslogstash.env
- settings specific to LogstashLOGSTASH_OUI_LOOKUP
– if set totrue
, Logstash will map MAC addresses to vendors for all source and destination MAC addresses when analyzing Zeek logs (defaulttrue
)LOGSTASH_REVERSE_DNS
– if set totrue
, Logstash will perform a reverse DNS lookup for all external source and destination IP address values when analyzing Zeek logs (defaultfalse
)LOGSTASH_SEVERITY_SCORING
- if set totrue
, Logstash will perform severity scoring when analyzing Zeek logs (defaulttrue
)LOGSTASH_NETBOX_ENRICHMENT
- if set totrue
, Logstash will enrich network traffic metadata via NetBox API callsLOGSTASH_NETBOX_AUTO_POPULATE
- if set totrue
, Logstash will populate the NetBox inventory based on observed network trafficLS_JAVA_OPTS
- part of LogStash's JVM settings, the-Xms
and-Xmx
values set the size of LogStash's Java heap (we recommend somewhere between1500m
and4g
)
pipeline.workers
,pipeline.batch.size
andpipeline.batch.delay
- these settings are used to tune the performance and resource utilization of the thelogstash
container; see Tuning and Profiling Logstash Performance,logstash.yml
and Multiple Pipelines
lookup-common.env
- settings for enrichment lookups, including those used for customizing event severity scoringCONNECTION_SECONDS_SEVERITY_THRESHOLD
- when severity scoring is enabled, this variable indicates the duration threshold (in seconds) for assigning severity to long connections (default3600
)FREQ_LOOKUP
- if set totrue
, domain names (from DNS queries and SSL server names) will be assigned entropy scores as calculated byfreq
(defaultfalse
)FREQ_SEVERITY_THRESHOLD
- when severity scoring is enabled, this variable indicates the entropy threshold for assigning severity to events with entropy scores calculated byfreq
; a lower value will only assign severity scores to fewer domain names with higher entropy (e.g.,2.0
forNQZHTFHRMYMTVBQJE.COM
), while a higher value will assign severity scores to more domain names with lower entropy (e.g.,7.5
fornaturallanguagedomain.example.org
) (default2.0
)SENSITIVE_COUNTRY_CODES
- when severity scoring is enabled, this variable defines a comma-separated list of sensitive countries (using ISO 3166-1 alpha-2 codes) (default'AM,AZ,BY,CN,CU,DZ,GE,HK,IL,IN,IQ,IR,KG,KP,KZ,LY,MD,MO, PK,RU,SD,SS,SY,TJ,TM,TW,UA,UZ'
, taken from the U.S. Department of Energy Sensitive Country List)TOTAL_MEGABYTES_SEVERITY_THRESHOLD
- when severity scoring is enabled, this variable indicates the size threshold (in megabytes) for assigning severity to large connections or file transfers (default1000
)
netbox-common.env
,netbox.env
,netbox-secret.env
,netbox-postgres.env
,netbox-redis-cache.env
andnetbox-redis.env
- settings related to NetBox and Asset Interaction AnalysisNETBOX_DISABLED
- if set totrue
, Malcolm will not start and manage a NetBox instance (defaulttrue
)
nginx.env
- settings specific to Malcolm's nginx reverse proxyNGINX_LOG_ACCESS_AND_ERRORS
- if set totrue
, all access to Malcolm via its web interfaces will be logged to OpenSearch (defaultfalse
)NGINX_SSL
- if set totrue
, require HTTPS connections to Malcolm'snginx-proxy
container (default); if set tofalse
, use unencrypted HTTP connections (using unsecured HTTP connections is NOT recommended unless you are running Malcolm behind another reverse proxy such as Traefik, Caddy, etc.)
opensearch.env
- settings specific to OpenSearchOPENSEARCH_JAVA_OPTS
- one of OpenSearch's most important settings, the-Xms
and-Xmx
values set the size of OpenSearch's Java heap (we recommend setting this value to half of system RAM, up to 32 gigabytes)OPENSEARCH_LOCAL
- if set totrue
, Malcolm will use its own internal OpenSearch instance (defaulttrue
)OPENSEARCH_URL
- when using Malcolm's internal OpenSearch instance (i.e.,OPENSEARCH_LOCAL
istrue
) this should behttp://opensearch:9200
, otherwise this value specifies the primary remote instance URL in the formatprotocol://host:port
(defaulthttp://opensearch:9200
)OPENSEARCH_SSL_CERTIFICATE_VERIFICATION
- if set totrue
, connections to the primary remote OpenSearch instance will require full TLS certificate validation (this may fail if using self-signed certificates) (defaultfalse
)OPENSEARCH_SECONDARY
- if set totrue
, Malcolm will forward logs to a secondary remote OpenSearch instance in addition to the primary (local or remote) OpenSearch instance (defaultfalse
)OPENSEARCH_SECONDARY_URL
- when forwarding to a secondary remote OpenSearch instance (i.e.,OPENSEARCH_SECONDARY
istrue
) this value specifies the secondary remote instance URL in the formatprotocol://host:port
OPENSEARCH_SECONDARY_SSL_CERTIFICATE_VERIFICATION
- if set totrue
, connections to the secondary remote OpenSearch instance will require full TLS certificate validation (this may fail if using self-signed certificates) (defaultfalse
)
pcap-capture.env
- settings specific to capturing traffic for live traffic analysisPCAP_ENABLE_NETSNIFF
– if set totrue
, Malcolm will capture network traffic on the local network interface(s) indicated inPCAP_IFACE
using netsniff-ngPCAP_ENABLE_TCPDUMP
– if set totrue
, Malcolm will capture network traffic on the local network interface(s) indicated inPCAP_IFACE
using tcpdump; there is no reason to enable bothPCAP_ENABLE_NETSNIFF
andPCAP_ENABLE_TCPDUMP
PCAP_FILTER
– specifies a tcpdump-style filter expression for local packet capture; leave blank to capture all trafficPCAP_IFACE
– used to specify the network interface(s) for local packet capture ifPCAP_ENABLE_NETSNIFF
,PCAP_ENABLE_TCPDUMP
,ZEEK_LIVE_CAPTURE
orSURICATA_LIVE_CAPTURE
are enabled; for multiple interfaces, separate the interface names with a comma (e.g.,'enp0s25'
or'enp10s0,enp11s0'
)PCAP_IFACE_TWEAK
- if set totrue
, Malcolm will [useethtool
]({{ site.github.repository_url }}/blob/{{ site.github.build_revision }}/shared/bin/nic-capture-setup.sh) to disable NIC hardware offloading features and adjust ring buffer sizes for capture interface(s); this should betrue
if the interface(s) are being used for capture only,false
if they are being used for management/communicationPCAP_ROTATE_MEGABYTES
– used to specify how large a locally captured PCAP file can become (in megabytes) before it is closed for processing and a new PCAP file createdPCAP_ROTATE_MINUTES
– used to specify a time interval (in minutes) after which a locally-captured PCAP file will be closed for processing and a new PCAP file created
process.env
- settings for how the processes running inside Malcolm containers are executedPUID
andPGID
- Docker runs all its containers as the privilegedroot
user by default. For better security, Malcolm immediately drops to non-privileged user accounts for executing internal processes wherever possible. ThePUID
(process user ID) andPGID
(process group ID) environment variables allow Malcolm to map internal non-privileged user accounts to a corresponding user account on the host. Note a few (including thelogstash
andnetbox
containers) may take a few extra minutes during startup ifPUID
andPGID
are set to values other than the default1000
. This is expected and should not affect operation after the initial startup.
ssl.env
- TLS-related settings used by many containerssuricata.env
,suricata-live.env
andsuricata-offline.env
- settings for SuricataSURICATA_AUTO_ANALYZE_PCAP_FILES
– if set totrue
, all PCAP files imported into Malcolm will automatically be analyzed by Suricata, and the resulting logs will also be imported (defaultfalse
)SURICATA_AUTO_ANALYZE_PCAP_THREADS
– the number of threads available to Malcolm for analyzing Suricata logs (default1
)SURICATA_CUSTOM_RULES_ONLY
– if set totrue
, Malcolm will bypass the default Suricata ruleset and use only user-defined rules (./suricata/rules/*.rules
).SURICATA_UPDATE_RULES
– if set totrue
, Suricata signatures will periodically be updated (defaultfalse
)SURICATA_LIVE_CAPTURE
- if set totrue
, Suricata will monitor live traffic on the local interface(s) defined byPCAP_FILTER
SURICATA_ROTATED_PCAP
- if set totrue
, Suricata can analyze PCAP files captured bynetsniff-ng
ortcpdump
(seePCAP_ENABLE_NETSNIFF
andPCAP_ENABLE_TCPDUMP
, as well asSURICATA_AUTO_ANALYZE_PCAP_FILES
); ifSURICATA_LIVE_CAPTURE
istrue
, this should befalse
; otherwise Suricata will see duplicate trafficSURICATA_…
- the [suricata
container entrypoint script]({{ site.github.repository_url }}/blob/{{ site.github.build_revision }}/shared/bin/suricata_config_populate.py) can use many more environment variables to tweak suricata.yaml; in that script,DEFAULT_VARS
defines those variables (albeit without theSURICATA_
prefix you must add to each for use) Note that for some variables (e.g., something with a sequence likeHOME_NET
) Suricata wants values to be quoted. To accomplish that in thesuricata.env
file, use outer single quotes with inner double quotes, like this:SURICATA_HOME_NET='"[192.168.0.0/16,10.0.0.0/8,172.16.0.0/12]"'
upload-common.env
- settings for dealing with PCAP files uploaded to Malcolm for analysisAUTO_TAG
– if set totrue
, Malcolm will automatically create Arkime sessions and Zeek logs with tags based on the filename, as described in Tagging (defaulttrue
)
zeek.env
,zeek-secret.env
,zeek-live.env
andzeek-offline.env
- settings for Zeek and for scanning extracted files Zeek observes in network trafficEXTRACTED_FILE_CAPA_VERBOSE
– if set totrue
, all Capa rule hits will be logged; otherwise (false
) only MITRE ATT&CK® technique classifications will be loggedEXTRACTED_FILE_ENABLE_CAPA
– if set totrue
, Zeek-extracted files determined to be PE (portable executable) files will be scanned with CapaEXTRACTED_FILE_ENABLE_CLAMAV
– if set totrue
, Zeek-extracted files will be scanned with ClamAVEXTRACTED_FILE_ENABLE_YARA
– if set totrue
, Zeek-extracted files will be scanned with YaraEXTRACTED_FILE_HTTP_SERVER_ENABLE
– if set totrue
, the directory containing Zeek-extracted files will be served over HTTP at./extracted-files/
(e.g., https://localhost/extracted-files/ if connecting locally)EXTRACTED_FILE_HTTP_SERVER_ENCRYPT
– if totrue
, the Zeek-extracted files will be AES-256-CBC-encrypted in anopenssl enc
-compatible format (e.g.,openssl enc -aes-256-cbc -d -in example.exe.encrypted -out example.exe
)EXTRACTED_FILE_HTTP_SERVER_KEY
– specifies the AES-256-CBC decryption password for encrypted Zeek-extracted files; used in conjunction withEXTRACTED_FILE_HTTP_SERVER_ENCRYPT
EXTRACTED_FILE_IGNORE_EXISTING
– if set totrue
, files extant in./zeek-logs/extract_files/
directory will be ignored on startup rather than scannedEXTRACTED_FILE_PRESERVATION
– determines behavior for preservation of Zeek-extracted filesEXTRACTED_FILE_UPDATE_RULES
– if set totrue
, file scanner engines (e.g., ClamAV, Capa, Yara) will periodically update their rule definitions (defaultfalse
)EXTRACTED_FILE_YARA_CUSTOM_ONLY
– if set totrue
, Malcolm will bypass the default Yara rulesets (Neo23x0/signature-base and bartblaze/Yara-rules) and use only user-defined rules in./yara/rules
VTOT_API2_KEY
– used to specify a VirusTotal Public API v.20 key, which, if specified, will be used to submit hashes of Zeek-extracted files to VirusTotalZEEK_AUTO_ANALYZE_PCAP_FILES
– if set totrue
, all PCAP files imported into Malcolm will automatically be analyzed by Zeek, and the resulting logs will also be imported (defaultfalse
)ZEEK_AUTO_ANALYZE_PCAP_THREADS
– the number of threads available to Malcolm for analyzing Zeek logs (default1
)ZEEK_DISABLE_…
- if set to any non-blank value, each of these variables can be used to disable a certain Zeek function when it analyzes PCAP files (for example, settingZEEK_DISABLE_LOG_PASSWORDS
totrue
to disable logging of cleartext passwords)ZEEK_…_PORTS
- used to specify non-default ports to register certain Zeek analyzers (e.g.,ZEEK_SYNCHROPHASOR_PORTS
for the ICSNPP-Synchrophasor analyzer andZEEK_GENISYS_PORTS
for the ICSNPP-Genisys analyzer) formatted as a comma-separated list of Zeek ports (e.g.,12345/tcp
or4041/tcp,4042/udp
)ZEEK_DISABLE_ICS_ALL
andZEEK_DISABLE_ICS_…
- if set to any non-blank value, these variables can be used to disable Zeek's protocol analyzers for Operational Technology/Industrial Control Systems (OT/ICS) protocolsZEEK_DISABLE_BEST_GUESS_ICS
- see "Best Guess" Fingerprinting for ICS ProtocolsZEEK_EXTRACTOR_MODE
– determines the file extraction behavior for file transfers detected by Zeek; see Automatic file extraction and scanning for more detailsZEEK_INTEL_FEED_SINCE
- when querying a TAXII or MISP feed, only process threat indicators created or modified since the time represented by this value; it may be either a fixed date/time (01/01/2021
) or relative interval (30 days ago
)ZEEK_INTEL_ITEM_EXPIRATION
- specifies the value for Zeek'sIntel::item_expiration
timeout as used by the Zeek Intelligence Framework (default-1min
, which disables item expiration)ZEEK_INTEL_REFRESH_CRON_EXPRESSION
- specifies a cron expression indicating the refresh interval for generating the Zeek Intelligence Framework files (defaults to empty, which disables automatic refresh)ZEEK_LIVE_CAPTURE
- if set totrue
, Zeek will monitor live traffic on the local interface(s) defined byPCAP_FILTER
ZEEK_ROTATED_PCAP
- if set totrue
, Zeek can analyze captured PCAP files captured bynetsniff-ng
ortcpdump
(seePCAP_ENABLE_NETSNIFF
andPCAP_ENABLE_TCPDUMP
, as well asZEEK_AUTO_ANALYZE_PCAP_FILES
); ifZEEK_LIVE_CAPTURE
istrue
, this should befalse
; otherwise Zeek will see duplicate traffic
The ./scripts/configure
script can also be run noninteractively which can be useful for scripting Malcolm setup. This behavior can be selected by supplying the -d
or --defaults
option on the command line. Running with the --help
option will list the arguments accepted by the script:
$ ./scripts/configure --help
usage: configure <arguments>
Malcolm install script
options:
-v [true|false], --verbose [true|false]
Verbose output
-d [true|false], --defaults [true|false]
Accept defaults to prompts without user interaction
-c [true|false], --configure [true|false]
Only do configuration (not installation)
…
Note that the value for any argument not specified on the command line will be reset to its default (as if for a new Malcolm installation) regardless of the setting's current value in the corresponding .env
file. In other words, users who want to use the --defaults
option should carefully review all available command-line options and choose all that apply.
Similarly, authentication-related settings can also be set noninteractively by using the command-line arguments for ./scripts/auth_setup
.