MapnosticsDOCS
← Back to Main Site
Docsβ€ΊIntelligence Modulesβ€ΊSecrets Detection
πŸ”

Secrets Detection

Mapnostics scans your entire repository for hardcoded credentials, API keys, tokens, and private data β€” before they reach production and before they become a breach notification.

How it works

The scanner uses pattern matching for known secret formats (AWS keys, JWT tokens, private keys) combined with AI-assisted context analysis for semantic secrets β€” strings that look like passwords even without a known pattern.

  • API keys and tokens β€” AWS, Stripe, SendGrid, GitHub, OpenAI, and 40+ providers.
  • Database connection strings β€” Postgres, MySQL, MongoDB URIs with embedded credentials.
  • Hardcoded passwords β€” including variables named password, secret, or key.
  • Private IPs and internal hostnames β€” often left from development environments.

Live demo

The scanner reports progress as a percentage bar. Once complete, findings surface by severity β€” each showing the file, line number, raw snippet, and a masked version for safe sharing.

mapnostics.com/repo/mapnostics-app/secrets
Secrets Detection
Scanning for credentials, tokens, and private data
0
High
0
Medium
0
Low
SCANNING 312 FILES…
0%
HIGHAWS Access Key
src/config/aws.ts Β· line 23
AKIAIOSFODNN7EXAMPLEAKIA*************
MEDIUMHardcoded Password
src/pages/Demo.tsx Β· line 16
const pw = "Demo123"PASSWO***
LOWPrivate IP Address
src/services/legacy-api.ts Β· line 4
192.168.0.100192.***

Severity levels

High

Active credentials for cloud services, payment providers, or authentication systems. Rotate immediately β€” assume compromised if they appear in any commit history.

Medium

Hardcoded passwords for non-production environments or internal API keys. Still a risk, especially if the same password is reused in production.

Low

Private IP addresses, internal hostnames, and development-only tokens. Lower urgency but should be removed to avoid leaking infrastructure topology.

NOTE
Git history is permanent. Even if you remove a secret from the latest commit, it is recoverable from history. Use git filter-repo after rotating the credential.

How to respond

  • 1. Rotate the credential immediately β€” do not wait until the code is fixed.
  • 2. Check provider logs for unauthorized access during the exposure window.
  • 3. Remove the hardcoded value and replace with an environment variable.
  • 4. Purge from git history using BFG or git filter-repo.
  • 5. Mark the finding as resolved in Mapnostics to track remediation.
TIP
Use .env.local for local secrets and add it to .gitignore. For production, use your platform's secrets manager (Vercel, Railway, AWS Secrets Manager).