osqueryd Flags and command line guide

osqueryd Flags and command line guide

$ sudo osqueryd --help

Password:

osquery 3.3.2.45-Uptycs, your OS as a high-performance relational database

Usage: osqueryd [OPTION]... 


osquery command line flags:

--flagfile PATH
Line-delimited file of additional flags
--D
Run as a daemon process
--S
Run as a shell process
--alarm_timeout VALUE
Seconds to wait for a graceful shutdown
--carver_block_size VALUE
Size of blocks used for POSTing data back to remote endpoints
--carver_compression
Compress archives using zstd prior to upload (default false)
--carver_continue_endpoint VALUE
TLS/HTTPS endpoint that receives carved content after session creation
--carver_disable_function
Disable the osquery file carver function (default true)
--carver_start_endpoint VALUE
TLS/HTTPS init endpoint for forensic carver
--clean_database
Clear confgured database path
--config_accelerated_refresh VALUE
Interval to wait if reading a configuration fails
--config_check
Check the format of an osquery config and exit
--config_dump
Dump the contents of the configuration
--config_enable_backup
Backup config and use it when refresh fails
--config_path VALUE
Path to JSON config file
--config_plugin VALUE
Config plugin name
--config_refresh VALUE
Optional interval in seconds to re-read configuration
--config_tls_endpoint VALUE
TLS/HTTPS endpoint for config retrieval
--config_tls_max_attempts VALUE
Number of attempts to retry a TLS config/enroll request
--daemonize
Attempt to daemonize (POSIX only)
--database_dump
Dump the contents of the backing store
--database_path VALUE
If using a disk-based backing store, specify a path
--disable_auto_memory
Disable auto memory calculation and give precedence to what is set in --watchdog_memory_limit flag.
--disable_carver
Disable the osquery file carver (default true)
--disable_diag_events
enable/disable diagnostic event collection, default = true
--disable_diag_forwarding
enable/disable diagnostic event forwarding, default = true
--disable_enrollment
Disable enrollment functions on related config/logger plugins
--disable_extensions
Disable extension API
--disable_reenrollment
Disable re-enrollment attempts if related plugins return invalid
--disable_watchdog
Disable userland watchdog process
--enable_extensions_watchdog
Enable userland watchdog for extensions processes
--enable_proxy_auto_discovery
Whether to discover proxy-enabled route to tls- cloud automatically
--enroll_always
On startup, send a new enrollment request
--enroll_secret_env VALUE
Name of environment variable holding enrollment-auth secret
--enroll_secret_path VALUE
Path to an optional client enrollment-auth secret
--enroll_tls_endpoint VALUE
TLS/HTTPS endpoint for client enrollment
--extensions_autoload VALUE
Optional path to a list of autoloaded & managed extensions
--extensions_interval VALUE
Seconds delay between connectivity checks
--extensions_require VALUE
Comma-separated list of required extensions
--extensions_socket VALUE
Path to the extensions UNIX domain socket
--extensions_timeout VALUE
Seconds to wait for autoloaded extensions
--force
Force osqueryd to kill previously-running daemons
--install
Install osqueryd as a service
--killswitch_tls_endpoint VALUE
TLS/HTTPS endpoint for killswitch config retrieval
--killswitch_tls_max_attempts VALUE
Number of attempts to retry a TLS killswitch config request
--logger_stderr
Write status logs to stderr
--logtostderr
Log messages to stderr in addition to the logger plugin(s)
--max_descriptors_limit VALUE
Maximum number of cimultaneously open files
--max_heartbeat_delay VALUE
Maximum time in seconds for which a heartbeat from various osquery threads is not heard
--pidfile VALUE
Path to the daemon pidfile mutex
--proxy_auto_discovery_order VALUE
Order in which proxy discovery is attempted.
--proxy_hostname VALUE
Comma seperated list of proxy servers to select from
--purge_fast_buffered_records
Purge all the records at the start
--stderrthreshold VALUE
Stderr log level threshold
--tls_client_cert VALUE
Optional path to a TLS client-auth PEM certificate
--tls_client_key VALUE
Optional path to a TLS client-auth PEM private key
--tls_hostname VALUE
TLS/HTTPS hostname for Config, Logger, and Enroll plugins
--tls_server_certs VALUE
Optional path to a TLS server PEM certificate(s) bundle
--tls_session_reuse
Reuse TLS session sockets
--tls_session_timeout VALUE
TLS session keep alive timeout in seconds
--uninstall
Uninstall osqueryd as a service
--watchdog_above_sixteen_alloc_vm VALUE
This flag is for the allocated memory above 16 GB, by default it is 32 MB.
--watchdog_base_alloc_vm VALUE
This flag is for the allocated VM for base memory, by defauld it is for 2GB ==> 400 MB.
--watchdog_base_memory VALUE
This is a base memory, on which the base vm allocation would be applied, by default it is 2 GB.
--watchdog_below_sixteen_alloc_vm VALUE
This flag is for the allocated VM above 2 GB and below 16 GB, by default it is 80 MB
--watchdog_db_check_interval VALUE
Rocks db limit check interval
--watchdog_db_limit VALUE
Override watchdog rocks db limit (e.g., 1024, for 1024MB)
--watchdog_delay VALUE
Initial delay in seconds before watchdog starts
--watchdog_diag_queue_size VALUE
Maximum persistent diag event accumulated when enroll fails/network issue.
--watchdog_diag_sender_interval VALUE
Diagnostic event sender interval
--watchdog_level VALUE
Performance limit level (0=normal, 1=restrictive, -1=off)
--watchdog_memory_limit VALUE
Override watchdog profile memory limit (e.g., 300, for 300MB)
--watchdog_utilization_limit VALUE
Override watchdog profile CPU utilization limit

