# Domain Security Audit: DNS, SPF, DKIM, DMARC, TLS & Headers (`brimful_cyperus/domain-security-audit`) Actor

Bulk audit domains for DNS, DNSSEC, SPF/DKIM/DMARC/MTA-STS, TLS certificate and HTTP security headers. Score, grade and fixes per domain. No login, no API key.

- **URL**: https://apify.com/brimful_cyperus/domain-security-audit.md
- **Developed by:** [Abdelrhman Fikri](https://apify.com/brimful_cyperus) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 domains audited

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/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

## Domain Security Audit: DNS, SPF, DKIM, DMARC, TLS & Headers

Give it a list of domains and it checks each one for the things that usually get missed: broken or missing email authentication (SPF, DKIM, DMARC, MTA-STS), certificates close to expiry, DNSSEC and CAA gaps, and missing HTTP security headers. You get one row per domain with a score from 0 to 100, a grade, and a short list of what to fix and how.

It reads public DNS records and the domain's own web server, nothing else. No login, no API key, no proxy.

### Who uses it

- **Agencies and IT consultants** checking all client domains before a review or a proposal.
- **Outbound and email teams** confirming SPF, DKIM and DMARC are in order before sending, and catching SPF records that exceed the 10-lookup limit.
- **DevOps and platform teams** running it weekly on company domains to catch an expiring certificate, a dropped DMARC record, or a lost HSTS header.
- **Security and compliance teams** collecting evidence for ISO 27001, SOC 2 or cyber-insurance questionnaires.
- **Due diligence**, comparing the external hygiene of many companies at once.
- **AI agents** calling it through the Apify MCP server to answer "is this domain set up safely for email?"

### What does it check?

| Area | Checks |
|---|---|
| DNS | A/AAAA, NS (single-nameserver risk), SOA, CAA, DNSSEC (DS present and validated) |
| Email | MX and null-MX, SPF (policy, multiple records, `+all`, `?all`, `ptr`, **recursive DNS-lookup count vs. the limit of 10**, broken includes), DMARC (policy, `sp`, `pct`, `rua`/`ruf`), DKIM (18 common selectors + your own), MTA-STS (TXT + policy mode), TLS-RPT, BIMI |
| TLS | Expiry in days, issuer, SAN list, hostname match, chain trust, negotiated TLS version |
| HTTP | HTTP to HTTPS redirect, HSTS (max-age, includeSubDomains, preload), CSP (flags `unsafe-inline`/`unsafe-eval`), `X-Content-Type-Options`, clickjacking protection, Referrer-Policy, Permissions-Policy, version-leaking `Server` / `X-Powered-By`, cookie `Secure`/`HttpOnly` flags, `robots.txt`, `sitemap.xml`, `/.well-known/security.txt` |

Every issue comes back as a finding with a severity (critical, high, medium, low or info), a plain-language message and a suggested fix. The score starts at 100 and drops with each finding, weighted by severity. The grade runs from A to F.

### How to use it

1. Paste your domains (or URLs) into **Domains**, one per line.
2. Choose which checks to run. All four are on by default.
3. Click **Start**. Results appear in the **Output** tab and can be exported as JSON, CSV, Excel or HTML, or read through the API.
4. To monitor continuously, add a **Schedule** (for example weekly) and connect the dataset to Slack, email, Google Sheets or a webhook.

#### Input example

```json
{
  "domains": ["example.com", "https://github.com", "mycompany.io"],
  "checkDns": true,
  "checkEmail": true,
  "checkTls": true,
  "checkHttp": true,
  "dkimSelectors": ["mycompany2024"],
  "concurrency": 25
}
```

### Output example

```json
{
  "domain": "mycompany.io",
  "scannedAt": "2026-12-02T12:00:00.000Z",
  "score": 74,
  "grade": "C",
  "findingCounts": { "critical": 0, "high": 0, "medium": 2, "low": 3, "info": 2 },
  "email": {
    "spf": { "present": true, "policy": "softfail (~all)", "dnsLookups": 8 },
    "dmarc": { "present": true, "policy": "none", "pct": 100, "rua": ["mailto:dmarc@mycompany.io"] },
    "dkim": { "selectorsProbed": 18, "found": [{ "selector": "google", "keyType": "rsa", "approxKeyBits": 2048 }] }
  },
  "tls": { "protocol": "TLSv1.3", "issuer": "Let's Encrypt", "daysUntilExpiry": 61, "hostnameMatch": true },
  "http": { "httpToHttps": true, "hsts": false, "csp": false },
  "findings": [
    { "category": "email", "severity": "medium", "id": "dmarc.p-none", "message": "DMARC policy is p=none (monitoring only).", "fix": "Move to p=quarantine, then p=reject, after reviewing reports." }
  ]
}
```

### How much does it cost?

The Actor uses **pay per event**: you pay **$5 per 1,000 domains audited** (one `domain-audited` event per successfully audited domain) plus a tiny start fee. Domains that don't exist (NXDOMAIN) and invalid inputs are **never charged**. Paid Apify plans get Store discounts. You can set a maximum spend per run and the Actor stops cleanly when it is reached.

| Domains | Approx. cost |
|---|---|
| 10 | $0.05 |
| 100 | $0.50 |
| 1,000 | $5.00 |

### Free plan and large lists

On Apify's **free plan** a run is limited by your account's monthly credit of about $5, which covers roughly **1,000 domains per run**. For bigger lists, split them into batches of up to about 1,000 domains. On paid plans there is no such ceiling, and very large lists (5,000+) can be **sharded into several parallel runs** to finish faster. A single run audits about 1.5 domains per second at the default concurrency of 25, so 5,000 domains take roughly an hour in one run.

### Good to know

- The Actor reads only public DNS and the domain's own web server (plus `mta-sts.<domain>` if MTA-STS is published). It does not port-scan, brute-force or send email.
- DKIM selectors cannot be listed by anyone, so only common selectors and the ones you add are probed. "No DKIM found" means "not found on those selectors".
- DNS is resolved via public DNS-over-HTTPS resolvers (Cloudflare, with Google as fallback) so results are consistent and DNSSEC validation status is available.
- Connections only go to public IP addresses. Private, loopback and link-local addresses are refused, including after redirects.
- The audit looks at the host name you supply (for example `example.com`), not every subdomain.
- This is an external, passive hygiene check. It is not a penetration test and not a substitute for a security review.

### FAQ

**Does it need an API key or login?** No.

**Can I run it on a schedule or call it from code?** Yes. Use Apify Schedules, the Apify API/clients, webhooks, or the Apify MCP server.

**Why is my score lower than my security scanner's?** Scores are weighted by severity and based only on what is externally visible. Every point deducted is listed in `findings`, so you can see and fix the cause.

**Something looks wrong for my domain.** Open an issue on the Actor page with the domain and the finding id (for example `spf.too-many-lookups`) and it will be reviewed.

# Actor input Schema

## `domains` (type: `array`):

Domains or URLs to audit, one per line (for example example.com or https://example.com/path). Only the host name is used. Up to 5,000 per run.

## `checkDns` (type: `boolean`):

A/AAAA, nameservers, SOA, CAA and DNSSEC status.

## `checkEmail` (type: `boolean`):

MX, SPF (with lookup-limit analysis), DMARC, DKIM (common selectors), MTA-STS, TLS-RPT and BIMI.

## `checkTls` (type: `boolean`):

Certificate expiry, issuer, hostname match, chain validity and negotiated TLS version on port 443.

## `checkHttp` (type: `boolean`):

HTTP to HTTPS redirect, HSTS, CSP, clickjacking, MIME-sniffing, referrer policy, information-leaking headers, robots.txt, sitemap and security.txt.

## `dkimSelectors` (type: `array`):

DKIM cannot be enumerated, so common selectors (google, selector1, selector2, default, k1, s1, mail, ...) are probed. Add your own here.

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

Number of domains audited in parallel (default 25, max 50). 25 is a good balance for public DNS-over-HTTPS and target servers; higher values did not run faster in testing.

## `requestTimeoutSecs` (type: `integer`):

Timeout for each DNS-over-HTTPS, TLS or HTTP request.

## Actor input object example

```json
{
  "domains": [
    "example.com",
    "github.com"
  ],
  "checkDns": true,
  "checkEmail": true,
  "checkTls": true,
  "checkHttp": true,
  "dkimSelectors": [],
  "concurrency": 25,
  "requestTimeoutSecs": 8
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "domains": [
        "example.com",
        "github.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("brimful_cyperus/domain-security-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 = { "domains": [
        "example.com",
        "github.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("brimful_cyperus/domain-security-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 '{
  "domains": [
    "example.com",
    "github.com"
  ]
}' |
apify call brimful_cyperus/domain-security-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,brimful_cyperus/domain-security-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/M0dH8OixgcggJnKoS/builds/1dNupeWqVbYoq4leh/openapi.json
