Skip to main content

Agent Configuration

The agent configuration is stored in /etc/bloqd/agent.yaml.

Configuration File​

# Bloqd Agent Configuration
# Location: /etc/bloqd/agent.yaml

# Server connection
server:
# Bloqd server URL
url: "https://bloqd.example.com"

# API key for authentication (from Bloqd web UI)
api_key: "f2b_your_api_key_here"

# Enable WebSocket for real-time communication
websocket: true

# Verify SSL certificates (disable for self-signed certs)
verify_ssl: true

# Agent settings
agent:
# Hostname (use "auto" to detect automatically)
hostname: "auto"

# Log level: DEBUG, INFO, WARNING, ERROR
log_level: "INFO"

# Log file location
log_file: "/var/log/bloqd/agent.log"

# PID file location
pid_file: "/var/run/bloqd-agent/agent.pid"

# Module configuration
modules:
# Whitelist synchronization
sync:
enabled: true
interval: 300 # 5 minutes
whitelist_path: "/etc/fail2ban/bloqd-whitelist.txt"
reload_on_change: true

# Ban reporting
reporter:
enabled: true
log_excerpt_max: 2000
socket_path: "/var/run/bloqd-agent/report.sock"

# System metrics collection
metrics:
enabled: true
interval: 300 # 5 minutes
collect:
cpu: true
memory: true
disk: true
load: true
network: false

# Health checks
health:
enabled: true
interval: 60 # 1 minute
checks:
- fail2ban_running
- disk_space
- memory_usage
disk_warning_percent: 80
disk_critical_percent: 90
memory_warning_percent: 80
memory_critical_percent: 95

# Remote command execution
commands:
enabled: true
poll_interval: 30 # seconds
allowed_commands:
- jail_enable
- jail_disable
- fail2ban_reload
- ip_ban
- ip_unban
- ip_unban_all
- whitelist_sync
- list_bans
- list_jails
- agent_update
- agent_uninstall
- config_update
- custom_command
- filter_sync
- terminal_start
# SIEM commands
- siem_enable
- siem_disable
- siem_run_audit
- siem_set_baseline
- siem_status
# Port Knocking commands
- portknock_discover_ports
- portknock_enable
- portknock_disable
- portknock_allow
- portknock_deny
- portknock_status

# Interactive terminal sessions (Personal+)
terminal:
enabled: true
shell: /bin/bash
max_sessions: 5

# SIEM - Security auditing (Pro)
siem:
enabled: false
interval: 3600 # 1 hour between audits
min_audit_interval: 3600 # Minimum interval
lynis_path: "/usr/bin/lynis"
baseline_path: "/var/lib/bloqd/siem/baseline.json"
snapshot_path: "/var/lib/bloqd/siem/snapshots"
cooldown_seconds: 3600

# Port Knocking (Pro)
portknock:
enabled: true
interval: 60

Configuration Sections​

Server Section​

SettingDescriptionDefault
urlBloqd server URLRequired
api_keyAPI key for authenticationRequired
websocketEnable WebSocket connectiontrue
verify_sslVerify SSL certificatestrue

Agent Section​

SettingDescriptionDefault
hostnameServer hostname (auto to detect)auto
log_levelLogging levelINFO
log_fileLog file path/var/log/bloqd/agent.log
pid_filePID file path/var/run/bloqd-agent/agent.pid

Sync Module​

SettingDescriptionDefault
enabledEnable whitelist synctrue
intervalSync interval (seconds)300
whitelist_pathPath to whitelist file/etc/fail2ban/bloqd-whitelist.txt
reload_on_changeReload fail2ban on changestrue

Reporter Module​

SettingDescriptionDefault
enabledEnable ban reportingtrue
log_excerpt_maxMax log excerpt length2000
socket_pathUnix socket path/var/run/bloqd-agent/report.sock

Metrics Module​

SettingDescriptionDefault
enabledEnable metrics collectiontrue
intervalCollection interval (seconds)300
collect.cpuCollect CPU metricstrue
collect.memoryCollect memory metricstrue
collect.diskCollect disk metricstrue
collect.loadCollect load averagetrue
collect.networkCollect network metricsfalse

Health Module​

SettingDescriptionDefault
enabledEnable health checkstrue
intervalCheck interval (seconds)60
checksList of checks to runSee below
disk_warning_percentDisk warning threshold80
disk_critical_percentDisk critical threshold90
memory_warning_percentMemory warning threshold80
memory_critical_percentMemory critical threshold95

Commands Module​

SettingDescriptionDefault
enabledEnable remote commandstrue
poll_intervalCommand poll interval (seconds)30
allowed_commandsList of allowed commandsSee config

Terminal Module (Personal+)​

SettingDescriptionDefault
enabledEnable terminal sessionstrue
shellShell to use/bin/bash
max_sessionsMaximum concurrent sessions5

SIEM Module (Pro)​

SettingDescriptionDefault
enabledEnable SIEM auditingfalse
intervalAudit interval (seconds)3600
min_audit_intervalMinimum between audits3600
lynis_pathPath to Lynis binary/usr/bin/lynis
baseline_pathBaseline storage path/var/lib/bloqd/siem/baseline.json
cooldown_secondsAlert cooldown3600

Command Line Options​

# Run agent with custom config
bloqd-agent --config /path/to/config.yaml

# Override log level
bloqd-agent --log-level DEBUG

# Override log file
bloqd-agent --log-file /var/log/custom.log

# Check configuration validity
bloqd-agent --check

# Run single health check
bloqd-agent --health-check

# Show status
bloqd-agent --status

# Show version
bloqd-agent --version

# Uninstall
sudo bloqd-agent --uninstall

Environment Variables​

Configuration can also be provided via environment variables:

VariableConfig Equivalent
BLOQD_SERVER_URLserver.url
BLOQD_API_KEYserver.api_key
BLOQD_HOSTNAMEagent.hostname
BLOQD_LOG_LEVELagent.log_level

Environment variables take precedence over config file values.

Troubleshooting Configuration​

Validate Configuration​

bloqd-agent --check

Output shows:

  • Configuration validity
  • Server URL
  • Hostname
  • WebSocket status
  • Enabled modules
  • API key status

Common Issues​

SSL Certificate Errors:

server:
verify_ssl: false # Only for self-signed certs

Connection Timeouts:

  • Check firewall rules
  • Verify server URL is accessible
  • Check API key is valid

Module Not Loading:

  • Ensure module is enabled in config
  • Check for syntax errors in YAML
  • Review agent logs for errors