osquery configuration options (set by config or CLI flags):
--audit_allow_fim_eventsAllow the audit publisher to enable file event
--audit_allow_process_eventsAllow the audit publisher to enable process event
--audit_allow_socketsAllow the audit publisher to enable socket events
--audit_allow_user_eventsAllow the audit publisher to enable user events
--audit_events_rate VALUEControlling the max rate of audit events processed by osquery. Default is 0, no restriction
--augeas_lenses VALUEDirectory that contains augeas lenses files
--auto_flags_updateEnables automatic flag updtaes via config
--aws_access_key_id VALUEAWS access key ID
--aws_enable_proxyEnable proxying of HTTP/HTTPS requests in AWS client config
--aws_firehose_period VALUESeconds between flushing logs to Firehose (default 10)
--aws_firehose_stream VALUEName of Firehose stream for logging
--aws_kinesis_period VALUESeconds between flushing logs to Kinesis (default 10)
--aws_kinesis_random_partition_keyEnable random kinesis partition keys
--aws_kinesis_stream VALUEName of Kinesis stream for logging
--aws_profile_name VALUEAWS profile for authentication and region configuration
--aws_proxy_host VALUEProxy host for use in AWS client config
--aws_proxy_password VALUEProxy password for use in AWS client config
--aws_proxy_port VALUEProxy port for use in AWS client config
--aws_proxy_scheme VALUEProxy HTTP scheme for use in AWS client config (http or https, default https)
--aws_proxy_username VALUEProxy username for use in AWS client config
--aws_region VALUEAWS region
--aws_secret_access_key VALUEAWS secret access key
--aws_sts_arn_role VALUEAWS STS ARN role
--aws_sts_region VALUEAWS STS region
--aws_sts_session_name VALUEAWS STS session name
--aws_sts_timeout VALUEAWS STS assume role credential validity in seconds (default 3600)
--buffered_log_max VALUEMaximum number of logs in buffered output plugins (0 = unlimited)
--decorations_top_levelAdd decorators as top level JSON objects
--disable_auditDisable receiving events from the audit subsystem
--disable_cachingDisable scheduled query caching
--disable_databaseDisable the persistent RocksDB storage
--disable_decoratorsDisable log result decoration
--disable_distributedDisable distributed queries (default true)
--disable_eventsDisable osquery publish/subscribe system
--disable_events_staging
This is an optimization. If set to true, events will be forwarded to logger(s) only, events can not be queried via sql query.
--disable_fs_events_based_file_eventsDisable fsevents based FIM
--disable_hash_cacheCache calculated file hashes, re-calculate only if inode times change
--disable_loggingDisable ERROR/INFO logging
--disable_tables VALUEComma-delimited list of table names to be disabled
--distributed_interval VALUESeconds between polling for new queries (default 60)
--distributed_plugin VALUEDistributed plugin name
--distributed_tls_max_attempts VALUENumber of times to attempt a request
--distributed_tls_read_endpoint VALUETLS/HTTPS endpoint for distributed query retrieval
--distributed_tls_write_endpoint VALUETLS/HTTPS endpoint for distributed query results
--docker_socket VALUEDocker UNIX domain socket path
--enable_dns_lookupsEnable the DNS lookups capture event publisher
--enable_foreignEnable no-op foreign virtual tables
--enable_http_lookupsEnable the HTTP capture event publisher
--enable_keyboard_eventsEnable listening for keyboard events
--enable_killswitchEnable killswitch plugin
--enable_mouse_eventsEnable listening for mouse events
--enable_numeric_monitoringEnable numeric monitoring system
--ephemeralSkip pidfile and database state checks
--events_expiry VALUETimeout to expire event subscriber results
--events_max VALUEMaximum number of events per type to buffer
--events_optimizeOptimize subscriber select queries (scheduler only)
--exclude_dnslookup_urls VALUEComma-separated list of urls to be excluded in dns_lookup_events table.
--generate_process_hash_in_process_eventReport process image file hash with process events. Uses cache
--generate_record_hashAllow unique id calculation to distinguish same added/removed events.
--hash_cache_max VALUESize of LRU file hash cache
--host_identifier VALUEField used to identify the host running osquery (hostname, uuid, instance, ephemeral, specified)
--include_http_headers VALUEComma-separated list of headers to be included in http_events table
--killswitch_config_path VALUEPath to JSON killswitch config file
--killswitch_plugin VALUEKillswitch plugin name.
--killswitch_refresh_rate VALUERefresh rate of killswitch in seconds
--logger_event_typeLog scheduled results as events
--logger_kafka_acks VALUEThe number of acknowledgments the leader has to receive (0, 1, 'all')
--logger_kafka_brokers VALUEBootstrap broker(s) as a comma-separated list of host or host:port (default port 9092)
--logger_kafka_compression VALUECompression codec to use for compressing message sets ('none' or 'gzip')
--logger_kafka_topic VALUEKafka topic to publish logs under
--logger_min_status VALUEMinimum level for status log recording
--logger_min_stderr VALUEMinimum level for statuses written to stderr
--logger_mode VALUEDecimal mode for log files (default '0640')
--logger_path VALUEDirectory path for ERROR/WARN/INFO and results logging
--logger_plugin VALUELogger plugin name
--logger_secondary_status_onlyOnly send status logs to secondary logger plugins
--logger_snapshot_event_typeLog scheduled snapshot results as events
--logger_tls_compressGZip compress TLS/HTTPS request body
--logger_tls_endpoint VALUETLS/HTTPS endpoint for results logging
--logger_tls_max VALUEMax size in bytes allowed per log line
--logger_tls_period VALUESeconds between flushing logs over TLS/HTTPS
--max_stderr_log_size VALUEMaximum size of redirected stderr log file
--nullvalue VALUESet string for NULL values, default ''
--numeric_monitoring_filesystem_path VALUE
File to dump numeric monitoring records one per line. The format of the line is <PATH><TAB><VALUE><TAB><TIMESTAMP>.
--numeric_monitoring_plugins VALUEComma separated numeric monitoring plugins names
--numeric_monitoring_pre_aggregation_time VALUETime period in seconds for numeric monitoring pre-aggreagation buffer.
--pack_delimiter VALUEDelimiter for pack and query names
--pack_refresh_interval VALUECache expiration for a packs discovery queries
--read_max VALUEMaximum file read size
--redirect_stderrRedirect STD error to status log file
--schedule_default_interval VALUEQuery interval to use if none is provided
--schedule_epoch VALUEEpoch for scheduled queries
--schedule_max_drift VALUE
Max time drift in seconds. Scheduler tries to compensate the drift until the drift exceed this value.








