← All projects

SecurityNetworking & infrastructureGRCP-02

Hardening email, DNS, and web security for a small advisory firm

Taking a regulated firm's domain from a D on security headers, with no DMARC and no DNSSEC, to 100% on internet.nl and A+ on Mozilla Observatory in two days, with every decision logged in the risk register.

WorkOngoing13 min read

At a glance

Role
Project lead and implementer
Timeline
Two days, then a staged enforcement plan
Scope
DNS, email authentication, public website
Result
100% internet.nl · A+ Observatory · A+ Security Headers

Overview

In two days I took a small advisory firm’s public domain from a D on security headers and roughly 70% on internet.nl, with no DMARC and no DNSSEC, to 100% on internet.nl, A+ on Mozilla HTTP Observatory, and A+ on securityheaders.com. The firm works in a regulated industry, handles sensitive client information, and maps its controls to the HIPAA Security Rule.

The scope covered the company domain’s DNS, email authentication, and public website. I led the work, made each change myself in Cloudflare, Microsoft 365, and the web host, and recorded every finding, decision, and accepted trade-off in the company’s risk register.

The work ended with a rebuilt website, a strict Content-Security-Policy, a clean DNS zone, a staged path to DMARC enforcement, and a documented position on the risks we chose to accept.

Starting point

The initial audit found the domain spoofable, unsigned, and carrying years of DNS drift. Email used Microsoft 365, with a third-party filtering gateway in front for inbound mail. DNS ran through Cloudflare, and the website was WordPress on shared hosting.

Area What I found
Email authentication SPF was correct, but there was no DMARC record, so anyone could send mail that appeared to come from the domain. DKIM was on, but both signing keys were 1024-bit and hadn’t been rotated in seven years.
DNS integrity No DNSSEC and no CAA records, so DNS answers could be spoofed and any certificate authority could issue certificates for the domain.
DNS hygiene About 15 records were set to Cloudflare’s proxy mode. That silently broke Outlook Autodiscover, device-enrollment discovery, and DKIM for a third-party sending service. The zone also held records for retired hosts, an old phone system, and a malformed certificate-validation entry.
Website D on securityheaders.com. There was no HSTS, the server version was exposed, and the only Content-Security-Policy was a placeholder. Fonts and images loaded from the original developer’s domain and the host’s temporary build domain.
Certificates A certificate for a client-facing platform was due to expire within nine days, with no clear owner for renewal.

Mozilla HTTP Observatory before the work: B-plus, 80 out of 100, 11 of 12 tests passed. The Content Security Policy test lost 20 points for unsafe-inline and missing script and object restrictions. Figure 1. Before: Mozilla Observatory B+ (80/100). The CSP cost 20 points, and it couldn’t be fixed while the site depended on inline scripts.

Approach

I fixed the foundation before adding controls, and I tested every risky change before enforcing it.

  1. Baseline from live data. I queried public DNS, certificate-transparency logs, and scanners rather than relying on what the dashboards claimed was configured.
  2. Clean up before hardening. I repaired broken records and removed stale ones first, so new controls sat on a correct zone.
  3. Harden in small, reversible steps. I made one change at a time, verified it live, and kept a rollback path ready.
  4. Test before enforcing. The Content-Security-Policy ran in report-only mode, and DMARC started at monitoring only. Enforcement came after the data showed nothing legitimate would break.
  5. Document as I went. Each finding became a risk-register entry with inherent and residual scores, an owner, a target date, and a HIPAA Security Rule citation. The register was updated the same day each change landed.

DNS cleanup

The most impactful fix of the project was undoing a misconfiguration nobody knew about. In Cloudflare, a CNAME record set to “proxied” answers with Cloudflare’s own IP addresses instead of pointing to its target. Service-discovery records for Microsoft 365, the device-enrollment records, and a sending service’s DKIM and verification records had all been proxied. Each looked correct in the dashboard but returned the wrong answer to anyone who looked it up.

  • Found it by resolving each record through public DNS and comparing the answer to its intended target.
  • Fixed it by setting every non-web record to DNS-only. A Microsoft 365 domain health check then came back clean.
  • Set a standing rule: only website hostnames are proxied, and everything else stays DNS-only.

