Configuration Reference

MiBee Steward uses YAML configuration files with environment variable overrides. This document covers all available configuration options.

Configuration Structure

The configuration is organized into 15 main sections:

  • Server (server): HTTP server settings and trusted proxies
  • Database (database): Database configuration (SQLite)
  • Authentication (auth): JWT and cookie settings
  • CORS (cors): Cross-origin resource sharing
  • Heartbeat (heartbeat): Device monitoring settings
  • Scanner (scanner): Network scanner engine (v2)
  • Retention (retention): Data lifecycle and cleanup
  • Rate Limit (rate_limit): Global request throttling
  • Prometheus (prometheus): Metrics collection
  • Dashboard (dashboard): Dashboard data source configuration
  • Storage (storage): File upload settings
  • Logging (log): Log output configuration
  • Network (network): This instance's network identity and CIDR
  • Center (center): Distributed agent mode (upstream center reporting)
  • Security (security): Master key and credential encryption

Configuration Loading Priority

Configuration values are loaded in the following order (with later values overriding earlier ones):

  1. YAML Configuration File: Base configuration loaded from whatever the -config flag points at (defaults to configs/config.example.yaml; production deployments typically copy it to config.yaml and pass that)
  2. Environment Variables: MIBEE_* prefixed variables override YAML values

Any key set to 0 (or the zero value for its type) is treated as "use default", it does not mean "no limit" or "keep forever".

Environment Variable Override Pattern

Environment variables override configuration values using the following pattern:

  • Prefix: MIBEE_
  • Section and key: Convert to uppercase, replace dots with underscores
  • Example: server.port → MIBEE_SERVER_PORT

1. Server Configuration

Key Type Default Description
server.port int 8080 HTTP port to listen on
server.demo_mode bool false Seed a fictional demo inventory (2 networks + ~20 TEST-NET devices + simulated activity) on an empty database at boot; a non-empty DB is never touched. Also enabled with the -demo flag. Never enable in production, the data is fake by design.
server.host string "0.0.0.0" Bind address (0.0.0.0 = all interfaces)
server.read_timeout duration "15s" Max time to read the full request (headers + body)
server.write_timeout duration "5m" Max response lifetime. Must exceed the slowest synchronous endpoint (POST /scanner/scan). Auto-raised to scanner.default_timeout×2+30s if configured lower, so synchronous scans are never truncated.
server.idle_timeout duration "120s" Keep-alive idle timeout
server.trusted_proxies []string [] List of trusted proxy CIDRs. X-Forwarded-For is only honored when the TCP peer is in this list, otherwise the TCP peer address is used as the client IP. Empty list = trust no proxy (safe for direct exposure). Set to the proxy's source range when deploying behind nginx.

Environment Variables:

  • MIBEE_SERVER_PORT
  • MIBEE_SERVER_HOST
  • MIBEE_SERVER_READ_TIMEOUT, MIBEE_SERVER_WRITE_TIMEOUT, MIBEE_SERVER_IDLE_TIMEOUT
  • MIBEE_SERVER_TRUSTED_PROXIES (comma-separated trusted proxy list)

Example:

server:
  port: 8080
  host: "0.0.0.0"
  read_timeout: "15s"
  write_timeout: "5m"     # auto-raised if too low for synchronous scans
  idle_timeout: "120s"
  trusted_proxies:
    - "172.16.0.0/12"

# Environment override
export MIBEE_SERVER_PORT=3000
export MIBEE_SERVER_HOST="192.168.1.100"

2. Database Configuration

Key Type Default Description
database.sqlite.path string "./data/mibee.db" SQLite database file path

Environment Variables:

  • MIBEE_DATABASE_SQLITE_PATH

Example:

database:
  sqlite:
    path: "./data/mibee.db"

3. Authentication Configuration

Key Type Default Description
auth.jwt_secret string none (required) JWT signing key. Required: startup fails when empty, shorter than 32 characters, or equal to the placeholder "change-me-in-production" (25 chars, it fails both checks).
auth.token_expiry string "24h" JWT token lifetime
auth.initial_admin_password string "" Bootstrap admin credential. Empty (default) = first-run browser setup: the admin is seeded with no password and the login page asks you to create one (GET /auth/setup-status → POST /auth/setup, policy-checked, one-shot). A non-empty value is a temporary credential; first login forces a change.
auth.cookie_domain string "" Cookie domain (empty = current domain)
auth.cookie_secure bool false Set true for HTTPS-only cookies
auth.cookie_same_site string "strict" Cookie same-site policy: "strict" or "lax"
auth.cookie_max_age duration (falls back to auth.token_expiry, then 86400) Auth cookie lifetime. Falls back to auth.token_expiry when unset, then 86400 seconds (24h).
auth.password_policy.min_length int 8 Minimum password length (register / change / reset paths).
auth.password_policy.require_uppercase bool false Require at least one uppercase letter.
auth.password_policy.require_lowercase bool false Require at least one lowercase letter.
auth.password_policy.require_digit bool false Require at least one digit.
auth.password_policy.require_special bool false Require at least one special character.
auth.lockout.max_failed_attempts int 5 Consecutive failed logins before the account locks.
auth.lockout.lock_minutes int 30 Lockout duration. An expired lock resets the failure counter.

Password policy & lockout are editable from the web UI: the admin page Settings → Security (GET/PUT /api/v1/settings/auth) persists overrides to the system_settings table with precedence **DB overlay > this config file

built-in defaults**, effective on the next password check/login, no restart. The defaults in this table only apply when nothing overrides them. The default policy checks length only (min 8); the character classes are opt-in, mandatory classes proved too heavy for home deployments. Turn any class on via the UI toggle or an explicit require_*: true here. Also note the first-run behavior: an EMPTY auth.initial_admin_password (the installer default) seeds the admin with no password, the login page detects it (public GET /auth/setup-status) and shows a create-admin-password form instead of the login form (POST /auth/setup, policy-checked, one-shot; login attempts return 409 setup_required meanwhile). A non-empty value is a temporary bootstrap credential (policy not applied) and the first login forces a browser change backed by a server-side gate.

