Skip to main content

Quick Installation

npm install -g kafkacode

Your First Scan

1

Navigate to your project

Open your terminal and navigate to your project directory:
cd /path/to/your/project
2

Run the scanner

Execute a basic scan on your source code:
kafkacode scan ./src
Or scan the entire project directory:
kafkacode scan .
3

Review the results

KafkaCode will display a detailed report with:
  • Privacy grade (A+ to F)
  • Number of issues found
  • Severity breakdown
  • File locations and line numbers
  • Actionable recommendations

Example Output

🎯 PRIVACY SCAN REPORT
═══════════════════════════════════════════════════════════

📊 SCAN SUMMARY
📁 Directory: ./src
 Timestamp: 2025-01-15 10:30:45
📄 Files Scanned: 25
🔍 Total Issues: 3
🏆 Privacy Grade: 🟡 B-

═══════════════════════════════════════════════════════════

🔴 CRITICAL (1)
────────────────────────────────────────────────────────────
  📄 src/config.js:12
     AWS Access Key detected
     aws_access_key_id = "AKIAIOSFODNN7EXAMPLE"

     💡 Recommendation: Move to environment variables

🟡 MEDIUM (2)
────────────────────────────────────────────────────────────
  📄 src/utils/validator.js:45
     Email address found in code
     const adminEmail = "[email protected]"

     💡 Recommendation: Use configuration file

  📄 src/database/connection.js:8
     Potential database connection string
     const dbUrl = "mongodb://localhost:27017/mydb"

     💡 Recommendation: Use environment variables

═══════════════════════════════════════════════════════════

Verbose Mode

For more detailed progress information during the scan:
kafkacode scan ./src --verbose
This will show:
  • File discovery progress
  • Individual file analysis status
  • Detailed error messages if any

Exit Codes

KafkaCode uses exit codes to indicate scan results:
  • Exit code 0: No issues found
  • Exit code 1: Issues found or scan error
This makes it perfect for CI/CD integration:
kafkacode scan ./src || echo "Privacy issues detected!"

Understanding Severity Levels

Critical

Immediate action required. Contains exposed secrets or credentials.

High

Should be addressed soon. Contains sensitive data that could lead to issues.

Medium

Review recommended. Contains potentially sensitive information.

Low

Optional review. Minor privacy considerations.

Next Steps

Pro Tip: Run KafkaCode in verbose mode during your first scan to understand what it’s checking:
kafkacode scan . --verbose
KafkaCode respects your .gitignore file automatically. Files and directories listed in .gitignore will be skipped during scanning.