I also removed records for retired servers, a decommissioned phone system, a legacy Microsoft sign-in record, an orphaned certificate-validation entry, and unexplained verification tokens. I exported the zone before each round of changes as a rollback copy, and kept tokens with a plausible live purpose until their owner could be confirmed.

Email authentication

The domain now has all three authentication controls in place, with a dated plan to move DMARC from monitoring to rejection.

  • SPF: already strict (-all, Microsoft 365 only). I confirmed no other system sends as the root domain before leaving it unchanged.
  • DKIM: signing was enabled, but both keys were 1024-bit and seven years old. Microsoft rotates only the inactive key, so the upgrade to 2048-bit takes two rotations. I ran the first, confirmed the new key published in DNS, and scheduled the second.
  • DMARC: I published a monitoring policy (p=none) with aggregate reporting. My first version sent reports to a privileged admin mailbox, which needlessly exposes an admin identity to outside email, so I moved reporting to Cloudflare’s DMARC Management service instead. After two to three weeks of reports confirm every legitimate sender passes, the policy moves to quarantine, then reject.
  • TLS-RPT: a reporting record so other mail servers can flag problems establishing encrypted delivery, with MTA-STS as a follow-up.

Two PowerShell outputs side by side. Left, before: both DKIM selectors are 1024-bit, last rotated in August 2019. Right, after the first rotation: selector 2 is now 2048-bit, with selector 1 next in line. Figure 2. DKIM before (left: two 1024-bit keys, last rotated in 2019) and after the first rotation (right: selector 2 now 2048-bit, selector 1 scheduled next).

DNS integrity: DNSSEC and CAA

The zone is now cryptographically signed, and only the certificate authorities the firm actually uses can issue certificates for it.

  • DNSSEC: I enabled signing in Cloudflare and published the DS record at the registrar, which is a separate company. Google’s public resolver returned authenticated answers within minutes, and Cloudflare confirmed the chain. I recorded one operating rule: never change nameservers without first removing the DS record, or the domain stops resolving.
  • CAA: I didn’t guess which certificate authorities were in use. I read the domain’s certificate-transparency history, which showed three: one for the web host’s certificate, one for Cloudflare’s edge certificate, and one for a client platform. CAA now allows those three and sends violation reports to a security mailbox.
  • security.txt: published, so researchers who find a vulnerability know where to report it.

Cloudflare DNSSEC panel confirming the domain is protected with DNSSEC. Figure 3. DNSSEC enabled and confirmed in Cloudflare after the DS record was published at the registrar.

Website hardening

All web controls live at the Cloudflare edge rather than in the site itself. That paid off when the site was rebuilt mid-project: every protection carried over unchanged.

  • Transport: SSL mode Full (strict), so Cloudflare verifies the origin’s certificate. HTTP redirects to HTTPS, and the minimum TLS version is 1.3. HSTS is set to 12 months on the main site only. I deliberately left it off subdomains, so a lapsed certificate on a separate client platform couldn’t lock users out.
  • Security headers: one Cloudflare response-header rule sets X-Content-Type-Options, X-Frame-Options, Referrer-Policy, and Permissions-Policy, and strips the header that revealed the server’s software version.
  • Content-Security-Policy: I built the policy from what the site actually loaded and ran it in report-only mode first, then checked every page for violations before enforcing it. That testing surfaced the outside-domain font and image dependencies, which I removed.
  • Platform rebuild: the WordPress/Elementor site relied on dozens of inline scripts, so its policy had to allow 'unsafe-inline', the main remaining weakness. The firm replaced it with a static site. That removed WordPress’s login and XML-RPC attack surface and its plugin-patching burden, and let me enforce a strict policy with no 'unsafe-inline', no framing, and no plugins. I verified all nine pages render correctly under it.
  • New risk logged: the rebuild added a contact-form handler, which went into the risk register as a new item with its own follow-ups.