Environment Variables:

  • MIBEE_AUTH_JWT_SECRET
  • MIBEE_AUTH_TOKEN_EXPIRY
  • MIBEE_AUTH_INITIAL_ADMIN_PASSWORD
  • MIBEE_AUTH_COOKIE_DOMAIN
  • MIBEE_AUTH_COOKIE_SECURE
  • MIBEE_AUTH_COOKIE_SAME_SITE
  • MIBEE_AUTH_COOKIE_MAX_AGE

Example:

auth:
  jwt_secret: "your-strong-jwt-secret-here"
  token_expiry: "24h"
  initial_admin_password: "secure_admin_password"
  cookie_domain: "example.com"
  cookie_secure: true
  cookie_same_site: "strict"

# Environment overrides
export MIBEE_AUTH_JWT_SECRET="super-secret-key"
export MIBEE_AUTH_COOKIE_SECURE=true

RBAC Configuration

Key Type Default Description
rbac.scope_default string "open" Network scope mode. open = all users can access all networks; closed = users can only access explicitly granted networks (managed via the network-grant endpoints in the API Reference). Admins can access all networks in either mode.

4. CORS Configuration

Key Type Default Description
cors.allowed_origins []string no default Allowed origins for cross-origin requests. Unset/empty = no cross-origin allowed (same-origin only). Startup logs a warning for origins containing localhost/127.0.0.1.

Environment Variables:

  • MIBEE_CORS_ALLOWED_ORIGINS

Example:

cors:
  allowed_origins:
    - "http://localhost:5173"
    - "http://localhost:8080"
    - "https://yourdomain.com"

# Environment override
export MIBEE_CORS_ALLOWED_ORIGINS="https://example.com,https://app.example.com"

5. Heartbeat Configuration

Key Type Default Description
heartbeat.default_interval int 30 Default device check interval (seconds)
heartbeat.tick_interval_seconds int 30 Interval (seconds) between heartbeat scheduler ticks. Drives how often the probe loop fires. Decoupled from default_interval so the scheduler rate can be tuned independently of the per-device default.
heartbeat.timeout int 5 Device probe timeout (seconds)
heartbeat.retention_days int (no in-code default) Legacy passthrough: only takes effect when retention.heartbeat_results_days is unset (effective default 7 days; configs/config.example.yaml ships 30).
heartbeat.offline_threshold int 5 Number of consecutive probe failures before the device flips to offline (5 × the default 30s interval ≈ 2.5 minutes).
heartbeat.offline_backoff_ticks int 10 Probe offline devices once every N ticks instead of every tick (on a 30s ticker, N=10 ≈ 5min between probes for known-dead hosts). Stops the steady write of timeout rows for devices that won't answer. A scan that revives a host clears its failure count immediately, so backoff never delays recovery. 0 disables backoff.

Environment Variables:

  • MIBEE_HEARTBEAT_DEFAULT_INTERVAL
  • MIBEE_HEARTBEAT_TICK_INTERVAL_SECONDS
  • MIBEE_HEARTBEAT_TIMEOUT
  • MIBEE_HEARTBEAT_RETENTION_DAYS
  • MIBEE_HEARTBEAT_OFFLINE_THRESHOLD
  • MIBEE_HEARTBEAT_OFFLINE_BACKOFF_TICKS

Example:

heartbeat:
  default_interval: 30
  tick_interval_seconds: 30
  timeout: 5
  retention_days: 30
  offline_threshold: 5
  offline_backoff_ticks: 10

# Environment overrides
export MIBEE_HEARTBEAT_DEFAULT_INTERVAL=60
export MIBEE_HEARTBEAT_TIMEOUT=10

6. Prometheus Configuration

Key Type Default Description
prometheus.enabled bool , Currently unused: the /metrics endpoint is always mounted regardless of this switch.
prometheus.metrics_path string , Currently unused: the metrics path is hardcoded to /metrics; this key has no effect.

Environment Variables:

  • MIBEE_PROMETHEUS_ENABLED (no effect, see table above)
  • MIBEE_PROMETHEUS_METRICS_PATH (no effect, see table above)

Example:

prometheus:
  enabled: true
  metrics_path: "/metrics"

# Environment override
# (MIBEE_PROMETHEUS_METRICS_PATH has no effect: the metrics path is hardcoded to /metrics)

7. Dashboard Configuration

Key Type Default Description
dashboard.data_source_type string "prometheus" Data source: "prometheus"
dashboard.prometheus_url string "http://localhost:9090" Prometheus server URL

Environment Variables:

  • MIBEE_DASHBOARD_DATA_SOURCE_TYPE
  • MIBEE_DASHBOARD_PROMETHEUS_URL

Example:

dashboard:
  data_source_type: "prometheus"
  prometheus_url: "http://localhost:9090"

8. Storage Configuration

Key Type Default Description
storage.upload_path string "./data/uploads" File upload directory
storage.max_file_size int64 104857600 Maximum upload size in bytes (default: 100MB)

Environment Variables:

  • MIBEE_STORAGE_UPLOAD_PATH
  • MIBEE_STORAGE_MAX_FILE_SIZE

Example:

storage:
  upload_path: "./data/uploads"
  max_file_size: 104857600

# Environment overrides
export MIBEE_STORAGE_UPLOAD_PATH="/var/lib/mibee/uploads"
export MIBEE_STORAGE_MAX_FILE_SIZE=209715200  # 200MB

9. Logging Configuration

Key Type Default Description
log.level string "info" Log level: "debug", "info", "warn", "error"
log.format string "text" Log format: "text" or "json"

Environment Variables:

  • MIBEE_LOG_LEVEL
  • MIBEE_LOG_FORMAT

Example:

log:
  level: "info"
  format: "text"

# Production configuration
log:
  level: "info"
  format: "json"

# Environment overrides
export MIBEE_LOG_LEVEL=debug
export MIBEE_LOG_FORMAT=json

10. Scanner Configuration (v2 engine)

