Skip to content

Security: madanimkhitar22-beep/Sovereign-DevKit

SECURITY.md

πŸ” Security Policy β€” Sovereign-DevKit

"Sovereignty is not speed β€” it is the discipline to preview, confirm, then execute."

This document outlines security practices, backup recovery procedures, and responsible disclosure guidelines for Sovereign-DevKit, aligned with the Mkhitarian Philosophy of ethical, intentional execution.


πŸ“‹ Supported Versions

Version Status Security Support
v3.1.x βœ… Current Full support + patches
v3.0.x 🟑 Maintenance Critical fixes only
< v3.0 πŸ”΄ End-of-Life No security updates

πŸ”„ Recommendation: Always use the latest v3.1.x release for safety controls (--dry-run, --backup, --report).


πŸ›‘οΈ Core Security Principles

  1. Intent Before Execution β€” Preview changes with --dry-run before applying fixes.
  2. Sovereignty Over Convenience β€” Auto-backups (.bak) are enabled by default; you control your data.
  3. Transparency By Design β€” All detection patterns are visible in-source; no hidden logic.
  4. Zero-Trust Output β€” Detected values are redacted ([REDACTED]) even in scan logs.
  5. Minimal Attack Surface β€” Zero external dependencies; pure Node.js built-ins only.

πŸ’Ύ Backup & Recovery Guide (v3.1+)

How Backups Work

When using --fix (with default --backup), LogSanitizer.js creates a .bak copy before modifying any file:

# Original file
config.js

# After: node LogSanitizer.js config.js --fix
config.js      # ← Sanitized (leaks redacted)
config.js.bak  # ← Original content preserved

Recovery Steps

If you need to restore a file after redaction:

# 1. Verify the backup exists
ls -la config.js.bak
# 2. Restore the original
cp config.js.bak config.js

# 3. (Optional) Re-scan with stricter filters
node LogSanitizer.js config.js --ext .js --dry-run

Best Practices

  • βœ… Always test with --dry-run first
  • βœ… Keep .bak files locally until you confirm the fix is correct
  • βœ… Delete .bak files only after verification: rm *.bak
  • ❌ Never commit .bak files to version control (ignored by default in .gitignore)

πŸ› Reporting False Positives

If LogSanitizer.js flags a value that is not a sensitive leak:

Step 1: Verify Context

Check if the value appears in:

  • Test/mock files (test/, mocks/, __tests__/)
  • Documentation or comments
  • Example configuration (.env.example)

Step 2: Use Context-Aware Scanning (v3.5+ upcoming)

Future versions will auto-ignore known safe patterns. For now, use extension filtering:

# Scan only production-relevant files
node LogSanitizer.js ./src --ext .js,.ts,.env

Step 3: Report the Pattern

Open an issue with:

## False Positive Report

- **File path**: `path/to/file.js`
- **Flagged pattern**: `[paste the regex name or sample]`
- **Why it's safe**: [brief explanation]
- **LogSanitizer.js version**: `v3.1.0`

πŸ”— β†’ Open a New Issue


🚨 Responsible Disclosure

If you discover a genuine security vulnerability in Sovereign-DevKit:

βœ… Do:

  • Contact the maintainer privately first (see below)
  • Provide reproducible steps and impact assessment
  • Allow reasonable time for a fix before public disclosure

❌ Don't:

  • Exploit the vulnerability beyond testing
  • Disclose details publicly before a patch is released
  • Access or modify data you don't own

πŸ“¬ Contact


πŸ§ͺ Security Testing Checklist (For Contributors)

Before submitting a PR that modifies detection logic:

# 1. Run dry-run on test suite
node LogSanitizer.js ./tests --dry-run

# 2. Verify no false positives on clean files
node LogSanitizer.js ./src --ext .js --report

# 3. Confirm backup behavior
echo "TEST=sk-test-fake-key" > test.env
node LogSanitizer.js test.env --fix
[ -f test.env.bak ] && echo "βœ… Backup created"

# 4. Clean up test artifacts
rm -f test.env test.env.bak report.json

🌐 Threat Model Overview

Threat Mitigation
πŸ”‘ Accidental key exposure 35-pattern detection + --fix redaction
πŸ“¦ Leaked scan logs Output values auto-redacted ([REDACTED])
πŸ’₯ Malicious regex injection Fresh RegExp per call; no eval() or dynamic code
πŸ“± Mobile environment risks Zero dependencies; no network calls; local-only execution

🧭 Philosophy Alignment

"Architecture is a product of thought β€” not infrastructure. Constraints refine systems instead of limiting them."

Every security decision in Sovereign-DevKit reflects the Mkhitarian Principles:

  • 🎯 Intent: Tools require conscious approval before modification
  • πŸ›‘οΈ Sovereignty: Users retain full control over backups and data
  • πŸ” Transparency: All logic is open-source and auditable
  • ⚑ Simplicity: Minimal code = minimal attack surface
  • πŸ“± Human-First: Designed for mobile developers with limited resources

πŸ“„ License & Attribution

"In the Name of the Creator, We Build."


There aren't any published security advisories