Integrations
Server AgentAll PlansLinux

LiteSOC Sentinel

A lightweight Go agent that watches your server logs in real-time, extracts security events, and streams them to your LiteSOC dashboard — installed in one command, using <20 MB RAM.

Overview

The LiteSOC Sentinel is an open-source, single-binary agent written in Go. It tails system log files, parses SSH authentication events using battle-tested regex patterns, and forwards them to the api.litesoc.io/collect endpoint in real-time. A 60-second heartbeat keeps your dashboard showing the server as Active.

< 20 MB RAM

Kernel-driven inotify — zero polling loops

SOC 2 Ready

Key stored in chmod 600 env file, never logged

60s Heartbeat

Dashboard shows real-time agent status

How It Works

1

Watch

Opens the configured log files (e.g. /var/log/auth.log) using inotify — no polling, no wasted CPU.

2

Parse

Each new line is matched against OpenSSH regex patterns to classify it as a login failure, success, or logout.

3

Forward

A structured JSON payload is POST-ed to api.litesoc.io/collect. The API key is sent in X-API-Key — never in the body.

4

Heartbeat

Every 60 seconds a lightweight ping is sent to api.litesoc.io/agent/heartbeat so the dashboard reflects the server's live status.

Requirements

RequirementDetails
OSLinux (amd64, arm64, armv7). macOS build available for local testing.
Init systemsystemd (required for the installer — otherwise run the binary directly)
PrivilegesMust install as root. The service runs as the dedicated litesoc user after install.
Toolscurl and tar must be present (standard on all distros)
Outbound networkHTTPS to api.litesoc.io:443
Log files/var/log/auth.log (Debian/Ubuntu) or /var/log/secure (RHEL/Fedora)

One-Line Install

Copy your Agent Key from the LiteSOC dashboard under Settings → API Keys, then run:

curl -sSL https://litesoc.io/install.sh | LITESOC_KEY=lsoc_live_your_key bash

The script will detect your architecture, download the correct binary, create the litesoc system user, write the systemd unit, and start the service automatically.

Pin to a specific version

curl -sSL https://litesoc.io/install.sh | \
  LITESOC_KEY=lsoc_live_your_key \
  LITESOC_AGENT_VERSION=v1.2.0 \
  bash

Build from source

git clone https://github.com/litesoc/litesoc-agent.git
cd litesoc-agent
make build          # builds bin/litesoc-agent for the host platform
make build-all      # cross-compiles for linux/amd64, arm64, darwin

Configuration

The installer writes a default config to /etc/litesoc/config.yaml. Edit it to add more log files or change the heartbeat interval, then restart the service.

# /etc/litesoc/config.yaml

# Base URL for the LiteSOC API (no trailing slash)
api_endpoint: https://api.litesoc.io

# How often (seconds) the agent sends a heartbeat ping
heartbeat_interval: 60

# Log files to monitor
log_watchers:
  # Debian / Ubuntu
  - path: /var/log/auth.log
    type: sshd

  # Fedora / RHEL / CentOS — uncomment if applicable:
  # - path: /var/log/secure
  #   type: sshd
KeyTypeDefaultDescription
api_endpointstringhttps://api.litesoc.ioLiteSOC ingestion API base URL
heartbeat_intervalint60Seconds between heartbeat pings
log_watchers[].pathstringAbsolute path to a log file
log_watchers[].typestringsshdParser type. Only "sshd" is currently supported

Security Events

The agent maps sshd log patterns to LiteSOC standard events. All forwarded events include actor_ip, actor_identifier (username), and a metadata object with the port and reason.

sshd Log PatternEvent NameReason (metadata)
Failed password for … from IP port Nauth.login_failedfailed_password
Invalid user X from IP port Nauth.login_failedinvalid_user
Accepted publickey/password for … from IP port Nauth.login_success
Disconnected from [user] … IP port Nauth.logout

Example payload

{
  "event": "auth.login_failed",
  "user_ip": "203.0.113.42",
  "actor": { "id": "root" },
  "metadata": {
    "source": "sshd",
    "log_file": "/var/log/auth.log",
    "reason": "failed_password",
    "port": "22"
  }
}

Heartbeat & Dashboard Status

Every 60 seconds the agent POSTs to POST /agent/heartbeat. If the dashboard shows Inactive, the server has not sent a heartbeat within 2 × the configured interval.

// POST https://api.litesoc.io/agent/heartbeat
// Headers: X-API-Key: lsoc_live_...

{
  "agent_version": "1.0.0"
}

The heartbeat is also fired immediately on startup so the dashboard reflects the new agent within seconds, without waiting for the first 60-second tick.

Managing the Service

View live logs

journalctl -u litesoc-agent -f

Check status

systemctl status litesoc-agent

Restart after config change

systemctl restart litesoc-agent

Stop / disable

systemctl stop litesoc-agent
systemctl disable litesoc-agent

Update the API key

# Edit the key — file is root-only (chmod 600)
nano /etc/litesoc/agent.env
systemctl restart litesoc-agent

Uninstall

systemctl stop litesoc-agent
systemctl disable litesoc-agent
rm /etc/systemd/system/litesoc-agent.service
rm /usr/local/bin/litesoc-agent
rm -rf /etc/litesoc
userdel litesoc
systemctl daemon-reload

Troubleshooting

Service fails to start
Run journalctl -u litesoc-agent -n 50 to see the last 50 log lines. The most common cause is a missing or invalid LITESOC_KEY in /etc/litesoc/agent.env.
journalctl -u litesoc-agent -n 50 --no-pager
Dashboard shows server as Inactive
The agent has not sent a heartbeat within 2× the heartbeat_interval. Check the service is running and that outbound HTTPS to api.litesoc.io:443 is not blocked.
systemctl is-active litesoc-agent
curl -I https://api.litesoc.io/health
No events appearing, service is running
Confirm the log_watchers path in config.yaml matches your distro. Ubuntu/Debian use /var/log/auth.log; RHEL/Fedora use /var/log/secure.
# Check which file exists on your system
ls -lh /var/log/auth.log /var/log/secure 2>/dev/null
401 Unauthorized from the API
The key in /etc/litesoc/agent.env does not match a valid active key for your project. Regenerate the key in the dashboard and update the file.
# Replace key and restart
echo 'LITESOC_KEY=lsoc_live_newkey' > /etc/litesoc/agent.env
chmod 600 /etc/litesoc/agent.env
systemctl restart litesoc-agent
High CPU or memory usage
The agent should idle at <1% CPU. If usage is high, it is usually caused by an extremely noisy log file generating thousands of lines per second. The systemd unit enforces MemoryMax=32M and CPUQuota=5% as hard limits.
systemctl show litesoc-agent | grep -E 'MemoryCurrent|CPUUsage'

Continue exploring