# Security Headers Checker - Bulk HSTS, CSP & Cookie Audit (`laudedignus/security-headers-audit`) Actor

Audit the HTTP security headers of any list of websites: HSTS, Content-Security-Policy, X-Frame-Options, Referrer-Policy, Permissions-Policy, cookie flags. One graded row per site with fixes.

- **URL**: https://apify.com/laudedignus/security-headers-audit.md
- **Developed by:** [Mouhamed Wade](https://apify.com/laudedignus) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 websites 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

## Security Headers Checker: Bulk HSTS, CSP & Cookie Audit

Check the HTTP security headers of one website or ten thousand. Give the Actor a list of URLs or domains and get one graded row per site: which headers are missing, which are weak, and the exact line to add to fix each one.

It sends one ordinary page request per site (plus one optional request to test the HTTP to HTTPS redirect). No browser, no login, no proxy needed.

### What does it check?

| Check | What is tested |
|---|---|
| `Strict-Transport-Security` | Present, `max-age` of at least 180 days, `includeSubDomains` |
| `Content-Security-Policy` | Enforced (not report-only), no `'unsafe-inline'` or `'unsafe-eval'` for scripts, no wildcard script hosts |
| `X-Content-Type-Options` | Set to `nosniff` |
| Clickjacking protection | `X-Frame-Options` or the CSP `frame-ancestors` directive |
| `Referrer-Policy` | Present and not leaking full URLs to other sites |
| `Permissions-Policy` | Present |
| `Cross-Origin-Opener-Policy` | Present |
| `Server` / `X-Powered-By` | Software names and versions exposed in headers |
| Cookies | `Secure`, `HttpOnly` and `SameSite` flags on every cookie set by the page |
| HTTPS | Final page served over HTTPS, and plain HTTP redirects to HTTPS |

### Who is it for?

- **Agencies and freelancers** auditing every client site in one run, or preparing a security section for a proposal.
- **Security and compliance teams** tracking header coverage across all company domains on a schedule.
- **SEO and web performance consultants** adding a security line to site audits.
- **Developers** checking that a deployment did not drop a header.

### How to use it

1. Paste your URLs or domains into **Websites to audit**.
2. Click **Start**.
3. Download the results as JSON, CSV or Excel, or read them through the API.

Schedule the Actor to run weekly and compare grades over time.

### Input

```json
{
    "urls": ["https://apify.com", "example.com"],
    "checkHttpRedirect": true,
    "includeRawHeaders": false
}
```

| Field | Type | Default | Description |
|---|---|---|---|
| `urls` | array | required | URLs or bare domains. Bare domains are checked over HTTPS. |
| `checkHttpRedirect` | boolean | `true` | Also test whether `http://` redirects to `https://`. |
| `includeRawHeaders` | boolean | `false` | Add all response headers to each row. Cookie values are never returned. |
| `maxConcurrency` | integer | `10` | Sites checked in parallel (1 to 50). |
| `timeoutSecs` | integer | `15` | Timeout per request. |

### Output

One item per site:

```json
{
    "inputUrl": "example.com",
    "finalUrl": "https://example.com/",
    "ok": true,
    "statusCode": 200,
    "reliable": true,
    "notice": null,
    "redirectCount": 0,
    "isHttps": true,
    "httpRedirectsToHttps": true,
    "grade": "D",
    "score": 40,
    "missingHeaders": ["Content-Security-Policy", "Permissions-Policy"],
    "warnings": ["Strict-Transport-Security: includeSubDomains is not set."],
    "recommendations": ["Add an enforced policy, starting from: default-src 'self'"],
    "checks": {
        "hsts": { "status": "warn", "value": "max-age=31536000", "message": "includeSubDomains is not set." }
    },
    "cookieCount": 0,
    "checkedAt": "2026-11-30T18:00:00.000Z"
}
```

A site that cannot be reached returns `ok: false` with an `error` field, so you always get one row per input.

### How is the grade calculated?

Each check has a weight. A failed check loses its full weight, a warning loses half.

| Check | Weight |
|---|---|
| Strict-Transport-Security | 25 |
| Content-Security-Policy | 25 |
| Clickjacking protection | 15 |
| X-Content-Type-Options | 10 |
| Referrer-Policy | 10 |
| Permissions-Policy | 10 |
| Cross-Origin-Opener-Policy | 5 |

Score 90 to 100 is **A**, 75 to 89 **B**, 60 to 74 **C**, 40 to 59 **D**, 20 to 39 **E**, below 20 **F**. Version disclosure and cookie flags are reported as warnings and do not change the score.

### Limits

- Headers are read from the page you give (after redirects). Other pages of the same site can send different headers.
- The audit reads headers only. It does not scan for vulnerabilities and it never attempts to log in or bypass any protection.
- Sites that block automated requests answer with an error page (HTTP 403, 429 or 503). The row is then marked `reliable: false` and the `notice` field explains why, so you never mistake a block page for the real site.

### FAQ

**Is a grade A site secure?** No tool can say that from headers alone. A good grade means the browser-side protections are switched on.

**Can I audit sites I do not own?** The Actor only makes the same public request a browser makes when opening the page.

**Something looks wrong?** Open an issue in the Issues tab with the URL and the run ID.

### More tools from the same developer

Same approach in each: public sources only, no login, one clear row per result, errors explained.

- [SEO Audit Tool](https://apify.com/laudedignus/seo-page-audit): score the on-page SEO of any list of URLs.
- [Tech Stack Detector](https://apify.com/laudedignus/tech-stack-detector): find the CMS, shop platform, analytics and hosting behind any list of websites.
- [Broken Link Checker](https://apify.com/laudedignus/broken-link-checker): crawl a website and list its dead links and 404s.
- [SPF, DKIM & DMARC Checker](https://apify.com/laudedignus/email-security-audit): check SPF, DKIM and DMARC for any list of domains.
- [App Store Reviews Scraper](https://apify.com/laudedignus/app-store-reviews): get the App Store reviews of an iOS app across 50+ countries.
- [Bulk WHOIS Lookup (RDAP)](https://apify.com/laudedignus/domain-rdap-lookup): look up registration, expiry and availability for thousands of domains.
- [Sitemap URL Extractor](https://apify.com/laudedignus/sitemap-url-extractor): list every URL a website declares in its sitemaps.
- [Wayback Machine Scraper](https://apify.com/laudedignus/wayback-snapshots): list every archived capture of a page, folder or domain.
- [RSS Feed Reader](https://apify.com/laudedignus/rss-feed-reader): read RSS and Atom feeds and get only the new items on each run.

# Actor input Schema

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

Website URLs or bare domains, one per line. A bare domain such as example.com is checked over HTTPS.

## `checkHttpRedirect` (type: `boolean`):

Also request the plain HTTP address of each site to see whether it redirects to HTTPS.

## `includeRawHeaders` (type: `boolean`):

Add every response header to the output. Cookie values are never included.

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

How many sites are requested at the same time.

## `timeoutSecs` (type: `integer`):

A site that does not answer within this time is reported as unreachable.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "example.com"
  ],
  "checkHttpRedirect": true,
  "includeRawHeaders": false,
  "maxConcurrency": 10,
  "timeoutSecs": 15
}
```

# 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",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("laudedignus/security-headers-audit").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",
        "example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("laudedignus/security-headers-audit").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",
    "example.com"
  ]
}' |
apify call laudedignus/security-headers-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,laudedignus/security-headers-audit"
        }
    }
}
```

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/JbNGIgugLyngnSihm/builds/NnLKdEzHVKWQyNWFk/openapi.json
