Skip to main content
Version: 0.0.1

Security and observability configuration

Native TOML settings

server.trusted_proxy_cidrs is the native trust boundary for client identity: only direct peers within these CIDRs may supply forwarding headers used by the proxy. Keep it empty unless a trusted ingress is in front of BeaRust.

[rate_limit] configures the native default policy:

FieldDefaultValues / validation
enabledfalseboolean
actionmonitormonitor or block
capacity10011000000
refill_per_second10.0finite 0.001100000
key_scopeproxy_host_ipproxy_host_ip or proxy_host_path_ip

[prometheus] is disabled by default. Its defaults are internal_only = true, require_auth = true, bind = "127.0.0.1:9090", and max_output_bytes = 262144 (256 KiB). max_output_bytes must be from 1 through 4194304 (4 MiB). An enabled internal endpoint must bind loopback; an enabled endpoint exposed beyond loopback must require authentication.

[prometheus]
enabled = true
internal_only = true
require_auth = true
bind = "127.0.0.1:9090"
max_output_bytes = 262144

If the Prometheus bind equals server.control_bind, /metrics is mounted on the control listener. Otherwise, BeaRust starts a dedicated listener exposing only /metrics, not the control-plane UI or API. See metrics and errors.

Database-backed policies

The following controls are persisted control-plane state, not TOML sections: WAF rules/configuration, IP security rules, host authentication, bot policies, per-host rate-limit overrides, analytics retention, adaptive-tuning emergency state, and user/role policy. They can refresh live policy stores after an authenticated management change. Their endpoints and request bodies belong to the control-plane API reference, not this page.

Logging

bearust serve --json-logs selects JSON tracing output. RUST_LOG selects the filter and defaults to info when absent. Request completion events include event = "request_complete", request_id, method, path, route, upstream, status, latency_ms, and error_category. An incoming request ID is accepted only when it is non-empty, at most 128 bytes, UTF-8, and uses letters, digits, -, :, _, or .; otherwise BeaRust generates a safe ID.