Skip to main content

wget yang punya otak keamanan โ€” download + verify + trust analysis

Project description

๐Ÿ” TrustGet

wget yang punya otak keamanan.

TrustGet = download + verify + trust analysis โ€” satu perintah, nol drama.

PyPI version Python versions Build Status License: MIT

Built for: SysAdmin ยท DevOps ยท Homelab ยท Linux Dev


โœจ Features

  • ๐Ÿš€ Smart Download โ€” Streaming download with progress bar, resume support, and retry logic
  • ๐Ÿ” Auto Verification โ€” Automatically finds and verifies SHA256/SHA512/MD5 checksums
  • ๐ŸŽฏ GitHub Smart Mode โ€” Zero-config security for GitHub Releases
  • ๐Ÿ“Š Trust Score โ€” Transparent 0-100 security scoring with explainable factors
  • ๐Ÿงช Sandbox Execution โ€” Run downloaded files in isolated environment
  • ๐Ÿ“ฆ Zero Config โ€” Works out of the box, no setup required

๐Ÿš€ Quick Start

Installation

From PyPI (Recommended)

pip install trustget

From apt (Debian/Ubuntu)

# Download the .deb package from releases
wget https://github.com/FaturRachmann/trustget/releases/latest/download/trustget_0.1.0_all.deb

# Install
sudo apt install ./trustget_0.1.0_all.deb

From Source

git clone https://github.com/FaturRachmann/trustget.git
cd trustget
pip install -e ".[dev]"

Basic Usage

# Download with automatic verification
sg https://github.com/cli/cli/releases/download/v2.40.0/gh_2.40.0_linux_amd64.tar.gz

# Or use the full command
trustget <url>

# Just verify a local file
sg verify ./file.tar.gz

# Check trust score without downloading
sg trust https://example.com/file.tar.gz

# Get release info
sg info https://github.com/user/repo/releases/download/v1.0/file.tar.gz

# Run in sandbox (experimental)
sg run ./AppImage

๐Ÿ“– Commands

Command Description
sg <url> Download + verify + trust analysis
sg verify <file> Verify file against checksum
sg trust <url> Analyze trust without download
sg run <file> Execute file in sandbox
sg info <url> Show file/release metadata
sg config Manage configuration

Global Flags

Flag Description
--json, -j Output in JSON format
--quiet, -q Suppress non-essential output
--verbose, -v Enable verbose output
--no-color Disable colored output
--no-verify Skip checksum verification
--timeout, -t HTTP request timeout (default: 30s)
--retry, -r Number of retry attempts (default: 3)
--force, -f Force download even if trust score is low

๐Ÿ“‹ Examples

Download from GitHub Releases

$ Trustget https://github.com/cli/cli/releases/download/v2.40.0/gh_2.40.0_linux_amd64.tar.gz

 Trustget v0.1.0

 Analyzing URL...
 โœ“ GitHub Release detected: cli/cli @ v2.40.0
 โœ“ Published: 2024-01-15 by maintainer @williammartin
 โœ“ Not a pre-release or draft

 Downloading gh_2.40.0_linux_amd64.tar.gz
 โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 100% โ€ข 11.2 MB โ€ข 4.2 MB/s โ€ข ETA 0s

 Verification
 โœ“ SHA256 matched (from gh_2.40.0_checksums.txt)
   Expected : 4b49d4ddce8a6d56b67d95f9d99f1e17e5b5c5c
   Got      : 4b49d4ddce8a6d56b67d95f9d99f1e17e5b5c5c

 Security Analysis
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚  Trust Score    92 / 100    โ—† LOW RISK  โ”‚
 โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
 โ”‚  โœ“ HTTPS connection              +20    โ”‚
 โ”‚  โœ“ Checksum verified             +25    โ”‚
 โ”‚  โœ“ Known platform (github.com)   +10    โ”‚
 โ”‚  โœ“ Maintainer verified           +20    โ”‚
 โ”‚  โœ“ Recent release (< 30 days)    +10    โ”‚
 โ”‚  โœ“ Repo age > 1 year             +07    โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

 โœ“ File saved โ†’ ./gh_2.40.0_linux_amd64.tar.gz

JSON Output for CI/CD

$ Trustget --json https://example.com/file.tar.gz | jq

{
  "download": {
    "success": true,
    "filepath": "/path/to/file.tar.gz",
    "size": 1234567
  },
  "verification": {
    "status": "VERIFIED",
    "algorithm": "sha256",
    "expected_hash": "abc123...",
    "actual_hash": "abc123..."
  },
  "trust": {
    "score": 85,
    "risk_level": "LOW",
    "factors": [...]
  }
}

Verify Local File

$ Trustget verify ./file.tar.gz --checksum abc123...

โœ“ SHA256 matched
  Expected : abc123...
  Got      : abc123...

