Initial commit: LOGAR edge-thin log analysis system with OpenPGP encryption, authenticated TCP sockets, 4-run persistence rule, Hermes reporting, and modular shippables

This commit is contained in:
2026-09-03 21:05:28 +02:00
commit c5d364b289
26 changed files with 2667 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
# LOGAR Linux Edge Forwarder
Lightweight edge log forwarder for Linux servers running systemd.
## Features
- **Zero Local State**: No local SQLite database or state tracking on the edge server.
- **Edge Noise Stripping**: Strips conversational/informational noise (`INFO`, `DEBUG`) directly at the source via `journalctl -p warning`.
- **End-to-End OpenPGP Encryption**: Encrypts logs using the server's public key; decrypted exclusively on the cloud hub.
- **Authenticated TCP Socket**: Direct, low-overhead TCP streaming with token authentication.
- **No GPG Binary Required**: Pure-Python implementation (`pgpy` + `cryptography`).
## Installation
```bash
python3 -m pip install -r requirements.txt
```
## Configuration
Place `client_config.json` generated by the server (`Server.py --create-client-config`) in the same directory as `Linux_Client.py`.
## Running the Forwarder
```bash
python3 Linux_Client.py --hours 6
```
## Cron / Systemd Timer Deployment
### Option A: Cron Job (Every 3 hours)
```bash
0 */3 * * * cd /opt/logar && /usr/bin/python3 Linux_Client.py --hours 6 >> /var/log/logar_client.log 2>&1
```
### Option B: Systemd Service & Timer
1. Create `/etc/systemd/system/logar-forwarder.service`:
```ini
[Unit]
Description=LOGAR Edge Forwarder
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/opt/logar
ExecStart=/usr/bin/python3 /opt/logar/Linux_Client.py --hours 6
```
2. Create `/etc/systemd/system/logar-forwarder.timer`:
```ini
[Unit]
Description=Run LOGAR Edge Forwarder every 3 hours
[Timer]
OnBootSec=5min
OnUnitActiveSec=3h
Persistent=true
[Install]
WantedBy=timers.target
```
3. Enable and start:
```bash
sudo systemctl daemon-reload
sudo systemctl enable --now logar-forwarder.timer
```