Jackagonz / Writing

My security hardening guide

What I’ve done to secure my accounts, my Mac and this website, and how you can check it.

19 controlsAbout 12 minutes

I’m one person with a laptop, some accounts and this website, so that’s the scale this guide is written at.

The things I actually plan for are ordinary: a password of mine showing up in someone else’s breach, a fake sign-in page, a lost laptop, a company leaking my data, and me doing something on the wrong account. I’m not planning around someone targeting me specifically.

Two ideas shape most of what’s below. First, turn off what I don’t use before worrying about securing it. Second, make the secure option the default, so it doesn’t depend on me remembering to do it every time.

Each step opens to show why I did it, what I did, and how you can check it, either on this site or on your own setup. Everything here is something I’ve actually done.

1Accounts

Most account takeovers don’t come through the password box. They come through password reuse, password resets, recovery emails and old accounts nobody’s watching. So this section covers all of those, not just the password.

01Use a password managerEvery password is generated, unique and stored end to end encrypted.
Why

If I reuse a password and one site gets breached, every account with that password is exposed. The easiest way I’ve found to avoid reuse is to stop making up passwords myself.

What I did

My passwords are in a password manager that syncs end to end encrypted, and it generates new ones for me. I went through its security report and fixed everything it flagged as reused or found in a known leak. For the few things I have to type from memory, I use long passphrases.

Check it yourself

On your own devices: open your password manager’s security report. On a Mac that’s the Passwords app, under Security. Start with anything marked reused or compromised.

Where it stops

The password manager itself becomes the most valuable thing to break into, so its own unlock is the one I protect most.

02Use passkeysPasskeys on the accounts that offer them.
Why

A code from an authenticator app helps, but a convincing fake sign-in page can still ask for it and use it right away. A passkey only works on the real site, so a fake page can’t use it.

What I did

I’ve set up passkeys on accounts that offer them, including my hosting account and an email account. When a service adds passkey support, I switch to it.

Check it yourself

On your own accounts: look in each service’s security settings for passkeys. Start with your email, since whoever controls it can reset most of your other passwords.

Where it stops

Some services still don’t support passkeys and fall back to text messages. Where I can’t remove the weaker option, I make sure it isn’t the only one.

03Lock down account recoveryBackup codes, and a recovery address that isn’t with the same provider.
Why

Account recovery is built to let someone in without the password. If it’s weak, a strong password doesn’t help much.

What I did

My primary email account has backup codes set up. Its recovery address is with a different provider, so getting locked out of one can’t take the other down with it.

Check it yourself

On your own accounts: read your email provider’s recovery settings and look for anything out of date, like an old phone number, an address you don’t check anymore, or a security question someone could answer from your social media.

04Delete accounts I don’t useAn old account still has old passwords and old data, and I won’t notice if it’s taken over.
Why

Every account I close is one less thing to protect.

What I did

I exported what I wanted from an old cloud account, then deleted its channels, emptied its mail, files and photos, and turned off its activity history. I’m still working through closing the rest of it, along with a hosting account tied to it. It’s taken weeks, because some services make leaving a lot harder than signing up.

Check it yourself

On your own setup: search your password manager for sites you haven’t signed into in a year. Those are the ones to actually delete.

05Check which account I’m signed intoA mistake I’ve made, and the habit I built from it.
Why

An early version of this site got deployed into the wrong hosting account. The login that happened to be active worked fine, so nobody checked whose it was. Nothing broke. It was just in the wrong place.

What I did

Before I create, deploy or delete anything, I confirm which account I’m signed into, not just that the login works. Deploys to this site start by checking the signed-in account.

Check it yourself

Most command-line tools will tell you who they think you are. These are three I check before anything I can’t undo:

gh auth status
git config user.email
wrangler whoami

2My Mac

My laptop can get into everything above, so I set it up assuming it could get lost, stolen or run something it shouldn’t. None of this needs extra software. It’s mostly settings macOS already has.

06Turn on disk encryptionIf the laptop is lost, the data on it stays unreadable.
Why

Without full-disk encryption, anyone with the laptop can read the drive without my password.

What I did

FileVault is on. System Integrity Protection, which stops even admin-level software from changing core system files, is still enabled.