Check Trust Score

$ Trustget trust https://example.com/file.tar.gz

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Trust Score    45 / 100    โ—† HIGH RISK โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  โœ“ HTTPS connection              +20    โ”‚
โ”‚  โš  Unknown domain               -20    โ”‚
โ”‚  โš  No checksum found            -15    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”’ Security Model

Trust Score Factors

Factor Weight Description
HTTPS connection +20 Secure HTTPS connection
Checksum available +10 Checksum file found
Checksum verified +25 Hash verification passed
GPG signature +25 GPG signature verified
Known domain +10 Trusted domain (github.com, kernel.org, etc.)
Maintainer verified +20 Release by repo owner
Repo age > 1 year +7 Established repository
Recent release +10 Published < 30 days ago
HTTP redirect -10 Redirect to different domain
Unknown domain -20 Untrusted domain
No checksum -15 No checksum available
Repo < 3 months -20 New repository
Pre-release -10 Draft or pre-release version

Risk Levels

Score Level Action
< 40 ๐Ÿ”ด CRITICAL Abort download
40โ€“59 ๐ŸŸ  HIGH Confirm with user
60โ€“79 ๐ŸŸก MEDIUM Proceed with warning
80โ€“100 ๐ŸŸข LOW Safe to proceed

โš™๏ธ Configuration

Configuration is stored in ~/.config/Trustget/config.toml:

timeout = 30
retries = 3
verify = true
json_output = false
quiet = false
min_trust_score = 0

Use Trustget config to manage:

# Set a value
Trustget config --set timeout 60

# Get a value
Trustget config --get timeout

# Reset to defaults
Trustget config --reset

๐Ÿงช Development

Running Tests

# Install dev dependencies
pip install -e ".[dev]"

# Run all tests
pytest

# Run with coverage
pytest --cov=Trustget

# Run specific test file
pytest tests/unit/test_utils.py

Code Quality

# Lint with ruff
ruff check Trustget/

# Type check with mypy
mypy Trustget/

# Format code
ruff format Trustget/

Build Package

python -m build
twine check dist/*

๐Ÿ“ Project Structure

Trustget/
โ”œโ”€โ”€ Trustget/
โ”‚   โ”œโ”€โ”€ __init__.py       # Version, public API
โ”‚   โ”œโ”€โ”€ cli.py            # Click commands
โ”‚   โ”œโ”€โ”€ downloader.py     # Streaming download
โ”‚   โ”œโ”€โ”€ verifier.py       # Hash/GPG verification
โ”‚   โ”œโ”€โ”€ scanner.py        # Checksum file detection
โ”‚   โ”œโ”€โ”€ github.py         # GitHub API integration
โ”‚   โ”œโ”€โ”€ trust.py          # Trust score engine
โ”‚   โ”œโ”€โ”€ reporter.py       # Output formatting
โ”‚   โ””โ”€โ”€ utils.py          # Shared utilities
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ unit/
โ”‚   โ”œโ”€โ”€ integration/
โ”‚   โ””โ”€โ”€ fixtures/
โ”œโ”€โ”€ docs/
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ LICENSE

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Commit Message Convention

We use Conventional Commits:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • test: Test additions or corrections
  • chore: Maintenance tasks
  • refactor: Code refactoring

๐Ÿ“„ License

MIT License โ€” see LICENSE for details.


๐Ÿ™ Acknowledgments

Inspired by the need for secure downloading in production environments.

Make secure the default, not the exception.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trustget-0.2.1.tar.gz (368.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trustget-0.2.1-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file trustget-0.2.1.tar.gz.

File metadata

  • Download URL: trustget-0.2.1.tar.gz
  • Upload date:
  • Size: 368.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trustget-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c0a245f7c4579e7eb0b3cab81b148c9cc35bb5c5b414dc921fac073479099761
MD5 11163fc283bb76d364e8498c0674d2ec
BLAKE2b-256 66e51f5c00f506bd2b515388b6cadd4ca0e00bc0771efe0cc2b186b78c49f592

See more details on using hashes here.

Provenance

The following attestation bundles were made for trustget-0.2.1.tar.gz:

Publisher: pypi-release.yml on FaturRachmann/trustget

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trustget-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: trustget-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 34.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trustget-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21fd57cd19b9e977b9a3ae0d001651662d4f9ff483ebdbbfe74c3b6a07cbde77
MD5 cf8c3248cf62a8e948dd0072713d04ed
BLAKE2b-256 d6ed16dd540a73998ef2ed8ac9ad776c93d25b755193f9153f221be5a46f3c72

See more details on using hashes here.

Provenance

The following attestation bundles were made for trustget-0.2.1-py3-none-any.whl:

Publisher: pypi-release.yml on FaturRachmann/trustget

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page