Skip to main content

Exposure Scanner for Cloud Infrastructure Security Analysis

Project description

Reticulum

Exposure Scanner for Cloud Infrastructure Security Analysis

Reticulum is a powerful tool that analyzes monorepos containing Helm charts to identify internet exposure and map affected source code paths. It provides comprehensive security assessment for DevSecOps and Cloud Security teams.

Features

  • Multi-environment analysis (dev, staging, prod)
  • Internet exposure detection via Ingress, LoadBalancer, NodePort
  • Source code path mapping from Dockerfiles
  • Master paths consolidation with highest exposure level
  • JSON output with network topology and Mermaid diagrams
  • Modular architecture with specialized analyzers for each concern

Requirements

  • Python >= 3.9
  • PyYAML: YAML parsing for Helm charts and configurations

Optional External Tools

  • Helm CLI: For chart validation and templating
  • Docker: For Dockerfile validation
  • kubectl: For Kubernetes resource validation

Installation

From PyPI (Recommended)

# Install the latest version
pip install reticulum

# Or with uv (faster)
uv add reticulum

From Source

This project uses Poetry for dependency management. To get started:

# Clone the repository
git clone https://github.com/plexicus/reticulum.git
cd reticulum

# Install dependencies
poetry install

# Activate the virtual environment
poetry shell

Usage

Reticulum can be used in multiple ways after installation:

Command Line Interface

Via Poetry (recommended for development)

# Default mode - Container exposure analysis
poetry run reticulum /path/to/your/repo

# Paths mode - Source code path analysis
poetry run reticulum /path/to/your/repo --paths

# Pretty JSON output (formatted like jq)
poetry run reticulum /path/to/your/repo --json

# Beautiful console output
poetry run reticulum /path/to/your/repo --console

Via Python Module

# Default mode - Container exposure analysis
python -m reticulum /path/to/your/repo

# Paths mode - Source code path analysis  
python -m reticulum /path/to/your/repo --paths

# Pretty JSON output (formatted like jq)
python -m reticulum /path/to/your/repo --json

After Installation

# Install the package
pip install .

# Use directly
reticulum /path/to/repo
reticulum /path/to/repo --paths
reticulum /path/to/repo --json

Python API

from reticulum import ExposureScanner

# Create scanner instance
scanner = ExposureScanner()

# Scan a repository
results = scanner.scan_repo("/path/to/your/repo")

# Access results
print(f"Found {results['scan_summary']['total_containers']} containers")
print(f"High exposure: {results['scan_summary']['high_exposure']}")

Output Formats

Output Formatting Options

Reticulum provides flexible output formatting:

  • Default: Compact single-line JSON
  • --json: Pretty formatted JSON with 2-space indentation (like jq)
  • --console: Beautiful formatted console output (human-readable)

Default Mode (Container Analysis)

Returns JSON with:

  • Container exposure analysis: Detailed breakdown of each container's exposure level
  • Network topology mapping: How containers connect and expose each other
  • Mermaid diagram: Visualization-ready diagram code
  • Scan summary: High-level statistics
{
  "repo_path": "/path/to/repo",
  "scan_summary": {
    "total_containers": 5,
    "high_exposure": 2,
    "medium_exposure": 1,
    "low_exposure": 2,
    "charts_analyzed": 3
  },
  "containers": [...],
  "network_topology": {...},
  "mermaid_diagram": "graph TD\n..."
}

Paths Mode (Source Code Analysis)

Returns JSON with:

  • Master paths: Consolidated source code paths with highest exposure levels
  • Path-to-container mapping: Which containers affect which source code
  • Exposure consolidation: Summary of risk levels by codebase area
{
  "repo_path": "/path/to/repo", 
  "scan_summary": {...},
  "master_paths": {
    "src/": {
      "path": "src/",
      "exposure_level": "HIGH",
      "exposure_score": 3,
      "container_names": ["api-container", "web-container"],
      "primary_container": "api-container"
    }
  }
}

Exposure Levels

  • ๐Ÿ”ด HIGH: Direct internet exposure (Ingress, LoadBalancer, NodePort)
  • ๐ŸŸก MEDIUM: Connected to HIGH exposure containers (internal services)
  • ๐ŸŸข LOW: Internal only, no internet access or HIGH container connections

Architecture

Reticulum is built with a modular architecture that separates concerns for better maintainability, testing, and extensibility:

Core Modules

  • ExposureAnalyzer - Analyzes Helm charts for exposure patterns
  • DockerfileAnalyzer - Parses Dockerfiles and extracts source code paths
  • DependencyAnalyzer - Analyzes service dependencies and exposure levels
  • PathConsolidator - Consolidates source code paths and builds master paths
  • MermaidBuilder - Generates network topology diagrams
  • CLI - Command-line interface and argument parsing

Benefits

  • ๐ŸŽฏ Single Responsibility - Each module has one clear purpose
  • ๐Ÿงช Easier Testing - Test individual components in isolation
  • ๐Ÿ‘ฅ Better Collaboration - Multiple developers can work on different modules
  • ๐Ÿ”ง Easier Maintenance - Fix bugs in specific functionality without touching others
  • ๐Ÿ“š Better Documentation - Each module can be documented separately
  • ๐Ÿš€ Easier Extension - Add new features by creating new modules

