# Website Security Headers & Secrets Auditor (`opaque_ideal/vibecode-security-surface-auditor`) Actor

Non-destructive security audit for web apps & AI-built SaaS (Lovable, Bolt, Next.js, Supabase). Checks security headers, CORS, JS bundles for secret/service_role key leaks, exposed .js.map source maps, and /.env leaks. PPE & MCP ready.

- **URL**: https://apify.com/opaque_ideal/vibecode-security-surface-auditor.md
- **Developed by:** [Naren Krishna.M](https://apify.com/opaque_ideal) (community)
- **Categories:** Developer tools, Automation, Agents
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $12.00 / 1,000 web apps security audited

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Website Security Headers & Secrets Auditor

Non-destructive public security surface scanner built for modern web applications, SaaS frontends, and AI-scaffolded sites (Lovable, Bolt, Cursor, v0, Replit, Next.js, Supabase, Firebase).

### Why Use This Actor?

Generic secret scanners throw endless false alarms on Supabase's public `anon` JWT tokens, while enterprise penetration suites cost hundreds per month. This Pay-Per-Event Actor performs fast, non-destructive HTTP/JS inspections tailored for modern JS/SaaS stacks with strict token classification and automatic secret redaction.

- **Zero False Positives on Supabase `anon` Keys:** Decodes JWT claims (`role: "anon"` vs `role: "service_role"`) so public client keys stay informational while exposed admin/service keys flag critical.
- **Automatic Redaction:** Every detected credential is masked (`prefix...REDACTED...suffix`) inside dataset records.
- **No Charge on Unreachable Targets:** Failed or timed-out domains cost **$0.00**.

### Security Checks Performed

1. **JS Bundle & HTML Secret Detection:** Scans HTML and referenced JavaScript bundles for leaked `sk_live_` / `rk_live_` Stripe keys, OpenAI/Anthropic API keys, AWS `AKIA` keys, GitHub tokens, Supabase `service_role` JWTs, private keys, and hardcoded database URIs.
2. **HTTP Security Headers & CORS:** Checks HTTPS redirect enforcement, `Strict-Transport-Security` (HSTS), `Content-Security-Policy` (CSP), `X-Frame-Options` / `frame-ancestors`, `X-Content-Type-Options`, `Referrer-Policy`, and permissive `Access-Control-Allow-Origin` headers.
3. **Public Exposure Surface:** Non-destructive checks for publicly downloadable production `.js.map` source maps, real `/.env` file exposure (ignoring SPA HTML 200 fallbacks), and `/.well-known/security.txt`.

### Use Cases

- **Pre-Launch SaaS Sanity Checks:** Run automatically after shipping Lovable/Bolt/Next.js deployments in CI/CD or weekly Apify Schedules.
- **Agency Security QA:** Audit client staging and production domains before handoff.
- **AI Developer Workflows (MCP):** Connect via `mcp.apify.com` so your coding assistant checks a deployed preview URL immediately after launch.

### Pricing (Pay-Per-Event)

- **`site-security-audited` ($0.025 / URL):** Charged once per target URL successfully inspected.
- **`apify-actor-start` ($0.00005):** Minimal startup event.
- **Unreachable targets:** **$0.00**.

### Example Input

```json
{
  "urls": ["https://apify.com"],
  "maxBundlesPerSite": 15,
  "timeoutSeconds": 15
}
```

### Example Output JSON

```json
{
  "domain": "apify.com",
  "status": "ok",
  "riskGrade": "A",
  "riskScore": 12,
  "criticalCount": 0,
  "highCount": 0,
  "mediumCount": 1,
  "bundlesScannedCount": 10,
  "exposedSourceMapsCount": 0
}
```

### Authorized Use Notice

Use strictly on websites, applications, and staging/production deployments you own or have explicit authorization to inspect.

### FAQ

**Does this run aggressive brute-force attacks?**\
No. It performs lightweight passive HTTP `GET`/`HEAD` requests identical to normal asset fetches.

**Why won't it flag my public Firebase/Supabase anon key as critical?**\
It inspects JWT role payloads and key prefixes to separate safe client-side keys from critical server credentials.

### More Tools by `opaque_ideal`

- [`llms.txt`, AI Readiness & SaaS Pricing Scraper](https://apify.com/opaque_ideal/ai-readiness-pricing-llms-auditor) — GEO readiness, crawler policy & pricing hash monitoring
- [Sitemap Extractor & Broken Link Checker](https://apify.com/opaque_ideal/sitemap-broken-link-seo-checker) — Check 404s, redirects & XML sitemaps
- [Chrome Web Store Scraper & Developer Emails](https://apify.com/opaque_ideal/chrome-webstore-extensions-leads) — Extract extension installs, ratings & dev emails
- [Website Audit, Lead Contact & Pitch Scraper](https://apify.com/opaque_ideal/agency-site-audit-pitch-auditor) — Agency UX friction & B2B lead contact audits

# Actor input Schema

## `urls` (type: `array`):

List of deployed web app URLs you own or are authorized to audit.

## `scanLinkedJsBundles` (type: `boolean`):

Fetches and inspects loaded frontend JS bundles for leaked secret keys, service_role JWTs, and client-side admin flags.

## `maxBundlesPerSite` (type: `integer`):

Maximum number of script bundles inspected per target URL.

## `checkSourceMaps` (type: `boolean`):

Runs lightweight HEAD checks to see if production JS source maps are publicly downloadable.

## `checkPublicExposurePaths` (type: `boolean`):

Checks for exposed /.env files (verified non-HTML) and presence of /.well-known/security.txt.

## `includeFailedUrls` (type: `boolean`):

Logs failed URLs with error details at zero charge.

## `timeoutSeconds` (type: `integer`):

HTTP timeout per request in seconds.

## `maxConcurrency` (type: `integer`):

Number of target URLs audited simultaneously.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://example.com"
  ],
  "scanLinkedJsBundles": true,
  "maxBundlesPerSite": 12,
  "checkSourceMaps": true,
  "checkPublicExposurePaths": true,
  "includeFailedUrls": true,
  "timeoutSeconds": 15,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://apify.com",
        "https://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("opaque_ideal/vibecode-security-surface-auditor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": [
        "https://apify.com",
        "https://example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("opaque_ideal/vibecode-security-surface-auditor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://apify.com",
    "https://example.com"
  ]
}' |
apify call opaque_ideal/vibecode-security-surface-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opaque_ideal/vibecode-security-surface-auditor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/SPmPD7lbLyS84cPbW/builds/HVhgpf2lv57miOkQo/openapi.json
