Skip to content

docs/Three pillars

Security

Leaked API keys and secrets first, then passive hygiene: TLS, headers, cookies, components, DNS and forms.

The security pillar reads what a normal visit loads: the HTML, first-party JavaScript and the source maps it references, the headers and cookies, one TLS handshake and public DNS. It never logs in, submits forms, guesses paths or sends attack payloads.

#Areas

AreaExamples
T Transport and TLSHTTPS, HTTP to HTTPS redirect, HSTS, certificate validity and expiry, TLS 1.0/1.1, mixed content
H Browser hardeningContent-Security-Policy and its quality, X-Content-Type-Options, clickjacking, Referrer-Policy, Permissions-Policy
K Cookies and sessionsSecure, HttpOnly and SameSite flags, tokens in URLs, tokens in localStorage
X Code and secret exposure65 secret formats, source maps, staging URLs, stack traces
D ComponentsVersion disclosure, end-of-life libraries, compromised CDNs such as polyfill.io, missing Subresource Integrity
A Attack surfacerobots.txt leaks, security.txt, soft 404; with --subdomains, certificate-transparency subdomains and dangling CNAMEs
M E-mail and DNSSPF, DMARC, CAA, DKIM, MTA-STS, TLS-RPT, DNSSEC
F Forms and abuseForms without CAPTCHA or honeypot, disabled spam protection
R Repository, CI/CD and IaCWith scan or --repo: secrets in git history, dependencies, code patterns, GitHub Actions, Dockerfiles, compose, Terraform and Kubernetes

#Secret formats

65 formats, found with a keyword prefilter before any regular expression runs (so large bundles stay fast) and an entropy filter for generic matches.

GroupProviders
Cloud and infrastructureAWS, Azure storage, Google service accounts, DigitalOcean, Vault, Terraform Cloud, Doppler, Pulumi, Fly.io, Netlify, Supabase, Grafana, Sentry, New Relic
Code hosting and registriesGitHub, GitLab, npm, PyPI, Docker Hub, Atlassian
PaymentsStripe and Clerk live keys, Stripe webhooks, Square, Braintree, Plaid, Shopify, Shippo
AI providersOpenAI, Anthropic, Hugging Face, Groq, Perplexity, xAI, Replicate
Messaging and SaaSSlack, Discord, Teams and Zapier webhooks, Telegram, SendGrid, Brevo, Mailgun, Mailchimp, Twilio, Linear, Notion, Figma, Postman, Contentful, Airtable, Dropbox, Firebase Cloud Messaging, Google API keys and OAuth secrets, Mapbox
GenericPrivate keys, age keys, database URLs with passwords, JWTs with Supabase role detection, high-entropy secret assignments

Public-by-design values, such as Stripe publishable keys, Firebase web keys and Supabase anon keys, are reported as INFO with a note to check their restrictions. A Supabase JWT with the service_role role is CRITICAL.

#Repository scan

kagicyber scan <dir> (or --repo <dir> on an audit) checks your own code. Findings point at file and line for SARIF. --quick limits it to the working tree.

  • Working tree: secrets, secret-looking public variables (NEXT_PUBLIC_*SECRET*, VITE_*TOKEN*), committed .env files, .gitignore without .env, production source maps.
  • Git history: secrets added in any commit, even if deleted later.
  • Dependencies: missing lockfiles, end-of-life Node.js in engines, no Dependabot or Renovate.
  • Code patterns: candidates to confirm, such as XSS sinks, SQL built from strings, SSRF, open redirects, path traversal, weak password hashing and unverified JWTs.
  • CI/CD: GitHub Actions without a permissions block, actions not pinned to a commit SHA, secrets echoed in a step, unsafe pull_request_target.
  • Infrastructure as code: Dockerfiles running as root, unpinned base images, secrets in ENV, open database ports, privileged Kubernetes containers, public Terraform buckets.

#Score and grade

Start at 100, subtract 35 per CRITICAL, 15 per HIGH, 6 per MEDIUM and 2 per LOW. Grade A from 90, B from 80, C from 65, D from 50, else F. Any CRITICAL caps the grade at D.