Development

Prerequisites

  • Python 3.9+
  • Poetry

Setup Development Environment

# Install development dependencies
poetry install --with dev

# Run tests
poetry run pytest

# Format code
poetry run black src/

# Lint code
poetry run ruff check src/

Quality Assurance & Release Management

Reticulum includes a comprehensive quality assurance system with strict gates that require all tests to pass before allowing releases.

Quick Quality Checks

# Daily development checks (non-interactive)
make quick-check

# All quality checks (lint + format + test)
make check

Pre-Release Verification

# Full pre-release verification (interactive)
make pre-release

# Strict release check (all tests + version sync)
make release-strict

Version Synchronization

# Check version consistency across all files
make version-sync

โš ๏ธ IMPORTANT: Tests MUST pass before creating tags or releases!

The system includes multiple quality gates:

  • โœ… Linting with ruff (auto-fix enabled)
  • โœ… Formatting with black (auto-format enabled)
  • โœ… Tests with pytest (11 test suite)
  • โœ… Version sync between pyproject.toml, init.py, and git tags
  • โŒ Blocks release if any gate fails

Project Structure

src/reticulum/
โ”œโ”€โ”€ __init__.py          # Package exports
โ”œโ”€โ”€ main.py              # Main ExposureScanner orchestrator
โ”œโ”€โ”€ exposure_analyzer.py # Helm chart exposure detection
โ”œโ”€โ”€ dockerfile_analyzer.py # Dockerfile parsing & path extraction
โ”œโ”€โ”€ dependency_analyzer.py # Service dependency analysis
โ”œโ”€โ”€ path_consolidator.py # Source code path consolidation
โ”œโ”€โ”€ mermaid_builder.py   # Mermaid diagram generation
โ”œโ”€โ”€ cli.py               # Command-line interface
โ””โ”€โ”€ __main__.py          # Module execution entry point

scripts/
โ”œโ”€โ”€ quick-check.sh       # Quick quality checks (non-interactive)
โ”œโ”€โ”€ pre-release-check.sh # Full pre-release verification
โ”œโ”€โ”€ version-sync.sh      # Version consistency verification
โ””โ”€โ”€ README.md            # Scripts documentation

.github/workflows/
โ”œโ”€โ”€ publish.yml          # CI/CD: test, lint, build, publish to PyPI
โ””โ”€โ”€ release.yml          # GitHub release automation

Dev Container

This project includes VS Code Dev Container configuration for consistent development environments.

Release Workflow

๐Ÿšจ CRITICAL: Always run quality checks before releases!

# 1. Ensure all tests pass
make release-strict

# 2. If successful, create tag
git tag v0.x.x
git push origin v0.x.x

# 3. GitHub Actions will automatically:
#    - Run all tests
#    - Build package
#    - Publish to PyPI

Never create tags without passing all quality gates!

Quality Assurance System

Reticulum implements a zero-tolerance quality system that prevents releases with failing tests or quality issues.

Quality Gates

Gate Tool Action Failure Result
Linting ruff Auto-fix + verify โŒ Release blocked
Formatting black Auto-format + verify โŒ Release blocked
Testing pytest Run 11 test suite โŒ Release blocked
Version Sync Custom script Verify consistency โŒ Release blocked

Available Commands

# Development
make install          # Install dependencies
make test            # Run tests only
make lint            # Run linting only
make format          # Format code only
make check           # All quality checks
make dev             # Setup development environment

# Quality Assurance
make quick-check     # Quick daily checks
make pre-release     # Full pre-release verification
make version-sync    # Version consistency check
make release-strict  # Strict release workflow

# Utilities
make clean           # Clean temporary files
make help            # Show all available commands

Why This Matters

  • ๐Ÿšซ Prevents broken releases - No tags without passing tests
  • ๐Ÿ”’ Maintains code quality - Automated linting and formatting
  • ๐Ÿ“Š Ensures consistency - Version sync across all files
  • ๐Ÿงช Guarantees reliability - All tests must pass
  • ๐Ÿš€ Streamlines workflow - One command for complete verification

For detailed script documentation, see scripts/README.md.

License

MIT License - Copyright (c) 2025 Plexicus, LLC

Author

Jose Palanco jose.palanco@plexicus.ai

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

reticulum-0.3.2.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

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

reticulum-0.3.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file reticulum-0.3.2.tar.gz.

File metadata

  • Download URL: reticulum-0.3.2.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for reticulum-0.3.2.tar.gz
Algorithm Hash digest
SHA256 71f52fe4c7374ac6f3664c3f632af60c1b9597f83093da72463d6805d7620e58
MD5 fc66c6b16aa3b507579eab7dba378d3f
BLAKE2b-256 0e7c998b38cdc7b7bb0156de012ac4f555877ce2b0da4b7247f8dcb9eb715a64

See more details on using hashes here.

File details

Details for the file reticulum-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: reticulum-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for reticulum-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cc432922fbe47441d5956983ab01581828bd2cf991a2ffdd1e0b7b68b8f79a5d
MD5 a31a6ef3c45830682557959c8ac96221
BLAKE2b-256 6df8b9319f046541d4c3011d6312ee7f7ca86e590ec00c9dc63323c7c477fff6

See more details on using hashes here.

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