XCloak / docs

Agent

The agent is a single Go binary with no runtime dependencies, built for Linux and Windows. It runs 15 autonomous collectors in goroutines and responds to server-dispatched task commands.

Installation

Download a pre-built binary (v0.2+)

# Linux amd64
curl -Lo xcloak-agent-desktop \
  https://github.com/The-Abhishek1/XCLOAK-SECURITY-SUITE/releases/latest/download/xcloak-agent-linux-amd64
chmod +x xcloak-agent-desktop

# Linux arm64
curl -Lo xcloak-agent-desktop \
  https://github.com/The-Abhishek1/XCLOAK-SECURITY-SUITE/releases/latest/download/xcloak-agent-linux-arm64
chmod +x xcloak-agent-desktop

# Windows — download xcloak-agent-windows-amd64.exe

Build from source

cd xcloak-agent-desktop
go build -o xcloak-agent-desktop ./main.go

# Windows cross-compile
GOOS=windows GOARCH=amd64 go build -o xcloak-agent-desktop.exe ./main.go

First run

XCLOAK_SERVER=https://xcloak.yourdomain.com ./xcloak-agent-desktop

On first run the agent prompts for an install token (generate one at Agents → Add Agent → Install Token in the UI). After registration the agent token is saved to ~/.config/xcloak-agent-desktop/token and reused on every restart.

Agent environment variables

VariableDefaultDescription
XCLOAK_SERVERBackend URL (required on first run)
LOG_FORMATtextjson for structured logs
LOG_LEVELinfodebug / info / warn / error
XCLOAK_DISABLE_SELF_UPDATESet to 1 to skip update checks

What it collects

The agent runs 15 autonomous collectors in goroutines with jitter-staggered intervals.

CollectorLinux intervalWindows intervalNotes
Processes30 s30 sPID, PPID, name, cmdline, exe path, UID/GID
Connections30 s30 s/proc/net inode→PID (Linux); netstat+tasklist (Windows)
Services60 s60 ssystemd unit state (Linux); Windows services
Users10 min10 minGroups, sudo, SSH keys, last login, account status
Packages6 h6 hdpkg→rpm→pacman→snap→flatpak→pip3 (Linux); WMIC→registry→winget (Windows)
Auth logs2 min2 min/var/log/auth.log (Linux); Windows Security Event Log
auditd30 s/var/log/audit/audit.log execve events
File hashes1 h1 hSHA-256 + MD5 inventory
FIMreal-timereal-timeHash + mode + owner + mtime; watched paths configurable
Registry1 hRun/RunOnce persistence keys
Cron jobs1 h1 h/etc/crontab + /etc/cron.d/* + user crontabs (Linux); schtasks (Windows)
Kernel modules30 min30 minlsmod (Linux); driverquery (Windows)
SUID/SGID scan6 hWalks /usr /bin /sbin /opt /home for SUID/SGID bits
Disk usage5 min5 min/proc/mounts + syscall.Statfs (Linux); WMIC/Get-PSDrive (Windows)
eBPF TCP eventsreal-timeKernel 5.8+ required; degrades gracefully on older kernels

FIM — File Integrity Monitoring

The agent monitors a default set of security-critical paths and reports any create, modify, delete, or permission change events. Each event includes file path, change type, old and new SHA-256 + MD5 hash, file mode, UID, GID, and modification timestamp.

Default watched paths:

/etc/passwd        /etc/shadow         /etc/sudoers
/etc/ssh/          /etc/cron*          /etc/hosts
/etc/ld.so.preload /etc/pam.d/         /etc/systemd/system/
/bin/              /sbin/              /usr/bin/
/usr/sbin/         /root/              /tmp/

Add custom paths by setting FIM_EXTRA_PATHS (comma-separated) in the agent environment.

Auto-quarantine: When a FIM violation is detected on a critical system path, the backend automatically creates a quarantine_file task in pending approval. The file is not moved until an operator approves at Tasks → Pending Approval.

Server-dispatched tasks

TaskDescription
collect_processesSnapshot running processes
collect_connectionsActive network connections with PID enrichment
collect_packagesFull installed package inventory
collect_usersUser inventory with groups, sudo, SSH keys
collect_servicesRunning service states
collect_auth_logsRead /var/log/auth.log
collect_file_hashesSHA-256/MD5 file inventory
collect_cron_jobsCron job / scheduled task inventory
collect_kernel_modulesLoaded kernel modules / drivers
collect_suid_binariesSUID/SGID binary scan
collect_disk_usageDisk capacity per mount point
fim_scanFile integrity check — hash + mode + owner + mtime
vulnerability_scanCollect packages for server-side CVE matching
kill_processKill a process by PID
isolate_hostBlock all traffic except XCloak server (requires approval)
quarantine_fileMove file to quarantine directory (requires approval)
execute_scriptRun bash/sh/python3 script, stream output
apply_firewall_rulesApply iptables rules from XCloak
restore_fileRestore a quarantined file to its original path
Destructive tasks (kill_process, isolate_host, quarantine_file) require human approval before executing. Approval is required at Tasks → Pending Approval.

Self-update

The agent checks for a newer release on startup. Releases are ed25519-signed; the agent verifies the signature before executing any update binary. Set XCLOAK_DISABLE_SELF_UPDATE=1 to disable.

Task expiry

Tasks not actioned within 15 minutes are automatically cancelled. This prevents a backlog of stale destructive commands from executing hours later.