A system information collection and upload framework for Linux
Project description
🐌 Snail Core
A system information collection and upload framework for Linux, inspired by Red Hat's insights-core.
Snail Core provides an extensible framework for gathering system diagnostics and uploading them to a custom endpoint. It's designed to be modular, secure, and easy to integrate into your infrastructure.
Features
- Comprehensive System Collection: Gathers OS info, hardware specs, network config, packages, services, filesystem, security settings, and logs
- Multi-Distribution Support: Compatible with Fedora, RHEL, CentOS, Debian, Ubuntu, SUSE, and other Linux distributions
- Multi-Version Support: Works across multiple versions of supported distributions
- Modular Architecture: Plugin-based collectors that can be enabled/disabled individually
- Secure Upload: HTTPS with API key auth, mutual TLS support, and automatic retries
- Privacy Controls: Configurable redaction and anonymization options
- Rich CLI: Beautiful terminal interface with progress indicators and colored output
- Flexible Configuration: YAML config files, environment variables, and CLI options
Supported Distributions
Snail Core supports the following Linux distributions and their versions:
- Fedora: All recent versions (uses DNF)
- RHEL: 7.x (YUM), 8.x+ (DNF)
- CentOS: 7 (YUM), Stream 8+ (DNF)
- Debian: Recent versions (uses APT)
- Ubuntu: Recent versions (uses APT)
- SUSE/openSUSE: Leap, Tumbleweed, SLES (uses Zypper)
- Other Linux: Auto-detects available package managers
Installation
From Source
# Clone the repository
git clone https://github.com/sluggisty/snail-core.git
cd snail-core
# Create a virtual environment (recommended)
python -m venv venv
source venv/bin/activate
# Install the package
pip install -e .
System Dependencies
Some collectors require system tools to be installed:
# On Fedora/RHEL/CentOS
sudo dnf install lsof lshw pciutils usbutils
# On Debian/Ubuntu
sudo apt-get install lsof lshw pciutils usbutils
# On SUSE/openSUSE
sudo zypper install lsof lshw pciutils usbutils
Quick Start
1. Generate a Configuration File
snail init-config ~/.config/snail-core/config.yaml
2. Edit the Configuration
Update the config file with your upload server URL:
upload:
url: https://your-server.example.com/api/v1/ingest
enabled: true
3. Set Your API Key
export SNAIL_API_KEY="your-api-key-here"
4. Collect and Upload
# Collect only (no upload)
snail collect
# Collect and upload
snail collect --upload
# Or use the shorthand
snail run
CLI Usage
# Show help
snail --help
# List available collectors
snail list
# Run specific collectors only
snail collect -C system -C network -C packages
# Output as JSON
snail collect --format json
# Save to file
snail collect -o /tmp/report.json
# Check configuration and connection
snail status
# Display version information
snail list-version
# View or reset persistent host ID
snail host-id
snail host-id --reset
# Verbose mode
snail -v collect
Collectors
| Collector | Description | Multi-Distro Support |
|---|---|---|
system |
OS version, kernel, hostname, uptime, virtualization | ✅ All distributions |
hardware |
CPU, memory, disks, PCI/USB devices, DMI info | ✅ All distributions |
network |
Interfaces, connections, routing, DNS, firewall | ✅ All distributions |
packages |
Installed packages, repositories, package manager config | ✅ DNF/YUM/APT/Zypper |
services |
Systemd units, running services, failed units, timers | ✅ Systemd-based distros |
filesystem |
Mounts, fstab, LVM, Btrfs, inode usage | ✅ All distributions |
security |
SELinux/AppArmor, firewall, crypto policies, SSH, audit | ✅ Multi-distro aware |
logs |
Recent journald entries, errors, auth failures | ✅ Systemd-based distros |
Configuration
Snail Core looks for configuration in these locations (in order):
- Path specified with
--configflag /etc/snail-core/config.yaml~/.config/snail-core/config.yaml./snail-config.yaml
Environment Variables
| Variable | Description |
|---|---|
SNAIL_UPLOAD_URL |
Upload endpoint URL |
SNAIL_UPLOAD_ENABLED |
Enable/disable upload (true/false) |
SNAIL_API_KEY |
API key for authentication |
SNAIL_AUTH_CERT |
Path to client certificate |
SNAIL_AUTH_KEY |
Path to client key |
SNAIL_LOG_LEVEL |
Logging level (DEBUG/INFO/WARNING/ERROR) |
Example Configuration
upload:
url: https://insights.example.com/api/v1/upload
enabled: true
timeout: 30
retries: 3
auth:
api_key: null # Use SNAIL_API_KEY env var
collection:
enabled_collectors: [] # Empty = all
disabled_collectors: []
timeout: 300
output:
dir: /var/lib/snail-core
keep_local: false
compress: true
privacy:
anonymize_hostnames: false
redact_passwords: true
Multi-Distribution Support
Snail Core automatically detects your Linux distribution and uses the appropriate tools:
- RPM-based (Fedora/RHEL/CentOS): Uses DNF (preferred) or YUM (fallback)
- Debian-based (Debian/Ubuntu): Uses APT
- SUSE-based (SUSE/openSUSE): Uses Zypper
- Security: Detects SELinux (RHEL/Fedora) or AppArmor (Ubuntu/Debian/SUSE)
- Firewall: Detects firewalld, ufw, or iptables
- Services: Uses systemd (most modern distributions)
Server Integration
Snail Core uploads JSON data via HTTP POST. Your server should accept:
POST /api/v1/ingest
Content-Type: application/json
Content-Encoding: gzip (if compression enabled)
Authorization: Bearer <api-key>
{
"meta": {
"hostname": "fedora-workstation",
"host_id": "057a8430-c818-4a43-8683-0ab05be16ef6",
"collection_id": "uuid",
"timestamp": "2024-01-15T10:30:00Z",
"snail_version": "0.2.0"
},
"data": {
"system": { ... },
"hardware": { ... },
"network": { ... },
...
},
"errors": []
}
Development
Setup Development Environment
# Install with development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
# Run pre-commit hooks
pre-commit run --all-files
License
MIT License - See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snail_core-0.5.0.tar.gz.
File metadata
- Download URL: snail_core-0.5.0.tar.gz
- Upload date:
- Size: 37.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4419ac8cc9eb7d878cca81e15599e1678ea83f5e9e6bfad1bb1d207870de160
|
|
| MD5 |
0c244b976e6901c74715bbbc158eee17
|
|
| BLAKE2b-256 |
0432acd5e7e50dd292c66dc7eb42d2b2f190bad5819b50e1005ec89803f9d80d
|
Provenance
The following attestation bundles were made for snail_core-0.5.0.tar.gz:
Publisher:
publish-to-pypi.yml on sluggisty/snail-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snail_core-0.5.0.tar.gz -
Subject digest:
e4419ac8cc9eb7d878cca81e15599e1678ea83f5e9e6bfad1bb1d207870de160 - Sigstore transparency entry: 779609910
- Sigstore integration time:
-
Permalink:
sluggisty/snail-core@dac5590019714e86b02c150337ba59c101fe29ae -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/sluggisty
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@dac5590019714e86b02c150337ba59c101fe29ae -
Trigger Event:
push
-
Statement type:
File details
Details for the file snail_core-0.5.0-py3-none-any.whl.
File metadata
- Download URL: snail_core-0.5.0-py3-none-any.whl
- Upload date:
- Size: 42.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a9b7cd42738059205d81b7e79c1b8df991db14b7037702b828f93250659325d
|
|
| MD5 |
fea17123c35ac9d8cde28004c843250c
|
|
| BLAKE2b-256 |
637e79a54dc881aaaebfefca2ba669a783c28fee214890721de896b50c21776b
|
Provenance
The following attestation bundles were made for snail_core-0.5.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on sluggisty/snail-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snail_core-0.5.0-py3-none-any.whl -
Subject digest:
4a9b7cd42738059205d81b7e79c1b8df991db14b7037702b828f93250659325d - Sigstore transparency entry: 779609911
- Sigstore integration time:
-
Permalink:
sluggisty/snail-core@dac5590019714e86b02c150337ba59c101fe29ae -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/sluggisty
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@dac5590019714e86b02c150337ba59c101fe29ae -
Trigger Event:
push
-
Statement type: