Article

From D to A+: why my CV site left WordPress

A security scan graded my own site D. Here is how I rebuilt it as a static site on Cloudflare Pages: the choices, the safeguards and what it costs.

A struck-through grade D, an arrow, and a grade A+, with the results on securityheaders.com and Mozilla Observatory

A security-headers scan of my own website came back with a D, and Mozilla’s HTTP Observatory gave it an F. Not a great look for someone whose day job is running IT services properly. Since the switch-over the same site, at the same address, scores A+ on securityheaders.com and A+, 150/100, 12 tests out of 12, on Mozilla’s Observatory. This is how it went, and what it taught me.

The use case

The site has two jobs: my professional identity, an online CV in English and French, and the personal side, a few pages about the things I do outside work. It changes a few times a month. It has no shop, no comments, no member area. It needs to be fast, readable on a phone, findable, easy for me to update, and trustworthy, because a CV that fails a basic security check undermines the CV.

It was running on hosted WordPress. WordPress is a fine tool, but on a hosted plan the response headers belong to the host, and the theme injects inline scripts that no strict Content Security Policy, the header that tells a browser which code a page may run, can tolerate. My grade was capped by the platform, not by my content.

Step 1: a quick fix, and its ceiling

The first move was to put Cloudflare in front of WordPress, for free, and add the missing security headers at the edge. That lifted the grades to A on securityheaders.com and B on Observatory. The last step was out of reach: a strict CSP would have broken the WordPress pages themselves. So the question became whether to keep patching or to change the foundations.

Step 2: choosing the foundations

I considered hosting the site myself on the Synology NAS at home. But a static site does not need a server at all, and a home server means an open door to my network, a dependency on my internet line, and maintenance. I chose a static site on Cloudflare Pages, generated with Astro:

  • the pages are plain files generated in advance, so there is no database, no PHP and no login page for anyone to attack;
  • they are served from Cloudflare’s network, close to every visitor, on the free plan;
  • the NAS keeps a useful role: an independent nightly copy of the whole repository at home, scripted and documented, with its restore procedure.

Step 3: building it properly

  • Content separated from layout. The CV is a structured data file, the other pages are plain text with photos. Updating the site never means touching HTML.
  • An editing interface (Sveltia CMS, open source) behind /admin/. Every “Save” becomes a versioned commit in a private GitHub repository, in my name, and Cloudflare publishes the new version about a minute later. Anything can be rolled back.
  • Security by design. A strict Content Security Policy with no inline code, HSTS, isolation headers, no cookies, no trackers, and a single third party: Cloudflare’s anonymous, cookieless visit counter, which Cloudflare adds to the pages itself. YouTube and Instagram appear as cards that load nothing until clicked. The site’s own scripts are two small first-party files; everything works without them.
  • Automated checks on every push. A script serves the built site with its real headers and visits every page, in light and dark mode, at desktop and phone width. It fails on a console error, a request to another domain, an accessibility violation against WCAG 2.2 AA, a page that scrolls sideways, a draft that leaks into the sitemap or the feed, or an e-mail address in the built site.
  • Supply chain hygiene: exact dependency versions, a 14-day delay before accepting any new version of a package, automated vulnerability and malware alerts, and build actions pinned to exact fingerprints.
Every push runs the same checks; a red run tells me something needs fixing before it goes live.

Step 4: locking the door

The admin page is behind Cloudflare Access: only my address can get in, with a one-time code by e-mail or my existing Cloudflare sign-in. Behind that, the editor signs in to GitHub with a key that can touch one repository and nothing else. The repository itself is restricted: read-only permissions for automation, no third-party actions, and the hosting integration limited to that single repository.

Step 5: a site that publishes on schedule

Each page and article carries a status: draft, scheduled or published. A draft is never online, not even its pictures. A scheduled article waits for its date, and a small robot in GitHub Actions, planned to run every hour, flips it to published and commits that change, which republishes the site. In practice GitHub runs it every two to five hours, as I measured over its first two days, so a scheduled article can be a few hours late; the documentation says so, and a button runs it by hand when the exact hour matters.

The admin home page is a status board: counters, the next releases, and one card per page with its real status, its dates and the points to fix before publishing.

The status board: every page and article, its status, its dates and what still needs fixing.

Step 6: migrating and switching over

Every page kept its address, so no existing link breaks. The photos came over with their descriptions for screen readers, the CV PDFs with redirects from their old addresses, and the French CV got its own page, linked to the English one as a translation.

The switch itself was a single DNS change, prepared so that it could be undone in minutes: WordPress stayed untouched in the background. Then the old Cloudflare patches were switched off, and the scanners were run again on the real domain.

WordPressWordPress behind CloudflareStatic site
securityheaders.comDAA+
Mozilla HTTP ObservatoryFBA+ (150/100, 12/12)
Server-side attack surfaceCMS, plugins, loginssamenone
Hosting costpaid planpaid planfree

What it costs, and what I gave up

Hosting, the editor, the admin protection, the robot and the automated checks cost nothing. What remains is the domain name, which moves to Cloudflare at cost price, about 21 dollars a year.

I gave up automatic posting to social networks, a statistics dashboard and drag-and-drop layouts. Articles get plain share links and an RSS feed; visit counts come from Cloudflare’s logs, without a script. For a site that changes a few times a month, that is the right trade.

What I keep from it

Start from the use case, not the tool. Measure before and after, with public scanners anyone can rerun. Keep a way back until the new version has proven itself. And treat a personal site like a small production service: change control, automated checks, least privilege, backups. It is the same craft at a smaller scale, with the same limits: green checks did not stop a review, the day after the switch, from finding 53 problems in this very site. That story is in the review that checked my code against my words, a later article in this series.

Theme: This website. Topics: Security, Web, Side project.