Check it yourself

On your own Mac:

fdesetup status
csrutil status
07Use a standard account day to dayMy everyday account isn’t an administrator.
Why

Anything I run gets my account’s permissions. If I’m an admin, so is a bad installer or script I run by mistake. On a standard account, system changes stop and ask for a separate admin password.

What I did

My daily account is a standard account. There’s a separate admin account I only use when I need it.

Check it yourself

On your own Mac, this prints admin only if your current account is an administrator:

id -Gn | tr ' ' '\n' | grep -x admin
08Turn on automatic updatesSecurity updates install without waiting on me.
Why

Most attacks use bugs that already have a fix. What matters is how quickly the fix gets installed, so I don’t leave that up to me.

What I did

macOS downloads and installs updates, security responses and system data files automatically.

Check it yourself

On your own Mac, each of these should print 1:

for k in AutomaticDownload AutomaticallyInstallMacOSUpdates CriticalUpdateInstall; do
  defaults read /Library/Preferences/com.apple.SoftwareUpdate $k
done
Where it stops

This covers macOS. Apps from other places update on their own schedules, which is one reason I keep my app list short.

09Turn on the firewallMy laptop doesn’t accept incoming connections.
Why

On shared Wi-Fi, other devices can try to connect to mine. I don’t run anything other people need to reach, so there’s no reason to let them.

What I did

The built-in firewall is on and set to block all incoming connections except the few macOS needs.

Check it yourself

On your own Mac:

/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate

State 1 means it’s on. State 2 means it’s on and blocking everything that isn’t essential.

10Back up off the machine, and test the restoreEncrypted copies somewhere else, and proof they actually restore.
Why

Ransomware, a dead drive or deleting the wrong folder all end the same way if there’s no copy somewhere else that actually works.

What I did

Every night my code and notes are bundled, checked as they’re written, and copied into end to end encrypted cloud storage. I also restored one of those bundles into an empty folder to make sure it came back complete.

Check it yourself

On your own setup: pick one important file and restore it from your backup into a new folder.

Where it stops

These backups cover my committed work, not the whole disk. I know exactly what they leave out, and I’d rather have that than a full backup I’ve never restored.

3This website

You can check everything in this section yourself. This site is a set of static files on a hosting provider. There’s no server code of mine, no database, no login and no form. That was the biggest security decision, and most of what follows keeps it that simple.

What the browser is told

11No forms, logins or databaseThe site doesn’t accept any input.
Why

Most website break-ins go through something that accepts input, like a login, a comment box, a contact form or a plugin. This site doesn’t have any of those.

What I did

The site is plain HTML and CSS, plus a small script that only handles things like the menu and this checklist. Contact is an email link. There’s no build process pulling in hundreds of packages.

Check it yourself
curl -sI -X POST https://jackagonz.com/ | head -1

It answers 405 Method Not Allowed, because nothing on the server accepts a submission.

12HTTPS onlyOld TLS versions are refused, and browsers remember to skip plain HTTP.
Why

HTTPS stops anyone between you and the site from reading or changing the page. But when you type jackagonz.com, your browser tries plain HTTP first and gets redirected. On an untrusted Wi-Fi network, someone can catch that first plain request and show you a fake page. HSTS tells your browser to skip plain HTTP for this site for a year after your first visit, so there’s no plain request to catch.

What I did

Plain HTTP redirects to HTTPS, and TLS 1.0 and 1.1 are refused. HSTS is set for a year and covers every subdomain.

Check it yourself
curl -sI https://jackagonz.com/ | grep -i strict-transport
openssl s_client -connect jackagonz.com:443 -tls1_1 </dev/null

The second command should fail to connect.

Where it stops

HSTS only helps after your first visit. Browsers also ship a built-in list of sites that are HTTPS-only from the very first visit. I haven’t added this site to it, because it’s run by a company I’ve stopped using and it’s slow to undo.

13A strict Content Security PolicyThe browser is told to load nothing except files from this site.
Why

A Content Security Policy is a list of places a page is allowed to load things from. If someone managed to inject a script, the policy stops it from loading anything or sending data anywhere else.

What I did

The policy starts with default-src 'none' and only allows this site for scripts, styles, images and fonts. There’s no unsafe-inline. The one inline block, structured data on the home page, is allowed by its exact hash, and a test fails if that hash ever goes out of date.

Check it yourself
curl -sI https://jackagonz.com/ | grep -i content-security-policy
14Turn off browser features the site doesn’t useCamera, microphone, location, payments and more are blocked.
Why

If the site can’t ask for your camera or microphone at all, nobody can trick you into allowing it here.

What I did

A Permissions-Policy blocks every browser feature the site doesn’t need. Other headers stop other sites from embedding this one, stop browsers guessing file types, and keep this page separate from windows it opens. I also removed the host’s default header that let other sites’ scripts read files from this one.

Check it yourself
curl -sI https://jackagonz.com/ | grep -iE 'permissions-policy|x-content-type|cross-origin|access-control'

There shouldn’t be an access-control-allow-origin line.

15Stop the host from changing the pageNo scripts added by the hosting provider, checked against the files I upload.
Why

Hosting providers can add things to your pages on the way out, like analytics, bot checks or email scrambling. That’s code I didn’t write running on my site, and it would break the security policy anyway.

What I did

Every page is served with no-transform. I turned off the host features that add scripts, including on the error page, where one was still getting added. After each release I compare the live pages to the files I uploaded.

Check it yourself
curl -s https://jackagonz.com/ | grep -ciE 'cdn-cgi|beacon|rocket'

It should print 0.

What the domain says about itself

16DNSSEC and CAASigned DNS answers, and a short list of who can issue certificates for the domain.
Why

DNS is how your browser finds this site, and normally its answers aren’t signed. DNSSEC lets resolvers that check reject forged answers. A CAA record limits which certificate authorities can issue certificates for the domain.

What I did

DNSSEC is on, with the signing record published at the registry. CAA only allows the certificate authorities my host actually uses.

Check it yourself
dig +dnssec jackagonz.com @1.1.1.1 | grep flags
dig +short CAA jackagonz.com

An ad in the flags means the answer was verified.

17Authenticate the domain’s emailiCloud mail, with DNS records that help receiving servers check the sender.
Why

A From address can be faked. SPF and DKIM let receiving servers check whether a message is authorized by the domain, and DMARC tells them what to do when authentication does not align with the From domain.

What I did

The domain receives mail through iCloud. Its SPF record authorizes iCloud, sig1._domainkey points to iCloud’s DKIM service, and DMARC is set to reject with strict alignment. The outbound SPF, DKIM and DMARC test is still pending.

Check it yourself
dig +short MX jackagonz.com
dig +short TXT jackagonz.com
dig +short CNAME sig1._domainkey.jackagonz.com
dig +short TXT _dmarc.jackagonz.com

These records show the configuration. They do not prove that a sent message passes SPF, DKIM and DMARC.

18Publish a security.txtA standard file that says how to report a security problem.
Why

If someone finds a problem with the site, I want it to be easy for them to tell me. security.txt is the standard place to look.

What I did

The file lists how to contact me, when it expires, and a link back to this guide. It expires within a year, so I have to come back and confirm it’s still right.

Check it yourself
curl -s https://jackagonz.com/.well-known/security.txt

Keeping it that way

19Test before every releaseAutomated checks for everything this section claims.
Why

Security settings can break quietly. An out-of-date hash, a font from another site or a draft in the wrong folder won’t look broken. They just stop protecting anything.

What I did

Before each release, a test suite checks the policy hash, fails on anything loaded from another site, checks for cookies and browser storage in a real browser, and makes sure unpublished drafts stay out of the folder that gets deployed. My local preview server only answers on my own machine.

Check it yourself

You can’t see the tests, but you can see the result. Open your browser’s developer tools, go to the Network tab, and reload. Every request goes to this site.

4What this doesn’t cover

This is a personal setup and a static website. It isn’t advice for a company network or a site that takes payments, and it doesn’t certify anything. It also doesn’t cover my hosting provider’s own security, which I rely on but can’t inspect.

If something here stops being accurate, I’ll update the page. If you find a problem with the site itself, the security contact is the fastest way to reach me.

There’s a companion guide on privacy. This one is about keeping people out. That one is about what I share in the first place.