Plasma Shield Proxy

The core router service that inspects and filters all agent traffic. Run this on a dedicated VPS that agents cannot access directly.

Command-Line Flags

FlagDefaultDescription
-proxy-addr:8080Address for the proxy server
-api-addr127.0.0.1:9000Address for the management API and web UI (localhost only)
-rules(none)Path to rules YAML file

Environment Variables

None. All configuration is via command-line flags.

Usage

bash
plasma-shield-proxy

# Custom ports with rules file
plasma-shield-proxy -proxy-addr :8080 -api-addr 127.0.0.1:9000 -rules /etc/plasma-shield/rules.yaml

# Production example
plasma-shield-proxy 
  -proxy-addr :8080 
  -api-addr 127.0.0.1:9000 
  -rules /var/lib/plasma-shield/rules.yaml

API Endpoints

The proxy exposes a management API on the -api-addr interface.

Health & Status

EndpointMethodAuthDescription
/healthGETNoneReturns OK if running
/GETNoneWeb UI dashboard

Mode Management

EndpointMethodDescription
/modeGETGet global mode and all agent modes
/modePUT/POSTSet global mode (enforce, audit, lockdown)

GET /mode response:

json
{
  "global_mode": "enforce",
  "agent_modes": {}
}

PUT /mode request:

json
{"mode": "audit"}

Per-Agent Mode

EndpointMethodDescription
/agent/{id}/modeGETGet mode for specific agent
/agent/{id}/modePUTSet mode for specific agent
/agent/{id}/modeDELETEClear agent-specific mode (inherit global)

Traffic Logs

EndpointMethodQuery ParamsDescription
/logsGETlimit (default: 50)Get recent traffic logs

Logs are stored in-memory (max 1000 entries) and returned most-recent-first.

Rules

EndpointMethodDescription
/rulesGETGet rules file path and rule count

Exec Check (Agent Use)

EndpointMethodDescription
/exec/checkPOSTCheck if a command is allowed (for agents)

Fleet Management

EndpointMethodQuery ParamsDescription
/fleet/modeGETtenant (default: default)Get fleet mode for tenant
/fleet/modePUTtenantSet fleet mode (isolated, fleet)
/fleet/agentsGETtenantList agents (respects fleet mode)
/fleet/agentsPOSTtenantRegister an agent
/fleet/can-communicateGETfrom, toCheck if two agents can communicate

POST /fleet/agents request:

json
{"id": "agent-1", "name": "sarai"}

Operating Modes

ModeBehavior
enforceNormal operation – block matching requests (default)
auditLog everything but never block
lockdownBlock ALL outbound requests

Fleet Modes

ModeBehavior
isolatedAgents cannot see each other
fleetAgents can discover and communicate

Web Dashboard

Access via SSH tunnel:

bash
ssh -L 9000:localhost:9000 root@<shield-ip>
# Open http://localhost:9000 in your browser

Features:

  • Mode controls (enforce/audit/lockdown)
  • Fleet mode toggle
  • Traffic log viewer
  • Agent management

Graceful Shutdown

The proxy handles SIGINT and SIGTERM for graceful shutdown with a 10-second timeout.