Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RasnuCloud Agent

Version License Go Version

The RasnuCloud Agent is a secure, lightweight, open-source daemon written in Go. It is installed on user servers to securely bridge the gap between your server and the RasnuCloud AI-driven management dashboard.

To guarantee 100% transparency and trust, this agent is fully open-source. We believe that you should never have to install "black-box" binaries on your root servers. You can audit every line of this code, compile it yourself, and verify exactly how it interacts with your system.


🔒 Security & Transparency Architecture

The RasnuCloud Agent is designed with a strict, defense-in-depth security model:

  1. Outbound-Only WebSockets: The agent never opens incoming ports. It connects securely outbound to the RasnuCloud Reverb WebSocket server.
  2. No Persistent Root Backdoors: The agent does not create SSH keys or persistent hidden user accounts. It strictly listens for cryptographically signed WebSocket events.
  3. Zero Configuration in Code: The agent uses an environment file (/etc/rasnucloud-agent/agent.env) locked down with chmod 600. No secrets are ever passed via command-line arguments that could be read by ps aux.
  4. Transparent Execution Pipeline: When a command is received, it is executed via Go's native os/exec package. The standard output (STDOUT) and standard error (STDERR) are streamed back in real-time. No hidden background processes are spawned.

🛡️ Enterprise-Grade Features

This agent has been engineered with several safeguards to protect your host OS:

  • Automated Secret Redaction: The execution pipeline actively scans for and scrubs credentials (like mysql -p, redis -a, or PASSWORD= environment variables) before logs are streamed or saved to disk.
  • Anti-DDoS Concurrency Limits: A strict semaphore limits the agent to 10 maximum concurrent commands, ensuring that a malicious or accidental API flood can never crash your server's CPU or RAM.
  • Read-Only Database Protections: When managing databases, the agent actively inspects queries and blocks destructive actions (DROP, DELETE, TRUNCATE) if the session is flagged as read-only.
  • Intelligent Stream Batching: Raw terminal outputs are heavily buffered and batched in 50ms intervals to prevent WebSocket saturation on high-output commands.
  • Self-Healing Connections: The agent employs exponential backoff, active Ping/Pong heartbeats, and graceful shutdown handling to survive temporary network outages.

⚙️ Core Capabilities

The agent is designed to manage every aspect of your server autonomously while providing real-time feedback to the control plane.

1. Interactive PTY Terminals

When you open the terminal in the RasnuCloud dashboard, the agent spawns a native Pseudo-Terminal (PTY). It supports real-time resizing (client-TerminalResize) and interactive input (client-TerminalInput), giving you a flawless SSH-like experience directly in your browser.

2. Native OS Management

The agent can securely execute root-level commands safely. It has native handlers for:

  • Systemd Services: Instantly start, stop, or restart services (nginx, docker, mysql, etc.) with built-in validation to prevent command injection.
  • UFW Firewall: Programmatically open/close ports, delete rules, or apply strict web-server templates.
  • Process Management: Safely kill runaway processes via verified PIDs.

3. Database Operations

The agent natively connects to MySQL and PostgreSQL to execute queries, trigger asynchronous SQL dumps (backups), and restore databases from files.

4. Real-Time Telemetry

A lightweight background engine parses /proc/net/dev, top, and systemctl to securely transmit CPU, RAM, Disk, Swap, and Network I/O metrics back to the dashboard every 15 seconds.


🛠️ Building from Source

If you prefer not to use our pre-compiled binaries, you can easily compile the agent yourself.

Prerequisites

  • Go 1.21 or higher

Compilation

# Clone the repository
git clone https://github.com/rasnu/rasnucloud-agent.git
cd rasnucloud-agent

# Download dependencies
go mod tidy

# Build for Linux AMD64 (Standard Servers)
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o rasnucloud-agent-amd64 .

# Build for Linux ARM64 (AWS Graviton, Raspberry Pi, Mac M1/M2/M3)
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o rasnucloud-agent-arm64 .

Running Tests

We maintain a rigorous test suite to ensure the stability of the execution pipeline, metric collection, and WebSocket logic. To run the automated tests locally:

# Run all tests with standard output
go test ./...

# Run tests with verbose output and coverage
go test -v -cover ./...

📄 License & Copyright

Project: RasnuCloud Copyright © 2026 Rasnu LLC (rasnu.com). All rights reserved.

This agent is open-sourced under the MIT License to ensure complete transparency for our infrastructure management community.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages