Secrets scanning
Secrets scanning looks for passwords, API keys, tokens and private keys in your code. AquilaX masks them in the results.
Included in every plan, including Free.
What it looks for
API keys and tokens
Keys and tokens for cloud and online services.
Passwords
Passwords in source code and settings files.
Private keys
Private keys saved in a repository.
Examples
These examples show common problems and safer ways to write the code. They are not AquilaX results, and scanner coverage can vary.
Cloud keys in a settings file
CWE-798AWSCriticalAWS_ACCESS_KEY_ID = "AKIAIOSFODNN7EXAMPLE" AWS_SECRET_ACCESS_KEY = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" s3 = boto3.client("s3", aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY)
These are AWS's documentation keys. Real ones look exactly the same. Bots scan public GitHub for AKIA strings and start using them within minutes.
In a private repo the key still sits on every laptop, CI runner and backup that has a clone.
# rotate the key first: deleting the line doesn't revoke it
# then let boto3 find credentials (IAM role, SSO, env)
s3 = boto3.client("s3")
"Removed" from the repo, still in history
Git historyCritical$ git log --oneline -- .env 9f2c1ab remove .env from repo 41d07e3 initial commit $ git show 41d07e3:.env DATABASE_URL=postgres://app:[email protected]/app STRIPE_SECRET_KEY=sk_live_51H...
Deleting a file adds a new commit. The old commit is still there, and anyone with a clone can read it with one command.
# 1. rotate both credentials now
# 2. then purge history and force-push
$ git filter-repo --path .env --invert-paths
$ echo ".env" >> .gitignore
An API key shipped to every browser
Next.jsOpenAICritical// .env NEXT_PUBLIC_OPENAI_API_KEY=sk-proj-... // client component fetch("https://api.openai.com/v1/chat/completions", { headers: { Authorization: `Bearer ${process.env.NEXT_PUBLIC_OPENAI_API_KEY}`, }, ...
Next.js inlines every NEXT_PUBLIC_ variable into the JavaScript bundle at build time. Anyone can open DevTools, search for sk-, and spend your credit.
// app/api/chat/route.ts runs on the server
const key = process.env.OPENAI_API_KEY; // no NEXT_PUBLIC_
// the browser calls /api/chat, never OpenAI directly
What to know
- If a secret is real, replace it first. Deleting it from the latest version of a file does not make it safe.
- Check access logs for signs that someone has used the secret.
- Store secrets in a secrets manager or protected CI/CD variables.
- Scanners can miss secrets and report test values. Review the results.
Questions and answers
What should I do if a secret is found?
Check whether it is real. If it is, revoke or replace it, check the access logs and remove it from the code.
Are secrets shown in the results?
No. AquilaX masks passwords and secrets found in code.
Is it enough to delete a secret from the code?
No. It may still be in your Git history or in copies of the repository. Revoke or replace it first, then follow your process for removing it.
Can AquilaX replace a leaked secret for me?
No. Revoke or replace it in the service where it was created. Then update any apps that use it and check their access logs.
What if the finding is only a test value?
Make sure it does not give access to anything. If it is safe, mark the finding as False Positive. Use values that are clearly fake in examples and tests.
Can I check only the files changed in a pull request?
Yes. Use a diff scan to check the changed files. Run full scans regularly, because a diff scan does not check the rest of the project.
Where should I store secrets?
Use a secrets manager or protected CI/CD variables. Give each app only the access it needs, and change secrets when needed.
Which plan includes this scanner?
Included in every plan, including Free. Compare plans.
Try it on one of your repositories
Create a free account and run a scan. If you need Ultimate, self-hosting or a larger rollout, talk to our team.
No credit card needed. Read the documentation