After it the drift will be reseted to zero and the compensation process will start from the beginning. It is needed to avoid the problem of endless compensation (which is CPU greedy) after a long SIGSTOP/SIGCONT pause or something similar. Set it to zero to switch off a drift compensation. Default: 60
--schedule_reload VALUEInterval in seconds to reload database arenas
--schedule_splay_percent VALUEPercent to splay config times
--schedule_timeout VALUELimit the schedule, 0 for no limit
--software_updateEnables osquery auto-update feature
--specified_identifier VALUEField used to specify the host_identifier when set to "specified"
--table_delay VALUEAdd an optional microsecond delay between table scans
--utcConvert all UNIX times to UTC
--value_max VALUEMaximum returned row value size
--verboseEnable verbose informational messages
--worker_threads VALUENumber of work dispatch threads

    • Related Articles

    • Proxy support

      Overview Uptycs agent (osquery) needs cloud connectivity to function properly. However, endpoints might not be accessing the internet directly. A lot of scenarios have emerged where the endpoint uses proxy servers to connect to internet. This is ...
    • Steps to manually install/uninstall Osquery on CentOS Linux

      Overview This document outlines the procedure on how to install/uninstall osquery on CentOS-based Linux. Procedure Installation Download the installer. Copy the Ubuntu installer (osquery-<version>-rpm) to the endpoint (to a directory such as /tmp) cp ...
    • Installing osquery on MacOS Catalina if error "Apple cannot check it for malicious software"

      If the installation on MacOS Catalina fails with the error "osquery-v-xxxxx-Uptycs-darwin.pkg can't be opened because Apple cannot check it for malicious software" Then download the agent without flags & secret ...and install it.  Then download the ...
    • Steps to manually install/uninstall Osquery on Ubuntu based Linux

      Overview This document outlines the procedure on how to install/uninstall osquery on Ubuntu-based Linux. Procedure Installation Download the installer. Copy the Ubuntu installer (osquery-<version>-deb) to the endpoint (to a directory such as /tmp) cp ...
    • Steps to manually install / uninstall osquery on an Ubuntu system

      Overview This document outlines the procedure on how to install / uninstall osquery on an Ubuntu system Procedure Installation sudo dpkg -i osquery-<version>-Uptycs.deb Uninstall sudo service  osqueryd stop sudo apt-get remove osquery # Cleanup ...