Quick Overview
This workflow reads API endpoints and JWTs from Google Sheets, tests each endpoint with multiple token scenarios using HTTP requests, and writes a risk-scored security summary back to Google Sheets.
How it works
- Triggers manually (or on an optional daily schedule).
- Loads the target Google Sheets document ID and the endpoint/results tab names.
- Reads endpoint definitions from Google Sheets and keeps only rows marked as active.
- For each endpoint, decodes the provided JWT and generates test variants (no auth, tampered payload, and alg:none).
- Sends HTTP requests to the endpoint using the valid token and, if that succeeds, repeats the request with each test token variant and captures the response status codes.
- Evaluates the status codes and token metadata to flag issues (for example, unauthenticated access, tampered token acceptance, alg:none acceptance, or missing exp) and assigns a risk level.
- Appends the timestamped results and summary to the results tab in Google Sheets.
Setup
- Create a Google Sheet with an endpoints tab containing columns like
label, endpoint_url, method, token, and active, and a results tab with columns like timestamp, label, risk_level, t1_valid, t2_no_auth, t3_tampered, t4_alg_none, and summary.
- Add a Google Sheets Service Account credential in n8n and share the spreadsheet with the service account email.
- Update the Sheet ID and tab names in the workflow’s variables (Sheet ID, endpoints sheet name, and results sheet name).
- Ensure each endpoint row includes a valid JWT in the
token column and set active to TRUE for endpoints you want to test.
- If you want it to run automatically, enable the schedule trigger and adjust the cron expression as needed.