internet.nl cipher suite findings: the web server accepted several TLS 1.2 CBC-mode cipher suites rated insufficient or phase out. Figure 4. TLS 1.2 CBC cipher suites rated “insufficient” and “phase out”. internet.nl also flagged SHA-1 in the TLS 1.2 key exchange.

internet.nl website test midway through the work: 95 percent, with DNSSEC now passing and the HTTPS connection and recommended security options still flagged. Figure 5. Midway: with DNSSEC signed, internet.nl reached 95%. The remaining HTTPS findings were all TLS 1.2 options, which led to the decision below.

Decisions and trade-offs

Not every finding should be fixed. Three decisions show how I weighed security against cost, compatibility, and business need, and each is recorded in the risk register with its rationale.

Decision Trade-off Why
Minimum TLS 1.3 Devices without TLS 1.3 (roughly Android 9 and older, and macOS Safari before about 2019) can no longer load the site. Restricting TLS 1.2’s weak ciphers required a paid Cloudflare add-on. TLS 1.2 was about 3.5% of encrypted traffic, mostly bots, so disabling it removed the weak-cipher and SHA-1 findings at no cost. Reverting is a single setting.
Keep the email filtering gateway (accepted risk) internet.nl’s email test scores 63%, because the gateway’s mail servers lack IPv6, DNSSEC, and DANE, and still allow legacy ciphers. The gateway provides content security (spam, phishing, malware) and gives the firm granular control to allow, block, or release specific senders and messages. Phishing is the most common real-world attack, while the transport gaps mainly matter against an attacker who can intercept traffic between mail servers, and mail is still encrypted. Moving mail directly to Microsoft 365, which supports inbound DANE with DNSSEC, is logged for re-evaluation.
Rebuild the website Real effort for a marketing site that already scored A+ on securityheaders.com and 100% on internet.nl. The remaining CSP weakness came from the platform itself and couldn’t be configured away. The rebuild also removed a recurring patching burden and an entire class of WordPress attacks.

Cloudflare traffic served over TLS in the last 24 hours: about 1.3 thousand requests without TLS, 169 over TLS 1.2, and 4.55 thousand over TLS 1.3. Figure 6. The data behind the TLS 1.3 decision: 169 TLS 1.2 requests against 4,550 over TLS 1.3 in 24 hours, about 3.5% of encrypted traffic. (Unencrypted requests are redirected to HTTPS.)

This site is hosted differently, and the same setting doesn’t reach it. Where a control applies depends on how the traffic is routed, which is why I verify changes from the outside.

Results

Every website score now sits at the top of its scale. On email, the one gap the firm controls, DMARC enforcement, is on a dated plan.

Check Before After
securityheaders.com D A+
internet.nl website test about 70% (first scan) 100%
Mozilla HTTP Observatory B+ (80/100, 11/12 tests) A+ (130/100, 12/12 tests)
Qualys SSL Labs not tested A on every edge address
Blocklists (Sucuri SiteCheck) not tested Clean on all 9
DMARC none Published with reporting; enforcement scheduled
DKIM keys 1024-bit, 7 years old 2048-bit rotation under way
DNSSEC / CAA none / none Signed and validated / limited to 3 authorities
Broken DNS records about 15 0 (Microsoft 365 domain health: Healthy)
Inline scripts on site 63 on the homepage 0 on every page
Content-Security-Policy placeholder only Strict, enforced, no 'unsafe-inline'

internet.nl website test after the work: 100 percent, with IPv6, DNSSEC, HTTPS, and RPKI all passing, and a note that the domain will be added to the Hall of Fame. Figure 7. After: internet.nl website test at 100%.

Security Headers report after the work: grade A-plus, with Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, and Permissions-Policy all present. Figure 8. After: securityheaders.com A+, up from a D, with all six recommended headers present.