The network scanner uses a plugin-based 5-layer architecture (probe → classify → handler → persist → orchestrate). See Architecture.

Key Type Default Description
scanner.enabled bool , Currently unused (exists in the struct, consumed nowhere): scanner routes and the background scheduler start unconditionally.
scanner.max_concurrent_scans int 3 Cap on top-level scans running at once (the engine's concurrent-scan semaphore, live and enforced).
scanner.default_timeout int (s) 300 Per-host pipeline timeout for cron-driven scans. Also drives the write_timeout auto-raise.
scanner.max_concurrent_hosts int 50 Parallelism cap for per-host scanning
scanner.allow_reserved_targets bool false Escape hatch for the reserved-range scan-target rejection (#317): when true, loopback/unspecified/link-local/multicast/broadcast/240-4 targets are accepted (syntax still validated). Set ONLY for synthetic planes, cmd/loadgen benchmarks on 127/8. Env MIBEE_SCANNER_ALLOW_RESERVED_TARGETS.
scanner.retention_days int , Legacy fallback: only takes effect when retention.scan_results_days is unset (then 30). The sweep runs every retention.sweep_interval_hours (default 6h), not daily.
scanner.default_cron_expr string "0 */6 * * *" Default cron for newly-created scan tasks
scanner.engine string "v2" Engine selection (only "v2" is supported; v1 was removed)
scanner.persist_raw_evidence bool false Write every probe observation to service_evidence (voluminous, enable for debugging only)
scanner.lost_threshold int 2 Consecutive scans absent from the alive set before a device is declared lost. Its heartbeat-side counterpart is heartbeat.offline_threshold (probe-failure count).
scanner.per_probe_timeout int (s) 3 Timeout for a SINGLE probe attempt (one SNMP Get / TCP dial / HTTP fetch). Distinct from default_timeout (the whole per-host pipeline).
scanner.snmp_community string "public" Global SNMP community string (used by v1/v2c scans).
scanner.oui_path string "" Path to an IEEE OUI vendor file (MA-L+MA-M+MA-S, produced by scripts/fetch-oui.sh). Empty = use the embedded curated CC-BY-SA table (out-of-box coverage of common vendors). Override: MIBEE_SCANNER_OUI_PATH.
scanner.fingerprint_path string "" Directory of fingerprint YAML rules (see docs/fingerprint-spec.md). Empty = rules embedded in the binary.
scanner.ebpf.enabled bool false Enable the eBPF passive observer (no-op unless built with make build-with-ebpf)
scanner.ebpf.interfaces []string [] Interfaces to attach the TC program to (empty = all non-loopback)
scanner.pipeline_defaults.* various , Per-stage enable flags + default_ports (expanded to include camera + prometheus ports)
scanner.agent_lease_ttl duration "5m" Lease expiry for agent-managed devices. After an agent stops reporting, the device is marked lost within this time.
scanner.lease_sweep_interval duration "60s" How often the lease sweeper runs.
scanner.reconcile_interval duration "1h" Network attribution reconciliation interval. Detects devices whose IP has drifted outside their network's CIDR.

Config Backup (config_backup)

Key Type Default Description
scanner.config_backup.enabled bool false Enable SSH config backup (requires security.master_key + bound SSH credentials)
scanner.config_backup.interval_seconds int (s) 21600 Config backup polling interval (seconds). <=0 → 6 hours (21600s).
scanner.config_backup.timeout_seconds int (s) 30 Per-device SSH timeout (seconds). <=0 → 30s.

Router ARP Scan

Key Type Default Description
scanner.router_arp.routers []string [] Router IPs for cross-subnet ARP walks.
scanner.router_arp.community string (fallback) Router SNMP community. Falls back to scanner.snmp_community when empty (then "public").
scanner.router_arp.timeout int (s) 4 Per-router ARP walk timeout.

Reverse DNS

Key Type Default Description
scanner.rdns.dns_servers []string [] DNS servers for reverse DNS lookups.
scanner.rdns.timeout int (s) 2 Reverse DNS query timeout.

mDNS

Key Type Default Description
scanner.mdns.unicast_queries bool false Enable mDNS unicast queries (for devices that don't respond to multicast).

ARP Scan

Key Type Default Description
scanner.arp_scan.interface string "" Network interface name for ARP scan.

Synchronous scan limit: POST /scanner/scan rejects targets >1024 IPs with HTTP 413. Use the async task API (POST /scanner/tasks + /trigger) for larger ranges.

Example:

scanner:
  enabled: true
  default_timeout: 300
  max_concurrent_hosts: 50
  retention_days: 30
  default_cron_expr: "0 */6 * * *"
  engine: "v2"
  persist_raw_evidence: false
  lost_threshold: 2
  per_probe_timeout: 3
  snmp_community: "public"
  pipeline_defaults:
    icmp_enabled: true
    snmp_enabled: true
    port_scan_enabled: true
    default_ports: "22,80,443,8080,8443,8000,554,8554,9090,9100,9104,9113,9121,9187,161"
    service_detection_enabled: true
    prometheus_check_enabled: true
    node_exporter_enabled: true
  ebpf:
    enabled: false       # requires make build-with-ebpf + kernel ≥5.8 + CAP_BPF
    interfaces: []       # empty = all non-loopback
  config_backup:
    enabled: false
    interval_seconds: 21600   # <=0 → 6h
    timeout_seconds: 30
  router_arp:
    routers: []
    community: "public"
    timeout: 4
  rdns:
    dns_servers: []
    timeout: 2
  mdns:
    unicast_queries: false

Probe (Synthetic Probing) Configuration

Per-target interval/timeout live on each probe_targets row (managed in the UI/API); this block tunes the engine itself and its two built-in subsystems, the egress-quality matrix (#608) and the discover-then-probe autogen policy (#606).

Key Type Default Description
probe.max_concurrency int 8 Max simultaneous probes (semaphore). Replaces the previously hard-coded bound of 8; 0 = default, capped at 64. Env MIBEE_PROBE_MAX_CONCURRENCY.
probe.notify_fail_threshold int 3 Consecutive failing runs a probe track (per target × vantage) needs before probe_failed fires into notifications. 0 = default 3, range 1–10; at the recommended 300s cadence the default declares within 15 minutes. Env MIBEE_PROBE_NOTIFY_FAIL_THRESHOLD.
notify.retry_window_minutes int 30 Bounded delayed-retry window for retryable delivery failures (#633): the receiver being briefly unreachable requeues with growing backoff until the window expires, then a final failed row. 0 = default 30, negative = disabled. In-memory only (does not survive restart). Env MIBEE_NOTIFY_RETRY_WINDOW_MINUTES.
agent_fleet.offline_threshold_minutes int 10 How stale an agent's last_report_at must be before agent_offline fires. 0 = default 10 (two fully quiet cycles at the recommended probe cadence), range 1–1440. Env MIBEE_AGENT_FLEET_OFFLINE_THRESHOLD_MINUTES.
probe.quality.enabled bool true (absent key = ON) Network egress quality assessment: a system-seeded matrix of public probe points executed from EVERY vantage (center + all agents), analyzed per network. An absent key now defaults ON (upgrade-carried old configs no longer silently lose the feature); only an explicit enabled: false turns it off. The runtime switch lives in the web UI (Settings → Probes, settings-center override, no restart). Env MIBEE_PROBE_QUALITY_ENABLED.
probe.quality.window_minutes int 15 Analyzer lookback window (5–1440). Env MIBEE_PROBE_QUALITY_WINDOW_MINUTES.
probe.quality.interval_seconds int 120 Seeded cadence of every quality target (≥10).
probe.quality.http_degraded_ms int 800 p50 latency threshold (http legs) marking a vantage degraded, on top of the ok-rate threshold.
probe.quality.dns_degraded_ms int 300 Same for dns legs.
probe.quality.ok_rate_threshold float 0.9 Minimum success rate within the window (0..1].
probe.quality.loss_pct_threshold float 5 Burst-sampled packet-loss percentage (#744) that marks a vantage degraded, on top of the ok-rate threshold. Consumed as the stable verdict code loss_burst.
probe.quality.jitter_degraded_ms float 30 Burst jitter budget in ms (#744, mean absolute difference of consecutive echo RTTs); exceeding it marks a vantage degraded with the stable verdict code jitter_high.
probe.quality.groups map see below The probe-point matrix, group name → [{name, module, target, options}]. The reserved group domestic drives the primary verdict; international (and any other name) is reference-only — cross-border variance is its own signal, not an egress fault. Empty = the shipped defaults: a domestic group (two public resolvers for DNS differential diagnosis, mainstream HTTP sites, a 204 endpoint, a DNS-free direct-IP TCP leg) plus an international reference group. Every value is configurable; nothing is hardcoded. Burst metrics (loss_burst / jitter_high) from icmp targets feed the verdicts too.
probe.quality.episodes.enabled bool (follows quality) Degradation-episode detector switch (#720). Absent = follow probe.quality.enabled; explicit false is the off switch.
probe.quality.episodes.latency_ratio float 2.0 A track's window p50 counts as degraded at p50 >= max(base × ratio, base + min_delta).
probe.quality.episodes.latency_min_delta_ms int 50 Absolute latency floor so a 3ms baseline cannot "double" into noise.
probe.quality.episodes.ok_rate_drop float 0.3 Window ok-rate counts as degraded at ok_rate <= base − drop (0..1).
probe.quality.episodes.min_windows int 2 Consecutive degraded 15-minute windows before a track candidate counts (2 ≈ 30 sustained minutes).
probe.quality.episodes.alert_requires_attribution bool true The #716 ruling, enforced: degraded episodes without a same-window egress/path change stay recorded (UI yellow) but never notify. Explicit false allows notifying unattributed episodes.
probe.autogen.enabled bool false Discover-then-probe: auto-create device-bound probe targets (source=auto) from discovered services. Default OFF — it writes rows on its own, so it must be a deliberate choice (flip it any time in Settings → Probes — the change takes effect immediately with one reconcile sweep; the probes page LAN empty state also offers a one-click sweep). Turning it off parks the auto population (rows + history kept).
probe.autogen.services []string ["http","https"] Service identities eligible for auto targets (matched against host_services.service).
probe.autogen.device_types []string [] Restrict generation to those device types; empty = all.
probe.autogen.interval_seconds int 300 Probe interval of auto targets (≥10).
probe.autogen.max_targets int 100 Population cap (1–1000) so a 1000-device LAN cannot explode into 3000 targets.
probe.autogen.sweep_interval_minutes int 15 Reconcile cadence: create targets for new services, park targets whose service left the scan, revive on reappearance. Manual targets are never touched.
probe.autogen.mesh_enabled bool true (absent key = ON) Site-to-site N×N mesh (#747): auto-generate vantage-matrix targets (center → each agent, each agent → every other agent) from reported source addresses, so the RTT/loss/jitter matrix exists without manual wiring. Absent = ON (explicit false disables).
probe.egress.enabled bool false Egress identity recorder (#718): every interval the center asks a set of public echo sources (HTTP/STUN/DNS) which public IP the current egress presents, enriches the distinct IPs with their origin ASN, and stores the round in data/probe_ext.db. Recording only — changes never notify (#716). The same source set + cadence is also pushed to agents that declared the egress capability: every vantage runs its own rounds and reports them home (POST /agents/egress-report, token-bound identity, ASN enrichment on the center). A bare config defaults to disabled; configs/config.example.yaml ships enabled: true as the recommended value. Env MIBEE_PROBE_EGRESS_ENABLED.
probe.egress.interval_seconds int 300 Round cadence (60–86400). Env MIBEE_PROBE_EGRESS_INTERVAL_SECONDS.
probe.egress.asn_resolvers []string ["223.5.5.5"] DNS servers used for the Team Cymru origin-ASN TXT lookups, in preference order.
probe.egress.sources []source built-in set Echo sources; a non-empty list REPLACES the built-in multi-transport set. Entry: {name, kind: http|stun|dns, target} (http: URL returning the IP in the body; stun: host:port; dns: server|qname). The pushed agent plans use whatever this resolves to.
probe.trace.categories []string ["external","quality"] Probe-target categories that get periodic zero-privilege path traces (#719). lan stays off — internal paths are the topology page's job. The schedule also rides the agents' probe plans (agents declaring trace — a Linux-only capability): each vantage traces on its own and reports, and a failed probe additionally triggers one snapshot per target per 10 minutes (trigger=failure).
probe.trace.interval_minutes int 30 Baseline trace cadence per target (≥5).
probe.trace.max_ttl int 30 TTL walk bound (8–64). Silent-middle egress needs the full walk: no early give-up.
probe.trace.per_hop_ms int 500 Per-TTL wait (100–3000).
probe.trace.concurrency int 2 Simultaneous traces (≤8).

Quality seeding semantics (applied at startup, idempotent; re-run immediately when the Settings → Probes switch flips): enabled — missing matrix rows are created (source=system, vantage all), drifted rows are refreshed from config (module/target/options), parked system rows are revived (the matrix follows the master switch; row-level parking does not apply to system targets), and a source=system row whose config entry was removed is deleted with its result history; disabled — every system target is parked (disabled, kept for history). A row deleted in the UI is reseeded on the next restart; to remove a target permanently, remove it from groups (or disable probe.quality).

Example (matching configs/config.example.yaml):

probe:
  max_concurrency: 8
  quality:
    enabled: true
    window_minutes: 15
    interval_seconds: 120
    http_degraded_ms: 800
    dns_degraded_ms: 300
    ok_rate_threshold: 0.9
    loss_pct_threshold: 5
    jitter_degraded_ms: 30
    groups:
      domestic:
        - {name: quality-dns-ali,    module: dns,  target: www.baidu.com, options: {record: A, resolver: 223.5.5.5}}
        - {name: quality-dns-dnspod, module: dns,  target: www.baidu.com, options: {record: A, resolver: 119.29.29.29}}
        - {name: quality-http-baidu, module: http, target: https://www.baidu.com}
        - {name: quality-http-qq,    module: http, target: https://www.qq.com}
        - {name: quality-http-204,   module: http, target: http://connect.rom.miui.com/generate_204, options: {expected_status: [204]}}
        - {name: quality-tcp-ipdirect, module: tcp, target: 223.5.5.5:53}
      international:
        - {name: quality-dns-cf,         module: dns,  target: www.cloudflare.com, options: {record: A, resolver: 1.1.1.1}}
        - {name: quality-http-google204, module: http, target: http://www.google.com/generate_204, options: {expected_status: [204]}}
  autogen:
    enabled: false
    services: [http, https]
    interval_seconds: 300
    max_targets: 100
    sweep_interval_minutes: 15
    mesh_enabled: true

The verdict semantics the matrix feeds (why two resolvers, why a direct-IP TCP leg, why the international group is reference-only) are explained in Architecture → Synthetic Probing and surfaced by GET /api/v1/probe-quality.

Router-Resident Discovery Sources

The scanner can ingest device data from router-resident sources in addition to active probing. The whole service is gated by the master switch scanner.discovery.enabled (disabled by default). Note: trigger_identify and the router_arp/arp_cache/multicast sub-source toggles ship enabled: true in configs/config.example.yaml (the recommended values), they are off out of the box because of the master switch, not because each source individually defaults off. Each source is a no-op when the backing file or socket is absent on the host.

Key Type Default Description
scanner.discovery.enabled bool false Enable the passive discovery service
scanner.discovery.interval int (s) 60 Discovery scan interval (seconds)
scanner.discovery.trigger_identify bool false* Whether to trigger an identification scan when a new host is discovered. Zero-value is false, but the shipped/recommended default in configs/config.example.yaml is true.
scanner.discovery.router_arp.enabled bool false* Enable router SNMP ARP walk source (cross-subnet coverage)
scanner.discovery.arp_cache.enabled bool false* Enable local ARP cache source (reads /proc/net/arp)
scanner.discovery.multicast.enabled bool false* Enable mDNS/SSDP passive listener source
scanner.discovery.dhcp_leases.enabled bool false Read the local dnsmasq DHCP lease file (/tmp/dhcp.leases on OpenWrt, /var/lib/misc/dnsmasq.leases on Debian) to discover devices that recently obtained an IP. dnsmasq only, dhcpd.leases is not supported.
scanner.discovery.conntrack.enabled bool false Parse the kernel conntrack table (/proc/net/nf_conntrack only, no conntrack -L CLI) to discover active NAT connections and their internal hosts.
scanner.discovery.hostapd.enabled bool false Read the hostapd control interface to discover Wi-Fi clients associated with the router's access point.
scanner.discovery.hostapd.interfaces []string [] Network interface names to monitor for hostapd.
scanner.discovery.dns_log.enabled bool false Parse the dnsmasq query log (--log-queries output; dnsmasq only, not pihole) to discover hosts by their DNS activity.
scanner.discovery.dns_log.path string "" Path to the DNS query log file.
scanner.discovery.arp_scan.enabled bool false Enable active ARP who-has sweep (requires WITH_ARPSCAN build tag + CAP_NET_RAW).
scanner.discovery.lldp_interfaces []string [] Network interface names for LLDP/CDP passive frame listening (requires WITH_LLDP/WITH_CDP build tags).

* Sub-source toggles default to the Go zero value (false), but router_arp/arp_cache/multicast ship enabled: true in configs/config.example.yaml (recommended), they are off out of the box only because of the master scanner.discovery.enabled: false.

Environment Variables:

  • MIBEE_SCANNER_DISCOVERY_DHCP_LEASES_ENABLED
  • MIBEE_SCANNER_DISCOVERY_CONNTRACK_ENABLED
  • MIBEE_SCANNER_DISCOVERY_HOSTAPD_ENABLED
  • MIBEE_SCANNER_DISCOVERY_DNS_LOG_ENABLED

Example:

scanner:
  discovery:
    enabled: true
    interval: 60
    trigger_identify: true    # recommended: new hosts get identified immediately
    router_arp:
      enabled: true      # recommended in the example config
    arp_cache:
      enabled: true      # recommended in the example config
    multicast:
      enabled: true      # recommended in the example config
    dhcp_leases:
      enabled: true     # read dnsmasq leases (/tmp/dhcp.leases or /var/lib/misc/dnsmasq.leases)
    conntrack:
      enabled: false    # parse /proc/net/nf_conntrack
    hostapd:
      enabled: false    # read hostapd control socket
      interfaces: []
    dns_log:
      enabled: false    # parse dnsmasq query log
      path: ""
    arp_scan:
      enabled: false
    lldp_interfaces: []

Note: When the backing file or socket does not exist on the host, the source silently becomes a no-op, no error is logged and no discovery data is produced.

Network Configuration

Identifies this instance's network identity. In multi-instance deployments, each instance configures a different network.name so devices are tagged with the corresponding network_id to avoid IP collisions.

Key Type Default Description
network.name string "default" This instance's network name. Empty resolves to "default".
network.cidr string "" CIDR representation of this network (e.g. "192.168.1.0/24"). Used for conntrack source filtering and network attribution reconciliation.
network.site string "" Site/location description for this network (free text).

Center (Upstream Reporting) Configuration

The distributed-mode switch: with center.url set, this instance runs as an agent and reports scan results to the center; empty means center/standalone mode.

Key Type Default Description
center.url string "" The center's base URL (e.g. "http://192.168.1.102:8080"). Empty = center/standalone mode (no upstream reporting).
center.auth_token string "" The agent's bearer token (minted on the center via POST /api/v1/agents/tokens). Required in agent mode.
center.report_interval duration "30s" How often buffered scan results are flushed upstream when the buffer isn't full. Errors retry with exponential backoff.

Environment Variables:

  • MIBEE_CENTER_URL
  • MIBEE_CENTER_AUTH_TOKEN
  • MIBEE_CENTER_REPORT_INTERVAL

Security Configuration

Key Type Default Description
security.master_key string "" AES-GCM master key (must be exactly 32 bytes). Used for encrypted storage of SNMPv3 and SSH credentials. Empty = credential encryption disabled (falls back to v1/v2c community strings). In agent mode this key protects the agent's OWN local SNMP credential vault (#241), it is independent of the center's key by design.

Example:

security:
  master_key: "<exactly 32 bytes>"   # the key must be exactly 32 bytes (AES-256-GCM)

Generate a master key (take 32 raw bytes and encode them):

head -c 32 /dev/urandom | base64

Note: openssl rand -hex 32 produces 64 hex characters (64 bytes) and FAILS the exactly-32-byte requirement, do not use it for the master key.

Heartbeat Thresholds

The heartbeat subsystem uses several configurable thresholds to control when devices are marked offline and when probe frequency is reduced:

Threshold Key Default Effect
Offline flip heartbeat.offline_threshold 5 Consecutive probe failures before the device status transitions to offline.
Backoff heartbeat.offline_backoff_ticks 10 For devices already offline, probe once every N ticks instead of every tick. On the default 30s ticker, N=10 ≈ 5 minutes between probes.
Tick heartbeat.tick_interval_seconds 30 Interval between scheduler ticks (the heartbeat loop's heartbeat).

Recovery: A successful scan always clears the failure count immediately, backoff never delays recovery of a host that comes back online.

Sync Scan Limit

The synchronous scan endpoint (POST /api/v1/scanner/scan) imposes a hard target limit:

  • Max targets: 1024 IPs (individual, CIDR, or range, total count after expansion)
  • Exceeds limit: HTTP 413 with target range too large for synchronous scan (N IPs; max 1024). Use POST /api/v1/scanner/tasks to run asynchronously.
  • Workaround: Use the async task API, POST /api/v1/scanner/tasks to create a task, then POST /api/v1/scanner/tasks/{id}/trigger to fire it. The async path has no target count limit.

Rate Limit Configuration

Key Type Default Description
rate_limit.global_per_minute int 100 (code default; example config ships 600) Global maximum requests per minute per client IP. Applies to all endpoints.
rate_limit.login_per_minute int 10 Stricter per-minute limit for login/auth endpoints (/auth/login, /auth/register).
rate_limit.scan_per_minute int 10 Per-minute limit for scan trigger endpoints (/scanner/scan, /scanner/tasks/{id}/trigger).

Environment Variables:

  • MIBEE_RATE_LIMIT_GLOBAL_PER_MINUTE
  • MIBEE_RATE_LIMIT_LOGIN_PER_MINUTE
  • MIBEE_RATE_LIMIT_SCAN_PER_MINUTE

Retention Configuration

Key Type Default Description
retention.heartbeat_results_days int 7 Heartbeat results retention (days)
retention.device_liveness_days int 7 (mirrors the heartbeat window) Device liveness series retention (days). Defaults to the heartbeat_results_days value when unset.
retention.scan_results_days int 30 Scan results retention (days)
retention.scan_task_runs_days int 30 Scan task run records retention (days)
retention.audit_logs_days int 90 Audit logs retention (days)
retention.notification_log_days int 30 Notification logs retention (days)
retention.service_evidence_days int 14 Service evidence retention (days)
retention.change_log_days int 30 Change log retention (days)
retention.device_neighbors_days int 90 Device neighbor records retention (days)
retention.device_speaks_days int 30 Idle speaks-with traffic aggregates retention (days) (#500)
retention.host_services_days int 30 Host service records retention (days)
retention.host_tls_certs_days int 30 TLS certificate records retention (days)
retention.probe_results_days int 30 Synthetic-probe result history retention (days). probe_tls_certs is not swept, it holds only each target's current chain
retention.probe_ext_days int 30 Egress echo rounds + path samples + per-stage timing rows retention (days), the data/probe_ext.db side database (#716/#717/#718/#719).
retention.sweep_interval_hours int 6 Cleanup sweep interval (hours)
retention.batch_size int 5000 Max rows per cleanup batch

Archive Configuration (#663, #664)

The asset-archive engine REPLACES the old silent-device physical prune: a scanner-discovered device offline past the threshold is archived (history kept), not deleted. Thresholds are re-read from the settings overlay every engine tick, so runtime changes apply without a restart.

Key Type Default Description
archive.offline_days int 7 Days a device may stay offline before it moves to the archive. Per-device override: devices.archive_offline_days_override (NULL/0 = follow this). Devices without a MAC take a 24h fast lane.
archive.restore_online_minutes int 60 How long an archived device must stay CONTINUOUSLY online before it auto-restores into the asset library. Shorter appearances record online_blip events and stay archived.
archive.sweep_interval_seconds int 60 Archive engine tick (seconds). The restore timer needs finer granularity than the retention sweeper's 6h.
archive.smart.disabled bool false Opts OUT of the periodic-pattern learner (inverted flag so the Go zero value keeps the learner ON).
archive.smart.min_history_days int 60 Minimum appearance-event history span before the learner trusts a pattern (user rule: under 2 months of history, smart detection does not engage).
archive.smart.max_threshold_days int 30 Only effective thresholds BELOW this engage the learner (user rule: a month-scale threshold should not be second-guessed by smartness).

Pins override everything: force_active is never auto-archived, force_archive is never auto-restored. Manual devices (scan_source != 'scanner_v2') respond to manual archive only.

Flow Telemetry Configuration (#500)

The passive observer's speaks-with channel. Raw per-port flows never persist — the exporter folds each drained batch into device-level aggregates before storage (the #500 privacy red line). Conversations between two managed devices appear as speaks-with topology edges + the device Traffic Profile panel; the first observation of a managed pair emits a speaks_with_new change event (bind a notification rule for lateral-movement alerts).

Key Type Default Description
scanner.ebpf.flows.export_interval int 30 Seconds between flow-map drains
scanner.ebpf.flows.map_entries int 16384 LRU flow-map capacity, clamped to [1024, 131072] (~0.5 MiB kernel memory at the default)

Listen Watch Configuration (#500)

Diffs the local LISTEN table (/proc/net/tcp{,6}) and emits a listen_port_added change event for every newly opened listening socket on THIS host — the asset-anomaly channel that needs no eBPF and no privileges. The first snapshot establishes a baseline without alerting (a restart does not replay the table). Non-Linux hosts degrade to one warn line.

Key Type Default Description
listen_watch.enabled bool false Enable the diff source
listen_watch.interval int 15 Seconds between diffs
listen_watch.device_ip string "" Bind events to that device's change_log entity (rules scoped to the device then match); empty leaves them unbound

SNMP Trap Receiver Configuration

The inbound SNMP trap channel (#509) — devices speaking unprompted. linkDown/linkUp are topology-change signals, coldStart is an onboarding report, authenticationFailure is a security whisper; every accepted trap lands as a snmp_trap passive-evidence row on the source device (throttled to one row per source+trap per 10s — a flapping link does not flood the table), and coldStart/linkUp additionally feed the discovery funnel. Inform requests are ACKed by the listener; nothing else is ever sent.

Key Type Default Description
snmp_trap.enabled bool false Strictly opt-in: the receiver opens a listening socket
snmp_trap.bind string ":162" UDP bind address. Ports below 1024 need root or AmbientCapabilities=CAP_NET_BIND_SERVICE (systemd drop-in); ":1162" runs unprivileged — point your devices' trap destinations at it
snmp_trap.community string "public" The v2c community traps must carry; the receiver drops mismatches before any throttling or persistence (constant-time compare, counted in mibee_snmp_trap_community_drops)

Operational notes: open the UDP port in the firewall for the trap sources only (the listener sees any packet that reaches it); v3 traps (USM, credential-name references against the vault) are the designed follow-up — no v3 keys exist yet, so no one can enable a stub.

LAN Announce Configuration (#729)

The opposite direction of scanner.discovery: this instance announcing ITSELF on the LAN so the Scout app's one-shot scan recognizes it as a MiBee service (type steward) instead of requiring a hand-typed address. Three surfaces under one switch: the mDNS advertisement _mibee-steward._tcp, the public identity endpoint GET /.well-known/mibee-service ({"service":"steward","name","ver","id"} — unauthenticated, exactly four fields, same disclosure posture as /health), and a UDP responder answering the shared MIBEE-NVR-DISCv1? probe on the steward port with type=steward.

Default ON: the app shows nothing it cannot find, so announcing IS the visibility. A failed surface logs once and never blocks boot (the instance simply loses that one discovery path). The published data is deliberately minimal — a stable instance ID (data/instance-id, generated once and reused across restarts/upgrades/IP changes; an unwritable data dir degrades to an ephemeral ID with a warn), the instance name, the API port.

Key Type Default Description
announce.enabled bool true Master switch; false also unregisters the well-known HTTP endpoint (404)
announce.name string "" Announced instance name (mDNS + well-known); empty = OS hostname
announce.mdns bool true _mibee-steward._tcp advertisement (5353/udp; coexists with avahi/umdns)
announce.udp bool true UDP discovery responder (the app's fallback for multicast-restricted Wi-Fi)
announce.udp_port int 49091 Steward discovery port (adjacent to the NVR's 49090; registry confirmation tracked in #729)
announce.tls bool false Announced scheme hint — true only when a TLS-terminating reverse proxy fronts the same port clients discover

Named announce (not discovery) to stay unambiguous next to scanner.discovery: THAT block is this instance discovering others; this block is being discoverable.

Docker Configuration Template

The repository ships a ready-to-use Docker Compose config template at configs/config.docker.yaml. It pre-configures paths and network settings appropriate for containerized deployment, copy it as your starting config.yaml and adjust auth.jwt_secret and auth.initial_admin_password for production.

Complete Configuration Example

# Server configuration
server:
  port: 8080
  host: "0.0.0.0"
  trusted_proxies: []

# Database configuration
database:
  sqlite:
    path: "./data/mibee.db"

# Authentication
auth:
  jwt_secret: "your-strong-jwt-secret-key"
  token_expiry: "24h"
  initial_admin_password: "secure_admin_password"
  cookie_domain: ""
  cookie_secure: false
  cookie_same_site: "strict"

# RBAC
rbac:
  scope_default: "open"

# CORS
cors:
  allowed_origins:
    - "http://localhost:5173"
    - "http://localhost:8080"

# Heartbeat monitoring
heartbeat:
  default_interval: 30
  tick_interval_seconds: 30
  timeout: 5
  retention_days: 30
  offline_threshold: 5
  offline_backoff_ticks: 10

# Prometheus metrics
prometheus:
  enabled: true
  metrics_path: "/metrics"

# Dashboard
dashboard:
  data_source_type: "prometheus"
  prometheus_url: "http://localhost:9090"

# Storage
storage:
  upload_path: "./data/uploads"
  max_file_size: 104857600

# Logging
log:
  level: "info"
  format: "text"

# Scanner (v2)
scanner:
  enabled: true
  default_timeout: 300
  max_concurrent_hosts: 50
  retention_days: 30
  default_cron_expr: "0 */6 * * *"
  engine: "v2"
  persist_raw_evidence: false
  lost_threshold: 2
  snmp_community: "public"
  discovery:
    enabled: false
    interval: 60
    trigger_identify: true    # recommended: new hosts get identified immediately
    dhcp_leases:
      enabled: false
    conntrack:
      enabled: false
    hostapd:
      enabled: false
      interfaces: []
    dns_log:
      enabled: false
      path: ""
    arp_scan:
      enabled: false
    lldp_interfaces: []
  pipeline_defaults:
    icmp_enabled: true
    snmp_enabled: true
    port_scan_enabled: true
    default_ports: "22,80,443,8080,8443,8000,554,8554,9090,9100,9104,9113,9121,9187,161"
    service_detection_enabled: true
    prometheus_check_enabled: true
    node_exporter_enabled: true
  ebpf:
    enabled: false
    interfaces: []
  config_backup:
    enabled: false
    interval_seconds: 21600   # <=0 → 6h
    timeout_seconds: 30
  router_arp:
    routers: []
    community: "public"
    timeout: 4
  rdns:
    dns_servers: []
    timeout: 2
  mdns:
    unicast_queries: false

# Network
network:
  name: "default"
  cidr: ""
  site: ""

# Security
security:
  master_key: ""

# Retention
retention:
  heartbeat_results_days: 7
  scan_results_days: 30
  scan_task_runs_days: 30
  audit_logs_days: 90
  notification_log_days: 30
  service_evidence_days: 14
  change_log_days: 30
  device_neighbors_days: 90
  host_services_days: 30
  host_tls_certs_days: 30
  probe_results_days: 30
  sweep_interval_hours: 6
  batch_size: 5000

# Rate limiting
rate_limit:
  global_per_minute: 600
  login_per_minute: 10
  scan_per_minute: 10

Production Security Checklist

When deploying to production, ensure these security settings are properly configured:

🔑 Critical Security Settings

  1. JWT Secret: Generate a strong, random secret:

    openssl rand -base64 32
    

    Set auth.jwt_secret to this value

  2. Admin Password: Change the default admin password immediately

  3. HTTPS Configuration: Set auth.cookie_secure: true when using HTTPS

  4. CORS Origins: Limit cors.allowed_origins to trusted domains only

  5. Master Key: If using SNMPv3/SSH credential encryption, generate and configure security.master_key

🔒 Additional Security Considerations

  • File Uploads: Monitor storage.upload_path for unauthorized files
  • Metrics Endpoint: Restrict access to /metrics to monitoring systems only
  • Database Access: Ensure database files have proper file permissions
  • Log Security: Use JSON format in production for structured logging
  • Network Security: Use firewall rules to restrict access to non-HTTP ports
  • Trusted Proxies: When deploying behind a reverse proxy, configure server.trusted_proxies

📝 Environment Template

Create /etc/default/mibee-steward for production deployment:

# Server settings
MIBEE_SERVER_PORT=8080
MIBEE_SERVER_HOST=0.0.0.0
MIBEE_SERVER_TRUSTED_PROXIES=172.16.0.0/12,192.168.0.0/16   # comma-separated trusted proxy list

# Database
MIBEE_DATABASE_SQLITE_PATH=/opt/mibee-steward/data/mibee.db

# Security (MUST change these)
MIBEE_AUTH_JWT_SECRET=your-strong-secret-here
MIBEE_AUTH_INITIAL_ADMIN_PASSWORD=your-secure-password
MIBEE_AUTH_COOKIE_SECURE=true

# Logging
MIBEE_LOG_LEVEL=info
MIBEE_LOG_FORMAT=json

# CORS
MIBEE_CORS_ALLOWED_ORIGINS=https://yourdomain.com

🔒 Device Systems Configuration

Device systems management is enabled by default with these key settings:

  • Categories: web_app, database, middleware, custom
  • Auto-discovery: Systems with metrics_enabled=true appear in /sd endpoint
  • Labels: Automatic labels include device_name, system_name, category, device_type, location

Configuration Validation

The application validates configuration on startup (internal/config/config.go):

Agent mode (center.url set):

  • center.auth_token is required (mint one on the center via POST /api/v1/agents/tokens)
  • network.name is required (must match the network the token is bound to)

Center / standalone mode:

  • auth.jwt_secret is required and must be at least 32 characters long
  • auth.jwt_secret must not equal the placeholder "change-me-in-production"
  • an empty auth.initial_admin_password now means "first-run browser setup", not a startup exit (see cmd/server/main.go)

The following produce warnings only and do not block startup:

  • auth.cookie_secure=false (cookies will be sent over HTTP)
  • cors.allowed_origins contains localhost/127.0.0.1 origins
  • security.master_key is set but is not exactly 32 bytes long

Invalid configuration will prevent the application from starting with detailed error messages.