# Security Headers & SSL Certificate Audit (Bulk, A-F Grade) (`extezzu/security-headers-ssl-audit`) Actor

Bulk-check websites for SSL certificate expiry, HTTPS redirect, HSTS, CSP, X-Frame-Options, insecure cookies and server version leaks. Every site gets a 0-100 score and an A-F grade. Pay only per site checked.

- **URL**: https://apify.com/extezzu/security-headers-ssl-audit.md
- **Developed by:** [Dmytro Volodymyrovych](https://apify.com/extezzu) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 site checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-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 & SSL Certificate Audit: Bulk-Check Domains, Graded A–F

Check hundreds of domains in one run for **SSL/TLS certificate expiry**, **invalid certificates**, a missing **HTTP → HTTPS redirect** and missing **security headers** (HSTS, Content-Security-Policy, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, clickjacking protection). Every site gets a **0–100 score** and an **A–F grade**, so you can sort a whole portfolio by risk in seconds.

The check is **passive**: one plain HTTP request, one HTTPS request and one TLS handshake per site, exactly what a browser does. No scanning, no fuzzing, no login attempts.

### What it checks

| Check | Issue code | Severity |
|---|---|---|
| Certificate expired / expiring within N days | `certificate-expired`, `certificate-expires-soon` | error / warning |
| Certificate not trusted (self-signed, wrong host, chain) | `certificate-invalid` | error |
| Old TLS protocol (1.0/1.1) | `old-tls-protocol` | warning |
| HTTP does not redirect to HTTPS | `no-http-to-https-redirect` | error |
| No HSTS, or HSTS max-age under 180 days | `missing-hsts`, `weak-hsts-max-age` | error / warning |
| No Content-Security-Policy | `missing-csp` | warning |
| No X-Frame-Options and no CSP `frame-ancestors` | `clickjacking-unprotected` | warning |
| No X-Content-Type-Options / Referrer-Policy | `missing-x-content-type-options`, `missing-referrer-policy` | warning |
| No Permissions-Policy | `missing-permissions-policy` | info |
| Cookies without `Secure` / `SameSite` | `cookie-without-secure`, `cookie-without-samesite` | warning / info |
| Server version or `X-Powered-By` leaked | `server-version-disclosed`, `x-powered-by-disclosed` | info |

### Use cases

- **SSL certificate expiry monitoring**: schedule it daily and alert when `certDaysLeft` drops below your threshold.
- **Agencies and freelancers**: audit every client site at once and attach the A–F report to a proposal or maintenance plan.
- **Security questionnaires and compliance prep** (SOC 2, ISO 27001, vendor reviews): prove headers and TLS are in place across all domains.
- **M\&A and vendor due diligence**: quick external hygiene check of a list of domains.
- **Lead generation for web/security services**: find sites with weak grades (only contact businesses in line with local law).

Only audit websites you own or have permission to test.

### Input example

```json
{
  "sites": ["example.com", "https://example.org/login"],
  "certWarnDays": 21,
  "concurrency": 5,
  "onlyReportProblems": false
}
```

### Output example (one row per site)

```json
{
  "host": "example.com",
  "grade": "C",
  "score": 62,
  "severity": "warning",
  "certDaysLeft": 17,
  "httpRedirectsToHttps": true,
  "httpsStatus": 200,
  "tls": { "authorized": true, "protocol": "TLSv1.3", "issuer": "Let's Encrypt", "validTo": "2026-12-09T12:00:00.000Z" },
  "headers": { "strict-transport-security": "max-age=31536000", "content-security-policy": null, "x-frame-options": "SAMEORIGIN" },
  "issues": ["certificate-expires-soon", "missing-csp", "missing-referrer-policy", "missing-permissions-policy"]
}
```

A run summary (grade distribution and counts per issue code) is saved to the key-value store as `OUTPUT`. Unreachable sites get `grade: "unreachable"`.

### Pricing

Pay per event: you pay only for **sites checked**, plus a tiny start fee. Invalid inputs (malformed or private/local addresses) are skipped and not charged. No proxies are needed, so runs are cheap and fast.

### Scheduling and integrations

Use Apify **Schedules** for daily monitoring, then send results to Slack, email, Google Sheets, Zapier, Make or a webhook with Apify integrations, or pull them via the API.

### FAQ

**Is this a vulnerability scanner?** No. It reads only what any visitor's browser receives. It does not probe paths, ports or forms.

**Why is my grade low even though the site is fine?** Grades reflect hardening best practice (OWASP Secure Headers). Missing CSP or HSTS lowers the score even if nothing is broken today.

**Can I audit internal hosts?** No. Private, loopback and link-local addresses are blocked.

# Actor input Schema

## `sites` (type: `array`):

Domains (example.com) or full URLs to audit. Only audit sites you own or have permission to test.

## `certWarnDays` (type: `integer`):

Flags certificates expiring sooner than this.

## `concurrency` (type: `integer`):

Sites checked in parallel (1-10).

## `onlyReportProblems` (type: `boolean`):

Skip rows for sites with no warnings or errors (they are still checked and billed).

## Actor input object example

```json
{
  "sites": [
    "apify.com",
    "crawlee.dev"
  ],
  "certWarnDays": 21,
  "concurrency": 5,
  "onlyReportProblems": false
}
```

# Actor output Schema

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

One row per audited site, in the default dataset.

## `summary` (type: `string`):

Totals and counts for the run (OUTPUT record in the key-value store).

# 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 = {
    "sites": [
        "apify.com",
        "crawlee.dev"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("extezzu/security-headers-ssl-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 = { "sites": [
        "apify.com",
        "crawlee.dev",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("extezzu/security-headers-ssl-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 '{
  "sites": [
    "apify.com",
    "crawlee.dev"
  ]
}' |
apify call extezzu/security-headers-ssl-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,extezzu/security-headers-ssl-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/h4iLkQxfdSkD0424c/builds/ni6dauB7Q76m92Aem/openapi.json