Mozilla HTTP Observatory after the work: A-plus, 130 out of 100, 12 of 12 tests passed. Figure 9. After: Mozilla Observatory A+ (130/100, 12/12 tests passed).

Qualys SSL Labs report showing grade A on all four edge server addresses. Figure 10. Qualys SSL Labs: A on every edge address, TLS 1.3 only.

Sucuri SiteCheck blocklist status: domain clean by Google Safe Browsing, McAfee, Sucuri Labs, ESET, PhishTank, Yandex, and Opera. Figure 11. Sucuri SiteCheck: not listed on any of the nine blocklists checked.

The internet.nl email test sits at 63%. Most of its failures come from the filtering gateway’s own servers, an accepted and documented trade-off (see Decisions and trade-offs).

internet.nl email test at 63 percent: IPv6, DNSSEC on the mail servers, DMARC, and STARTTLS and DANE flagged; RPKI passing. Figure 12. internet.nl email test at 63%. The flagged mail-server items belong to the filtering gateway; DMARC clears once enforcement starts.

Governance: risk register and HIPAA mapping

The technical work fed directly into the firm’s GRC workbook, which serves as its risk analysis and risk management record under the HIPAA Security Rule (45 CFR 164.308(a)(1)).

  • 13 risks added to the living risk register, each with likelihood × impact scored before and after mitigation, an owner, a status, a target date, and the specific Security Rule citation it supports. By the end of the project, six were closed, one was formally accepted with written rationale, and the other six had owners and dated next steps.
  • Accepted risks carry their reasoning. The TLS 1.3 decision and the email-gateway trade-off name the alternative and the condition that would trigger revisiting them, so a future reviewer can see why, not just what.
  • The control mapping was updated so the work shows up as evidence for Protection from Malicious Software (164.308(a)(5)(ii)(B)), Integrity (164.312(c)(1)), and Transmission Security (164.312(e)).
  • Evidence was captured for the audit file: scanner reports, zone exports before and after, DNSSEC validation, and configuration screenshots.

What’s next

Remaining work is tracked in the register with target dates: completing the second DKIM rotation, moving DMARC to quarantine and then reject, closing out the follow-up items logged during the project, and deploying MTA-STS.

Lessons learned

  • Dashboards can look right and still be wrong. The proxied records looked fine in Cloudflare, and only querying public DNS showed they were broken. Verify from the outside.
  • Test mode exists for a reason. Running the CSP in report-only mode caught dependencies that would have broken the live site. The same logic drives DMARC’s monitoring phase.
  • Put controls where they outlive the platform. Because headers, TLS, and the CSP lived at the CDN edge, the site rebuild didn’t cost a single protection.
  • A score is a tool, not the goal. The email test’s 63% reflects a deliberate choice to keep content filtering. Some of the most important findings from an audit never appear on a scorecard at all.
  • Write the “why” down while it’s fresh. Recording rationale in the risk register as each decision was made turned the work into audit evidence, not a memory.

Tools and skills

Category Used
Platforms Cloudflare (DNS, DNSSEC, SSL/TLS, response-header rules, WAF, DMARC Management, security.txt), Microsoft 365 / Exchange Online (DKIM via PowerShell, domain health), email filtering gateway, domain registrar and web host
Testing and verification internet.nl, Mozilla HTTP Observatory, securityheaders.com, Qualys SSL Labs, Google CSP Evaluator, Sucuri SiteCheck, crt.sh certificate-transparency logs, DNS-over-HTTPS queries, browser developer tools
Standards SPF, DKIM, DMARC, TLS-RPT, DNSSEC, CAA, HSTS, Content-Security-Policy, TLS 1.3, security.txt (RFC 9116)
GRC Risk register with inherent and residual scoring, accepted-risk documentation, HIPAA Security Rule control mapping, evidence collection

Company, domain, vendor accounts, IP addresses, and staff details are withheld. Published with the employer’s permission.