Configuring the Next-Gen WAF agent

For most installations, you only need to configure the agent keys (accesskeyid and secretaccesskey) and the default agent configuration will suffice for everything else. As needed, you can use additional options to tailor the WAF for your environment.

Unless noted otherwise in the description, the configuration options are available in three forms: config file, command line, and by setting environment variables. Before using an option, be sure to check its status:

  • Active Check circle icon: indicates the option is supported and safe for use.
  • Experimental Flask icon: indicates the option is not fully developed and subject to change. Use caution when building automated processes involving experimental options as their functionality may change.
  • Deprecated Warning icon: indicates that while the option is still functional, it is no longer recommended for use and may be removed in a future release.

Time-duration values are specified in milliseconds unless a unit is included. Valid units are ns (nanoseconds), us (microseconds), ms (milliseconds), s (seconds), m (minutes) and h (hours). For example: 10s or 10m.

The following are the current configuration options (as of v4.75.0 on the linux platform). You can view these options on the installed Agent version by running with the --usage command line option.

Configuration options

The configuration options are as follows:

NameTypeStatusDescriptionDefault
accesskeyidstringCheck circle icon indicating active statusSet access key ID, required in most cases
anonymous-ip-secret-keystringCheck circle icon indicating active statusSet anonymous IP secret key. Default is to use secretaccesskey when generating anonymous IP addresses
bypass-egress-proxy-for-upstreamsbooleanFlask icon indicating experimental statusExclude all upstream traffic from using the egress proxyfalse
cleaner-intervaltime-durationCheck circle icon indicating active statusHow often to run cleanup routine10s
client-ip-headerstringCheck circle icon indicating active statusSpecify the request header containing the client IP addressX-Forwarded-For
configstringCheck circle icon indicating active statusSpecify the configuration file/etc/sigsci/agent.conf
context-expirationtime-durationCheck circle icon indicating active statusHow long to keep request context to match with response before cleanup10s
custom-request-headersstringFlask icon indicating experimental statusAdd custom headers to the RPC response, which will be added to the HTTP request by the module [format is CSV if name:val pairs with $AgentResponse, $RequestID, $TagList dynamic values]
debug-log-all-the-thingsbooleanFlask icon indicating experimental statusLog all the thingsfalse
debug-log-blocked-requestsbooleanFlask icon indicating experimental statusLog when a request is blockedfalse
debug-log-config-updatesintegerFlask icon indicating experimental statusLog when config updated or checked, 0=off, 1=updated, 2=more details0
debug-log-connection-errorsintegerFlask icon indicating experimental statusLog when connections are dropped due an error. 0=off,1=on0
debug-log-engine-errorsintegerFlask icon indicating experimental statusLog WAF engine errors: 0=off, 1=on, 2=verbose1
debug-log-proxy-requestsbooleanFlask icon indicating experimental statusGenerates debug output of proxied requestsfalse
debug-log-rpc-datastringFlask icon indicating experimental statusLog (hexdump) raw RPC data to the given file
debug-log-uploadsintegerFlask icon indicating experimental statusLog what is being sent to Signal Sciences: 0=off, 1=json, 2=json-pretty0
debug-log-web-inputsintegerFlask icon indicating experimental statusLog web inputs coming from the module: 0=off, 1=json, 2=json-pretty0
debug-log-web-outputsintegerFlask icon indicating experimental statusLog web outputs going back to the module: 0=off,1=json,2=json-pretty0
debug-standaloneintegerFlask icon indicating experimental statusBitfield: 0=normal, 1=no upload, 2=no download, 3=no networking, 4=use empty rules, 7=no net+empty rules0
download-cdn-urlstringFlask icon indicating experimental statusCDN URL to check and download new configurations before checking download-url, empty string disables CDN fetchhttps://wafconf.signalsciences.net
download-config-cachestringCheck circle icon indicating active statusFilename to cache latest downloaded config (if relative, then base it on shared-cache-dir)
download-config-versionintegerFlask icon indicating experimental statusForce the downloader to download a specific config version: 0=auto versioning0
download-failover-urlstringFlask icon indicating experimental statusURL to check and download new configurations if download-url is not availablehttps://sigsci-agent-wafconf-us-west-2.s3.amazonaws.com
download-intervaltime-durationFlask icon indicating experimental statusHow often to check for a new configuration30s
download-urlstringFlask icon indicating experimental statusURL to check and download new configurationshttps://sigsci-agent-wafconf.s3.amazonaws.com
envoy-expect-response-dataintegerFlask icon indicating experimental statusExpect response data from envoy: 0=response data is not expected and some dependent product features will not be available, 1=agent will wait for response data via http_grpc_access_log gRPC API0
envoy-grpc-addressstringFlask icon indicating experimental statusEnvoy gRPC address to listen on (unix domain socket path or host:port)
envoy-grpc-certstringFlask icon indicating experimental statusEnvoy gRPC optional TLS cert file (PEM format)
envoy-grpc-keystringFlask icon indicating experimental statusEnvoy gRPC optional TLS key file (PEM format)
haproxy-spoa-addressstringCheck circle icon indicating active statusHaproxy SPOA address to listen on (unix domain socket path or host:port)unix:/var/run/sigsci-ha.sock
haproxy-spoa-enabledbooleanCheck circle icon indicating active statusHaproxy SPOA agent enabledfalse
haproxy-spoa-lua-enabledbooleanCheck circle icon indicating active statusHaproxy SPOA Lua support enabled to edit response headersfalse
--helpCheck circle icon indicating active status(commandline only option)
Dump basic help text
inspection-alt-response-codescsv-integerWarning icon indicating deprecated statusDO NOT USE: the alternative response code concept is deprecated - all codes 300-599 are now considered blocking codes and this option will be removed
inspection-anomaly-durationtime-durationFlask icon indicating experimental statusEnvoy/revproxy global duration after which the request will be considered an anomaly and the response will be inspected even if nothing else was found in the request during inspection1s
inspection-anomaly-sizeintegerFlask icon indicating experimental statusEnvoy/revproxy global response size limit which the request will be considered an anomaly and the response will be inspected even if nothing else was found in the request during inspection524288
inspection-debugbooleanFlask icon indicating experimental statusEnvoy/revproxy global enable/disable inspection debug loggingfalse
inspection-max-content-lengthintegerFlask icon indicating experimental statusEnvoy/revproxy global max request content length that is allowed to be inspected307200
inspection-timeouttime-durationFlask icon indicating experimental statusEnvoy/revproxy global inspection timeout after which the system will fail open100ms
jaeger-tracingbooleanFlask icon indicating experimental statusEnables jaeger tracing - configured with JAEGER\_\* environment variables (currently for envoy only)false
--legalCheck circle icon indicating active status(commandline only option)
Show legal information and exit
local-networksstringCheck circle icon indicating active statusSet local networks for determining the real client IP (CSV of CIDR, 'all', 'none', or 'private'). These are the networks trusted to set the client IP header.all
log-outstringCheck circle icon indicating active statusLog output location, 'stderr', 'stdout', or file name (NOTE: on Windows, important logs will be sent to the eventlog)
max-backlogintegerCheck circle icon indicating active statusMaximum RPC requests in queue (by default scaled with rpc-workers)0
max-connectionsintegerCheck circle icon indicating active statusMaximum in-flight RPC connections (by default scaled with rpc-workers)0
max-inspectingintegerWarning icon indicating deprecated statusReverse proxy only - maximum in-flight transactions that the engine can be inspecting, 0=unlimited0
max-logsintegerCheck circle icon indicating active statusMaximum number of log lines held while waiting to send upstream1000
max-procsstringCheck circle icon indicating active statusMaximum number or percentage of CPUs (cores) to use e.g max-procs=4 or max-procs="100%".
max-recordsintegerCheck circle icon indicating active statusMaximum number of records held while waiting to send (by default scaled with rpc-workers)0
reverse-proxybooleanWarning icon indicating deprecated statusEnable the reverse proxy, which requires setting a listener and upstreamfalse
reverse-proxy-tls-min-versionstringWarning icon indicating deprecated statusReverse proxy TLS listener min version1.0
revproxy-reload-on-updatebooleanFlask icon indicating experimental statusReload the reverse proxy service config on agent config updates to support dynamic reconfiguration (only functions on OSes that support zero downtime restarts such as Linux >= 3.9 kernel)false
rpc-addressstringCheck circle icon indicating active statusRPC address to listen on and serve modules fromunix:/var/run/sigsci.sock
rpc-versionintegerWarning icon indicating deprecated statusRPC protocol version0
rpc-workersintegerFlask icon indicating experimental statusRPC workers to use. If unset, then the max-procs value will be used0
sample-percentintegerCheck circle icon indicating active statusSample input, 100=process everything, 0=ignore everything100
secretaccesskeystringCheck circle icon indicating active statusSet secretaccesskey, required along with accesskeyid in most cases
server-flavorstringFlask icon indicating experimental statusServer-flavor, allow distinguishing this revproxy install as a buildpack or other flavor.
server-hostnamestringCheck circle icon indicating active statusServer hostname. By default, the agent asks the OS for the hostname configuration unless a value is configured here.
service-shutdown-timeouttime-durationCheck circle icon indicating active statusTimeout waiting for pending transactions to complete during service shutdown2s
shared-cache-dirstringFlask icon indicating experimental statusBase directory for any cache files/tmp/sigsci-agent.cache
--show-tls-cipher-suitesCheck circle icon indicating active status(commandline only option)
Show available TLS cipher suites and exit
startup-probe-filepathstringFlask icon indicating experimental statusFilepath to create file checked by startup probes. Creates the file once the agent has loaded a ruleset. Ex: /sigsci/tmp/startup
startup-probe-listenerstringFlask icon indicating experimental statusHTTP listener for responding to startup probes. Returns HTTP 200 once the agent has loaded a ruleset. Ex: 0.0.0.0:2024
statsd-addressstringCheck circle icon indicating active statusSet the statsd address to send metrics to (e.g., hostname:port or unix:///path/socket)
statsd-metricscsv-stringFlask icon indicating experimental statusSet the statsd metrics filter (glob patterns allowed - assumed prefix if no patterns used)*
statsd-typestringFlask icon indicating experimental statusSet the statsd server type to enable advanced features (e.g., statsd or dogstatsd)statsd
upload-logstringFlask icon indicating experimental statusLog filename to write agent event data
upload-log-header-mapbooleanFlask icon indicating experimental statusHTTP request,response header data in map formatfalse
upload-syslogbooleanFlask icon indicating experimental statusWrite agent event data to syslogfalse
upload-urlstringFlask icon indicating experimental statusURL to upload agent datahttps://c.signalsciences.net/0/push
--usageCheck circle icon indicating active status(commandline only option)
Dump full usage text
validate-configbooleanCheck circle icon indicating active statusValidate the config entries provided to warn against potentially invalid entriestrue
--versionCheck circle icon indicating active status(commandline only option)
Show version information and exit
waf-data-logstringFlask icon indicating experimental statusFilename to log WAF inspection data (currently JSON format). Using "eventlog" on Windows will send these to the eventlog. Requests are logged to the provided location if they have at least one signal added by default inspectors or if they have at least one signal added by a request rule with a Request logging value of Sampled.
waf-data-log-allbooleanFlask icon indicating experimental statusWhen logging WAF inspection data, log every request not just those with signals.false
windows-eventlog-levelintegerFlask icon indicating experimental statusSet the windows eventlog level (use names that will be converted to integers: debug, info, warning, error, or none).3

Reverse proxy listener options

Reverse proxy mode supports multiple listeners. In the configuration file, each listener is defined in a revproxy-listener block that has its own set of directives. Each block is formatted as a TOML table. Each block must:

  • have a unique name in the format [revproxy-listener.NAME], where NAME is a string that you define.
  • be located at the end of the configuration after all other global options.

Alternatively, use command-line options or environment variables with this format:

  • --option='name1:{opt=val,...};name2:{opt=val,...}'
  • SIGSCI_OPTION='name1:{opt=val,...};name2:{opt=val,...}'

For more details and an example, check out our Reverse proxy listener configuration section.

NameTypeStatusDescriptionDefault
access-logstringCheck circle icon indicating active statusAccess log filename
close-conn-on-request-smugglingbooleanWarning icon indicating deprecated status'Connection: close' header will be added to requests that appear to be HTTP Request Smuggling attacksfalse
conn-idle-maxintegerCheck circle icon indicating active statusMax idle connections in the upstream connection pool (0 will disable connection pooling)100
conn-idle-timeouttime-durationCheck circle icon indicating active statusIdle connection timeout for the upstream connection pool1m30s
conn-keepalivetime-durationCheck circle icon indicating active statusConnection keepalive interval for upstream connections30s
conn-max-per-hostintegerCheck circle icon indicating active statusMaximum total number of upstream connections in any state per host (0 is unlimited). Connections over the limit will block until more are available0
conn-timeouttime-durationCheck circle icon indicating active statusConnection timeout for upstream connections30s
enabledbooleanCheck circle icon indicating active statusEnable/disable the reverse proxy listenertrue
expect-continue-timeouttime-durationCheck circle icon indicating active statusTimeout waiting for 'continue' after 'expect' for upstream traffic1s
expose-raw-headersbooleanWarning icon indicating deprecated statusThis experimental option replaces 'close-conn-on-request-smuggling' functionality. The option will need to be enabled per each reverse proxy listener.true
extend-content-typesbooleanCheck circle icon indicating active statusEnables extended content inspection while running in reverse proxy modefalse
grpcbooleanCheck circle icon indicating active statusEnable proxying and inspection of gRPC trafficfalse
http2booleanCheck circle icon indicating active statusEnable HTTP/2 support for the listenertrue
http2-upstreamsbooleanCheck circle icon indicating active statusPrefer HTTP/2 for the upstreamstrue
idle-timeouttime-durationCheck circle icon indicating active statusNetwork idle timeout for the listener0s
inspect-websocketbooleanCheck circle icon indicating active statusEnable/disable websocket inspectionfalse
inspection-alt-response-codescsv-integerWarning icon indicating deprecated statusDO NOT USE: the alternative response code concept is deprecated - all codes 300-599 are now considered blocking codes and this option will be removed
inspection-anomaly-durationtime-durationCheck circle icon indicating active statusDuration after which the request will be considered an anomaly and the response will be inspected even if nothing else was found in the request during inspection1s
inspection-anomaly-sizeintegerCheck circle icon indicating active statusResponse size limit which the request will be considered an anomaly and the response will be inspected even if nothing else was found in the request during inspection524288
inspection-debugbooleanCheck circle icon indicating active statusEnable/disable inspection debug loggingfalse
inspection-max-content-lengthintegerCheck circle icon indicating active statusMax request content length that is allowed to be inspected307200
inspection-timeouttime-durationCheck circle icon indicating active statusInspection timeout after which the system will fail open100ms
listenerstringCheck circle icon indicating active statusListener URL [scheme://address:port]
log-all-errorsbooleanCheck circle icon indicating active statusLog all errors, not just commonfalse
minimal-header-rewritingbooleanCheck circle icon indicating active statusMinimal header rewriting. If enabled, then only hop-by-hop headers will be removed as required by RFC-2616 sec 13.5.1. No proxy headers will be added/modified, though they will be passed through if trust-proxy-headers is setfalse
pass-host-headerbooleanCheck circle icon indicating active statusPass the client supplied host header through to the upstream (including the upstream TLS handshake for use with SNI and certificate validation)true
read-buffer-sizeintegerCheck circle icon indicating active statusConfigures the size of the network transport's read buffer in bytes4096
read-timeouttime-durationCheck circle icon indicating active statusNetwork read timeout for the listener0s
remove-hop-headerbooleanCheck circle icon indicating active statusUnused hop headers will be removed from forwarded requeststrue
request-timeouttime-durationCheck circle icon indicating active statusOverall request timeout (will enable buffering, which may cause issues with streaming services)0s
response-flush-intervaltime-durationCheck circle icon indicating active statusInterval to flush any buffered/streaming response data (0 disables forced flushes; -1 forces flushes after every write; interval values force flushes on a fixed time interval)0s
response-header-timeouttime-durationCheck circle icon indicating active statusResponse header timeout waiting for upstream responses0s
shutdown-timeouttime-durationCheck circle icon indicating active statusTimeout waiting for pending transactions to complete during server shutdown30s
tls-ca-rootsstringCheck circle icon indicating active statusTLS trusted certificate authority certificates file (PEM format)
tls-certstringCheck circle icon indicating active statusTLS certificate file (PEM format)
tls-cipher-suitescsv-stringCheck circle icon indicating active statusTLS listener cipher suites. Only affects TLS 1.2 and below. [use --show-tls-cipher-suites for a list]TLS\_ECDHE\_RSA\_WITH\_AES\_128\_GCM\_SHA256,TLS\_ECDHE\_RSA\_WITH\_AES\_128\_CBC\_SHA,TLS\_RSA\_WITH\_AES\_128\_CBC\_SHA
tls-handshake-timeouttime-durationCheck circle icon indicating active statusTLS handshake timeout for upstream connections10s
tls-insecure-skip-verifybooleanCheck circle icon indicating active statusInsecurely skip upstream TLS verification (for self signed certs, etc.)false
tls-keystringCheck circle icon indicating active statusTLS private key file (PEM format)
tls-key-passphrasestringCheck circle icon indicating active statusTLS private key passphrase in the format type:data, where type is one of: pass or file (EX: pass:mypassword or file:/etc/secrets/tls-key-passphrase)
tls-min-versionstringCheck circle icon indicating active statusTLS listener min version1.0
tls-verify-servernamestringCheck circle icon indicating active statusForce the servername used in upstream TLS verification; consider using pass-host-header first, but this may be required if neither the hostname used by the downstream client nor the hostname/ip used in the upstream URL is listed in the upstream TLS certificate
trust-proxy-headersbooleanCheck circle icon indicating active statusTrust the incoming proxy (X-Forwarded-For*) header values. If not trusted, then incoming proxy headers are removed before any additions are madetrue
upstreamscsv-stringCheck circle icon indicating active statusUpstream, comma separated upstream URLs [scheme://address:port]
write-buffer-sizeintegerCheck circle icon indicating active statusConfigures the size of the network transport's write buffer in bytes4096
write-timeouttime-durationCheck circle icon indicating active statusNetwork write timeout for the listener0s

System environment options

These system level environment variable based options will also affect processing.

NameTypeStatusDescription
HTTP_PROXY or http_proxyurlWarning icon indicating deprecated statusProxy outbound HTTP requests through the proxy at the defined URL
HTTPS_PROXY or https_proxyurlCheck circle icon indicating active statusProxy outbound HTTPS requests through the proxy at the defined URL (takes precedence over HTTP_PROXY for HTTPS requests)
NO_PROXY or no_proxycsv-urlCheck circle icon indicating active statusComma separated list of URLs NOT to proxy or '*' for all URLs

The options are generally available in three forms, overridden in the following order:

  1. In the configuration file (default: /etc/sigsci/agent.conf)
  2. On the command line, prefixed with a double dash (--) (e.g., --help)
  3. As an environment variable, all capitalized, prefixed with SIGSCI_ and dashes changed to underscores (_) (e.g., the max-procs option would become the SIGSCI_MAX_PROCS environment variable)

There are a few exceptions:

  • Informational options such as --help, --legal, and --version only make sense as command line options as noted.
  • The HTTP_PROXY environment variable is deprecated and will no longer be honored for https connections. HTTPS_PROXY must be used.
  • The agent will honor the system HTTPS_PROXY environment variable allowing configuration of an egress HTTPS proxy URL for those sites where outbound access must be through a proxy (e.g., HTTPS_PROXY=http://10.0.0.1:8080).

Configuring FIPS 140-3 compliance for the agent

IMPORTANT: FIPS 140-3 mode is only compatible for agent version 4.71.0 or higher.

The Next-Gen WAF agent libraries and backend connections are FIPS 140-3 compliant when FIPS 140-3 mode is enabled. FIPS 140-3 is a North American security standard used to ensure hardware and software are secure, tamper-resistant, and properly implemented to protect sensitive information.

  1. Linux package-based systems
  2. Windows package-based systems

To achieve FIPS 140-3 compliance for communication between the agent and cloud services, enable one of the following FIPS 140-3 mode environment variables:

  • GODEBUG=fips140=only: the agent strictly negotiates only FIPS 140-3 approved TLS versions and algorithms. Any use of non-FIPS-approved cryptographic algorithms will cause the agent to panic or error. To enable GODEBUG=fips140=only, run the following command:

    export GODEBUG=fips140=only
  • GODEBUG=fips140=on: the agent negotiates only FIPS 140-3 approved TLS versions and algorithms. This option is not as strict as GODEBUG=fips140=only and can be used if the agent encounters issues or panics with the stricter setting. To enable GODEBUG=fips140=on, run the following command:

    export GODEBUG=fips140=on

To check if FIPS 140-3 mode is enabled, send the SIGUSR1 signal to the sigsci-agent process:

kill -s USR1 `pidof sigsci-agent`

Configuring HTTPS proxy for the agent

If the system the agent is running on does not have direct internet access, it may need to be configured to access the internet via a HTTPS proxy. To do this, one or more of the HTTPS_PROXY, or NO_PROXY system environment variables will need to be configured.

While some systems may set this system wide, we recommend using the proxy for only the Next-Gen WAF agent.

Also, note that the package the agent relies on to determine the proxy URL from HTTPS_PROXY, NO_PROXY variables, ignores localhost or loopback addresses (e.g., 127.0.0.1, 0.0.0.0) with or without the port number. If you are relying on HTTPS_PROXY or NO_PROXY environment variables to be set with either of the aforementioned addresses, use a fully qualified domain name (FQDN) via the operating systems host file (e.g., c:\Windows\System32\Drivers\etc\hosts or /etc/hosts) and use it as the value.

  1. Linux package-based systems
  2. Windows package-based systems

On Linux and similar systems, the sigsci-agent service (e.g., systemd, upstart, init.d) will source in the /etc/default/sigsci-agent file containing var=value pairs. To set the proxy for the agent, add the environment variable configurations into this file, one per line.

For example, to use the HTTPS proxy at 10.0.0.1 on port 8080, add the following to /etc/default/sigsci-agent:

HTTPS_PROXY=http://10.0.0.1:8080

On distributions using upstart, the export function needs to be prefixed:

$ export HTTPS_PROXY=http://10.0.0.1:8080

The sigsci-agent service will then need to be restarted.

Configuring the agent to use a proxy for egress traffic

The agent can be configured to use a local proxy for egress traffic to the Fastly cloud infrastructure by setting the HTTPS_PROXY environment variable. Add the following line to /etc/default/sigsci-agent, replacing IP-OR-HOST-NAME with the IP address or hostname to proxy traffic to:

export HTTPS_PROXY=IP-OR-HOSTNAME

Restart the agent and verify the configuration.

Next steps

Explore our module options and install the Next-Gen WAF module.