Automation security · 9 minute read
n8n workflow secrets hygiene: a 20-minute audit checklist
n8n is popular because it connects everything — your CRM, your database, your email, your internal APIs. That same connectivity is the risk: every credential stored in n8n is a key to another system, and every webhook is a front door you may not have locked.
Most teams set up n8n once and never revisit the credentials. This checklist is designed to run in twenty minutes. It surfaces the hygiene problems that turn an automation platform into an unmonitored backdoor.
Minute 0–2: list every credential
Open the n8n credentials page (/credentials) and export or screenshot the full list. For each credential, note:
- The service it connects to (PostgreSQL, Supabase, HTTP Request, Gmail, Slack, and so on).
- The authentication type — API key, OAuth2, basic auth, header.
- When it was last rotated, if you know.
- Which workflows use it.
If you cannot answer which workflows use this credential for an entry, that credential is already a candidate for removal.
Minute 2–6: find hard-coded secrets in workflow JSON
Open a few representative workflows and search the JSON for the patterns below. Secrets belong in n8n's encrypted credential store and in the node's credential field, never in workflow JSON: if a secret is in the JSON it is in version control (once you export workflows to Git), it is in logs, and it is visible to anyone with read access to the workflow.
# secret-looking values in exported workflow JSON
grep -rEi '"(apiKey|accessToken|secret|password|authorization)"[[:space:]]*:[[:space:]]*"[^"]{8,}"' workflows/
# tokens or keys passed inside a URL query string
grep -rEi 'https?://[^"]*(\?|&)(token|key|secret|signature)=' workflows/
# a credential referenced by id, but the value pasted into a Set or Code node
grep -rEi '(Bearer[[:space:]]+[A-Za-z0-9._-]{20,}|sk_live_[A-Za-z0-9]{10,}|AKIA[0-9A-Z]{16})' workflows/A pattern worth keeping as the reference bar: the workflow templates we maintain at github.com/cekuu35/n8n-workflow-templates keep every token on the credential side of the node, so an exported workflow contains no live secret at all. If your exports trip the grep above, they do not meet that bar.
The general rotation and history-purge sequence is the same one you use for a key pushed to a repo — what actually happens in the first 24 hours is the timeline that decides how fast you have to move.
Minute 6–10: audit the webhook nodes
Webhook nodes (Webhook trigger, Respond to Webhook) are public URLs by default. For each webhook, ask:
- Is authentication required — a header token, a query signature, or n8n's built-in auth?
- Does the responding workflow validate the caller before acting?
- Is the webhook URL published anywhere — Slack, documentation, a GitHub issue?
An unauthenticated webhook that writes to a database or triggers a payment is an open command shell. Require at least one shared secret in the header, and verify it inside the workflow before any state-changing action.
Minute 10–14: environment variables and execution logs
Review the n8n environment configuration — N8N_ENCRYPTION_KEY, the database credentials, OAuth client secrets — and any .env file on the host. The environment variable reference is the checklist for which values must never land in a shared file or a container image. Then open the execution history for the last seven days and look for:
- Workflows that ran successfully but should not have (unknown trigger source).
- Repeated failures on the same credential — a possible brute-force against a stored key.
- Executions initiated from IP addresses you do not recognize.
If n8n execution logging is disabled, turn it on. You cannot audit what you cannot see.
Minute 14–18: rotation and offboarding
For every active credential, ask:
- When was the underlying password or API key last rotated?
- Does any former contractor or team member still have a copy — in a password manager, a local export, a notebook?
- Is there a credential for a service you no longer use?
Mark each credential with a rotation date. Anything without a date in the last 90 days goes on the rotation list.
Minute 18–20: decide what to change
By the end of twenty minutes you should have:
- A list of credentials to rotate this week.
- A list of workflows that embed secrets in JSON, to refactor.
- A list of unauthenticated webhooks, to secure.
- The next audit on the calendar — set it for 30 days.
Secrets hygiene is not a one-time cleanup. It is a recurring check, exactly like reviewing RLS policies on a database. The two problems compound: an n8n workflow holding a Supabase service-role credential, pointed at a table with a permissive policy, is one vulnerability with two halves.
Where the database boundary matters
If your n8n workflows write to Supabase or PostgreSQL, the credential you store in n8n is only as safe as the policies on the other side. That is why the Supabase RLS review from $95 covers the credential-to-policy boundary: what an authenticated connection can actually read and write, not just whether a password exists. And the other half of a leaked automation credential is covered by the same runbook as any other exposed key — rotate, verify the old key reads 401, then purge history.
The database side of the same checklist
Verify what your n8n credential can actually reach
$95 spot check · 5 critical tables · 24 hours
Read-only anon-key probe, policy census and grant check, with the evidence and the written verdict for the tables your automation touches.
Book the $95 spot check ↗Review scope and pricing →Running the automation checklist yourself and want the database-side verdict?
Fixed-price reviews with the evidence, the SQL and the written verdict. Fixes are quoted separately. Instant checkout, no account needed.
Related reading: what happens in the first 24 hours of an exposed key, the 30-minute rotation runbook and the public workflow templates at github.com/cekuu35/n8n-workflow-templates. The database-side counterpart, scope and pricing, lives on the Supabase RLS security audit page.