|
1 | | -# 🐕 Rustywoof (woof) |
| 1 | +# Rustywoof |
2 | 2 |
|
3 | | -> **Enterprise-grade secret scanner and supply chain watchdog.** |
| 3 | +[](https://github.com/ianramy/rustywoof/releases) |
| 4 | +[](https://www.rust-lang.org/) |
| 5 | +[](https://opensource.org/licenses/MIT) |
| 6 | +[]() |
| 7 | +[](https://osv.dev/) |
| 8 | +[]() |
4 | 9 |
|
5 | | -Rustywoof is a blazing-fast, memory-safe CLI tool designed to detect exposed cryptographic credentials and compromised dependencies before they breach your perimeter. Built in Rust, it utilizes an `O(n)` Aho-Corasick automaton to scan thousands of files in milliseconds without crashing your CI/CD pipelines. |
| 10 | +**Enterprise-grade perimeter defense, secret scanner, and supply chain watchdog.** |
6 | 11 |
|
7 | | -## ✨ Features |
| 12 | +Rustywoof is a high-performance, memory-safe command-line engine designed to detect exposed cryptographic credentials and compromised dependencies before they breach your system perimeter. Built entirely in Rust, it is engineered for strict enterprise CI/CD environments, utilizing zero-copy memory mapping and an O(n) Aho-Corasick automaton to analyze thousands of files in milliseconds without exhausting system resources. |
8 | 13 |
|
9 | | -- **High-Speed Regex Pre-filtering:** Uses Aho-Corasick for simultaneous, multi-pattern literal prefix matching. |
10 | | -- **OOM-Immune Engine:** Strict file-size constraints and binary bypassing ensure stability on massive monorepos. |
11 | | -- **Live Threat Intelligence:** Queries the Open Source Vulnerability (OSV) API using JSON batching to audit Node, Rust, and Python lockfiles in under 500ms. |
12 | | -- **Proactive Perimeter Defense:** Automatically detects un-tracked `.env` files and manages Git `pre-commit` hooks. |
13 | | -- **Mathematical Context:** Calculates the Shannon Entropy of leaked credentials to reduce false positives. |
| 14 | +--- |
14 | 15 |
|
15 | | -## 🚀 Installation |
| 16 | +## Security & Trust Posture |
| 17 | + |
| 18 | +We recognize that running a security binary locally requires absolute trust. Rustywoof is built with strict operational transparency: |
| 19 | + |
| 20 | +* **No Telemetry or Exfiltration:** The engine does not track user data, usage analytics, or exfiltrate source code. |
| 21 | + |
| 22 | +* **Local Execution:** Secret scanning operations (Aho-Corasick pre-filtering and Regex validation) are executed entirely on your local machine. |
| 23 | + |
| 24 | +* **Verifiable Outbound Traffic:** The only outbound network requests made by Rustywoof are standard HTTPS POST requests directed exclusively to [https://api.osv.dev](https://api.osv.dev) (Google's Open Source Vulnerability database) during the audit or patrol commands. |
| 25 | + |
| 26 | +* **Open Source Verifiability:** The complete source code is available for independent audit. We encourage security researchers and engineers to compile the binary directly from the source. |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## Core Capabilities |
| 31 | + |
| 32 | +### 1. High-Performance Secret Detection |
| 33 | + |
| 34 | +* **Aho-Corasick Automaton:** Utilizes simultaneous, multi-pattern literal prefix matching to filter text in O(n) time before invoking expensive Regex evaluations. |
| 35 | + |
| 36 | +* **Zero-Copy Architecture:** Employs OS-level memory mapping (mmap) to read files directly as byte slices, drastically reducing RAM allocation. |
| 37 | + |
| 38 | +* **Binary Fast-Fail Heuristic:** Instantly identifies and bypasses compiled binaries by evaluating the initial byte headers, preventing Out-Of-Memory (OOM) crashes on large artifacts. |
| 39 | + |
| 40 | +* **Cryptographic Context:** Calculates the Shannon Entropy of matched strings to confidently differentiate between genuine cryptographic keys and high-entropy plaintext, heavily reducing false positives. |
| 41 | + |
| 42 | +### 2. Supply Chain Threat Intelligence |
| 43 | + |
| 44 | +* **OSV Batch Querying:** Parses multiple lockfiles (Cargo, npm, pnpm, yarn, Poetry, pip) and audits them against the Open Source Vulnerability (OSV) database. (Note: This specific feature requires an active internet connection to query the upstream database). |
| 45 | +* **Local Threat Caching:** To prevent network bottlenecks during repeated CI/CD runs, Rustywoof caches OSV API responses locally with a 12-hour Time-To-Live (TTL). |
| 46 | +* **Automated Remediation:** Capable of spawning shell processes to force native package managers to update a compromised dependency to a secure target version. |
| 47 | + |
| 48 | +### 3. Proactive Perimeter Defense |
| 49 | + |
| 50 | +* **Staged-Only Git Hooks:** Manages pre-commit hooks that strictly scan newly staged files (git diff --cached), ensuring rapid execution without scanning the entire repository. |
| 51 | +* **Environment Guarding:** Automatically detects untracked .env files and interactively deploys strict .gitignore configurations to prevent accidental credential leakage. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Installation |
16 | 56 |
|
17 | 57 | ### Option 1: Quick Install (macOS / Linux) |
18 | 58 |
|
| 59 | +To install Rustywoof on macOS or Linux, run the following command in your terminal: |
| 60 | + |
19 | 61 | ```bash |
20 | | -curl --proto '=https' --tlsv1.2 -LsSf [https://github.com/ianramy/rustywoof/releases/latest/download/installer.sh](https://github.com/ianramy/rustywoof/releases/latest/download/installer.sh) | sh |
| 62 | +curl -sSL https://ianramy.co.ke/rustywoof/installer.sh | sh |
21 | 63 | ``` |
22 | 64 |
|
23 | | -### Option 2: Via Cargo (Rust developers) |
| 65 | +### Option 2: Windows (PowerShell) |
| 66 | + |
| 67 | +To install Rustywoof on Windows, run the following command in your PowerShell terminal: |
| 68 | + |
| 69 | +```bash |
| 70 | +irm https://ianramy.co.ke/rustywoof/installer.ps1 | iex |
| 71 | +``` |
| 72 | + |
| 73 | +### Option 3: Compile from Source (Via Cargo) |
| 74 | + |
| 75 | +To compile the engine from source, use Cargo, Rust's package manager. |
24 | 76 |
|
25 | 77 | ```bash |
26 | 78 | cargo install rustywoof |
| 79 | +``` |
27 | 80 |
|
28 | | -# or |
| 81 | +> [!NOTE] |
| 82 | +> For the highest level of trust, use `cargo binstall` to compile the engine from source. |
29 | 83 |
|
| 84 | +```bash |
30 | 85 | cargo binstall rustywoof |
31 | 86 | ``` |
32 | 87 |
|
33 | | -### Option 3: Windows (PowerShell) |
| 88 | + |
| 89 | +### Option 4: Node.js Package Managers |
| 90 | + |
| 91 | +To install Rustywoof via Node.js package managers, use the following commands: |
34 | 92 |
|
35 | 93 | ```bash |
36 | | -irm [https://github.com/ianramy/rustywoof/releases/latest/download/installer.ps1](https://github.com/ianramy/rustywoof/releases/latest/download/installer.ps1) | iex |
| 94 | +npm install -g @ianramy/rustywoof |
37 | 95 | ``` |
38 | 96 |
|
39 | | -## 🛠️ Usage |
| 97 | +```bash |
| 98 | +pnpm install -g @ianramy/rustywoof |
| 99 | +``` |
40 | 100 |
|
41 | | -Rustywoof is designed to be simple and devastatingly effective. |
| 101 | +```bash |
| 102 | +yarn global add @ianramy/rustywoof |
| 103 | +``` |
42 | 104 |
|
43 | 105 | ```bash |
44 | | -# Execute a full perimeter sweep (Code + Dependencies) |
| 106 | +bun install -g @ianramy/rustywoof |
| 107 | +``` |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## Usage Guide |
| 112 | + |
| 113 | +Rustywoof is designed to provide maximum visibility with minimal configuration. |
| 114 | + |
| 115 | +```bash |
| 116 | +# Execute a full perimeter sweep (Code Secrets + Dependency Threats) |
45 | 117 | woof patrol |
46 | 118 |
|
47 | | -# Scan a specific directory for secrets |
| 119 | +# Scan a specific directory or file for exposed secrets |
48 | 120 | woof scan ./src |
49 | 121 |
|
50 | | -# Audit lockfiles against the OSV vulnerability database |
| 122 | +# Audit project lockfiles against the OSV vulnerability database |
51 | 123 | woof audit |
52 | 124 |
|
53 | 125 | # Force a package manager to remediate a compromised dependency |
54 | 126 | woof remediate axios 1.7.4 |
55 | 127 |
|
56 | | -# Deploy the pre-commit guard to block leaked secrets |
| 128 | +# Deploy the Watchdog pre-commit guard to block leaked secrets natively in Git |
57 | 129 | woof hook install |
58 | 130 | ``` |
59 | 131 |
|
60 | | -## ⚙️ Configuration |
| 132 | +--- |
| 133 | + |
| 134 | +## Configuration |
61 | 135 |
|
62 | | -Run `woof init` to generate a `.woof.toml` file in your project root. You can add custom domain-specific regex rules and ignore paths here. |
| 136 | +Run `woof init` to generate a `.woof.toml` configuration file in your project root. This allows teams to define domain-specific rules, suppress false positives via entropy tuning, and manage scan perimeters. |
63 | 137 |
|
64 | 138 | ```toml |
| 139 | +# Directories to bypass during sweeps |
65 | 140 | ignore_paths = ["tests/", "node_modules/", "target/"] |
66 | 141 |
|
| 142 | +# Adjust the Shannon entropy threshold (lower values increase sensitivity) |
| 143 | +min_entropy = 3.0 |
| 144 | + |
| 145 | +# Define proprietary token formats |
67 | 146 | [[custom_rules]] |
68 | 147 | name = "Internal API Token" |
69 | 148 | pattern = "api_prod_[a-zA-Z0-9]{32}" |
70 | 149 | ``` |
71 | 150 |
|
72 | | -## 🛡️ License |
| 151 | +> [!NOTE] |
| 152 | +> Developers can also use inline suppression directives like `// woof:ignore-next-line` directly in their source code to bypass specific flagged strings. |
| 153 | +
|
| 154 | +--- |
| 155 | + |
| 156 | +## License |
73 | 157 |
|
74 | | -This project is licensed under the [MIT License](LICENSE) - see the LICENSE file for details. |
| 158 | +This software is distributed under the [MIT License](LICENSE). See the LICENSE file in the repository for full details. |
0 commit comments