Skip to content

ijerrywong/safe-share

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Safe Share

๐Ÿ›ก๏ธ Pre-Publish Security Gate

A security-first content sanitization system that scans, classifies, and redacts sensitive information before public sharing.

English | ็ฎ€ไฝ“ไธญๆ–‡

License: MIT Python 3.8+ Code style: black

โœจ Features

  • ๐Ÿ” Smart Detection - Rule-based engine with 40+ patterns for sensitive information
  • ๐ŸŽฏ Risk Classification - Three-tier system (P0/P1/P2) for graded response
  • ๐ŸŽจ Pixelation Masking - Mosaic-style masking for effective redaction
  • ๐Ÿ“Š Detailed Reports - Markdown and JSON outputs for audit trails
  • ๐Ÿš€ Fast Processing - ~1000 lines/second for text scanning
  • ๐Ÿ›ก๏ธ Privacy First - All processing done locally, no external requests

๐ŸŽฏ Use Cases

Perfect for:

  • ๐Ÿ“ธ Screenshots - Code, terminal, chat logs before sharing
  • ๐Ÿ“„ Documents - Logs, configs, documentation before publishing
  • ๐Ÿ’ฌ Messages - Forum posts, emails, chat messages
  • ๐Ÿ” Security Reviews - Pre-publication security audits

๐Ÿš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/ijerrywong/safe-share.git
cd safe-share

# Install dependencies
pip install -r requirements.txt

# Install tesseract OCR (required for image scanning)
# macOS
brew install tesseract

# Ubuntu/Debian
sudo apt-get install tesseract-ocr

# Windows
# Download from https://github.com/UB-Mannheim/tesseract/wiki

Usage

Option 1: Command Line Tool

```bash
# Scan a text file
python3 main.py --file config.txt

# Scan an image
python3 main.py --file screenshot.png

# Verbose mode
python3 main.py --file screenshot.png --verbose

# Different security modes
python3 main.py --file screenshot.png --mode strict     # Maximum protection
python3 main.py --file screenshot.png --mode balanced   # Balance
python3 main.py --file screenshot.png --mode relaxed    # Minimal

Option 2: As OpenClaw Skill

To use as an OpenClaw skill, copy the skill file to your skills directory:

# Find your OpenClaw skills directory (usually ~/.openclaw/skills/)
# Create the directory if it doesn't exist
mkdir -p ~/.openclaw/skills/

# Copy the skill file
cp SKILL.md ~/.openclaw/skills/safe-share.md

# Or for Chinese version
cp SKILL_CN.md ~/.openclaw/skills/safe-share-cn.md

Then you can use it directly in OpenClaw:

Scan this file for sensitive information before sharing

Or:

Use safe-share to check this screenshot

Output Files

After scanning, Safe Share generates:

outputs/
โ”œโ”€โ”€ redacted_<filename>      # Masked content (image or text)
โ”œโ”€โ”€ risk_report.md            # Human-readable audit report
โ””โ”€โ”€ findings.json             # Machine-readable detection data

๐Ÿ“‹ What Gets Detected

๐Ÿšจ P0 - Critical (Always Masked)

  • API keys & tokens
  • Database passwords
  • Personal data (phone, email, SSN)
  • Private keys & certificates

โš ๏ธ P1 - High Risk (Masked by Default)

  • File paths (.env, .ssh, secrets/)
  • Local services (127.0.0.1:5000)
  • Database usernames
  • Infrastructure URLs

โ„น๏ธ P2 - Medium Risk (Warning Only)

  • Project names
  • Device information
  • Business context

See RULES.md for complete pattern list.

๐ŸŽจ Masking Styles

Style Description Use Case
pixelate Mosaic/blur blocks Default, recommended
black Solid black bars High contrast needed
red Solid red bars Warning emphasis
blur Gaussian blur Softer redaction

๐Ÿ“– Documentation

๐Ÿ”ง Development

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest tests/

# Run linting
black utils/ main.py

๐Ÿค Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details.

๐Ÿ“Š Performance

Input Type Speed Memory
Text (1000 lines) ~1s <50MB
Image (1920x1080) ~6s <100MB

โš ๏ธ Disclaimer

Safe Share uses automated pattern matching. While it catches many common patterns, it may have:

  • False positives (safe content flagged as sensitive)
  • False negatives (sensitive content not detected)

Always review the output manually before sharing content.

๐Ÿ“œ License

MIT License - see LICENSE for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ฎ ่”็ณปๆ–นๅผ


โญ Star us on GitHub!

Made with โค๏ธ by JerryWong

About

Pre-Publish Security Gate - Scan and redact sensitive information before sharing

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages