Skip to main content
The Policy Engine provides centralized configuration management for your Guard agent fleet. It supports global policies that apply to all agents, per-agent overrides for specific endpoints, and version-controlled distribution with a broadcast queue.

How Policies Work

Admin ──> POST /api/policy ──> PolicyEngine ──> Broadcast Queue
                                                      |
                                    Agent Poll (every 5 min)
                                                      |
                               ┌──────────┬──────────┬──────────┐
                             Agent 1    Agent 2    Agent 3
  1. An administrator creates or updates a policy via the REST API or CLI
  2. The PolicyEngine increments the version number and stores the policy
  3. The policy is added to the broadcast queue
  4. Agents poll for updates every 5 minutes and download new policies when their local version is outdated

Policy Structure

Policies are JSON documents with a version number and configuration sections:
{
  "version": 3,
  "scope": "global",
  "updatedAt": "2025-01-15T14:23:01Z",
  "thresholds": {
    "autoRespond": 90,
    "notifyAndWait": 70
  },
  "blocklist": {
    "ips": ["203.0.113.50", "198.51.100.0/24"]
  },
  "allowlist": {
    "ips": ["10.0.0.0/8"],
    "processes": ["nginx", "postgres"]
  },
  "monitors": {
    "enabled": ["log", "network", "process", "file"],
    "advanced": ["falco", "suricata"]
  },
  "alerting": {
    "minimumSeverity": "medium",
    "channels": ["slack"]
  },
  "response": {
    "actions": ["block_ip", "notify", "log_only"],
    "escalation": {
      "repeatThreshold": 3,
      "repeatBlockDuration": "24h"
    }
  }
}

Policy Configuration Sections

SectionFieldsDescription
thresholdsautoRespond, notifyAndWaitConfidence thresholds for automated response
blocklistips, domainsFleet-wide block lists pushed to all agents
allowlistips, processesWhitelisted IPs and processes exempt from response
monitorsenabled, advancedWhich monitors to activate on each agent
alertingchannels, severityMinimum severity for notifications, channel routing
responseactions, escalationAllowed response actions and escalation parameters
rulessigma, yaraCustom rule distribution

Rule Types

TypeDescriptionValue Format
block_ipAdd IP or CIDR to fleet-wide blocklistIP address or CIDR notation
alert_thresholdSet minimum confidence for alertingNumber (0-100)
auto_respondEnable/disable automatic responseBoolean + confidence threshold
customCustom key-value configurationString

block_ip

Adds an IP address or CIDR range to the blocklist on all target agents:
{
  "type": "block_ip",
  "value": "203.0.113.50",
  "duration": "24h",
  "reason": "Cross-agent correlation: scanning 5 agents"
}

auto_respond

Controls whether the RespondAgent can take automated actions. Useful during maintenance windows:
{
  "type": "auto_respond",
  "value": false,
  "reason": "Maintenance window: disable auto-response"
}

Policy Scopes

Global policies apply to all registered agents:
panguard manager policies set --global --file policy.json
Every agent receives global policies during policy polling.

Policy Resolution Order

When an agent polls for its policy, the Manager merges settings:
Defaults ──> Global Policy ──> Per-Agent Policy
Later values override earlier ones.

Version Control

Every policy change increments the version number. Agents compare their local version against the Manager’s current version during each poll cycle.
EventVersion Behavior
New policy createdVersion incremented
Policy updatedVersion incremented
Per-agent override addedAgent-specific version incremented
Agent polls with current versionManager returns 304 (no change)
Agent polls with outdated versionManager returns new policy

Broadcast Queue

When a policy change requires immediate action, the Manager pushes the update to all online agents immediately:
Delivery ModeTriggerLatency
PollNon-urgent policy changesUp to 5 minutes
Broadcastblock_ip rules, auto_respond disableImmediate (via next heartbeat, ~30 seconds)

Emergency Policies

When the ThreatAggregator detects a cross-agent threat pattern, it triggers an emergency policy push:
TriggerEmergency Action
Same IP attacking 3+ agentsFleet-wide IP block
Same malware hash on 2+ agentsFleet-wide file quarantine rule
Coordinated attack detectedElevated auto-respond threshold across fleet
Emergency policies bypass the normal poll interval and are distributed via the broadcast queue.

CLI Reference

panguard manager policies <command> [options]

Commands:
  list               Show current policy rules
  set                Add or update a policy rule
  remove             Remove a policy rule
  history            Show policy version history
  broadcast          Force immediate policy push
  get                Get policy for a specific agent

Options:
  --global           Apply to all agents (default)
  --agent <id>       Apply to specific agent
  --rule <json>      Rule definition as JSON
  --file <path>      Policy file (JSON)
Policy changes that disable auto_respond take effect immediately via broadcast. Use this during planned maintenance to prevent Guard from taking actions that could interfere with your work.