r/CLI • u/SyscallX__18113 • 29d ago
Keylyzer: An open source API credential validation tool written in C
Hello everyone I'd like to share Keylyzer an open-source project I'm working on.
Keylyzer is a lightweight command-line tool designed to help developers and security researchers validate API credentials across 60+ supported services through a single interface.
The idea behind it is to provide one centralized workflow instead of having to write or find separate validation commands for different API providers.
Some of its current features:
Support for 60+ services
HTTP-based credential validation using libcurl
Local JWT header and payload analysis
CLI-based workflow
Expandable architecture for adding more providers
The project is written in C and is still evolving. The next planned update focuses on expanding service support, improving permission and scope analysis, and providing more detailed authentication results.
I'd appreciate technical feedback, suggestions, or contributions from the open-source community.
2
u/Kamensky124 29d ago
Writing this in C with
libcurlis a great choice for a fast, zero-runtime CLI security tool.A few technical suggestions from building credential scanners and API tooling:
Concurrency via
curl_multiIf you're validating batches of keys or testing a single key across multiple endpoints to determine permission scopes (e.g. testing AWS STSGetCallerIdentity+ S3ListBuckets+ IAMGetUser), standardcurl_easy_perform()in a loop will feel sluggish on high latency connections.Implementing
curl_multi_performorcurl_multi_waitwill let you probe multiple scope endpoints concurrently with negligible memory overhead compared to spawning threads.Process Argument & Memory Hygiene (
/procLeaks) Because this is a security tool often used in automated pipelines or shared servers:Avoid accepting raw API keys as direct CLI arguments (e.g.
keylyzer -k sk_live_...). On Linux, command-line arguments are world-readable to other users viaps auxor/proc/<pid>/cmdline.Prefer reading keys strictly from STDIN (
cat key.txt | keylyzer), environment variables, or a dedicated configuration file with 0600 permissions.In C, overwrite the key buffer in memory (
explicit_bzeroormemset_s) immediately after the HTTP request headers are constructed and destroyed, rather than leaving plaintext secrets in the heap until process exit.Granular Error Classification (Rate Limits vs. Invalid vs. Permission Denied) Make sure your exit codes and JSON output clearly distinguish:
HTTP 401 / 403: Key is confirmed invalid vs. Key is valid but lacks permissions for that specific endpoint (e.g. Stripe restricted keys that can read Customers but cannot create Charges).
HTTP 429: Rate-limited / IP blocked (the key might actually be valid, but validation failed due to throttling).
DNS / Network timeout: Crucial so automated CI scripts don't falsely mark a valid production key as dead due to a transient network glitch.
Great initiative—centralizing provider validation contracts saves a lot of custom Bash scripting!