Security posture#
What is configured, why, and what is deliberately not defended against.
Edge configuration, as deployed#
| Setting | Value |
|---|---|
| Minimum TLS version | TLSv1.3_2025 |
| TLS 1.3 only | yes |
| Hybrid post-quantum key exchange | yes |
| HTTP versions | http2and3 |
| IPv6 | yes |
| HSTS max-age | 63072000 seconds |
| Origin can be made public | no |
| Origin access method | cloudfront-oac-sigv4 |
| WAF attached | no |
| Access logging | no |
| Server-Timing exposed | yes |
Content-Security-Policy, as deployed
default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'self'; manifest-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; object-src 'none'; require-trusted-types-for 'script'; upgrade-insecure-requestsPermissions-Policy, as deployed
accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), display-capture=(), document-domain=(), encrypted-media=(), geolocation=(), gyroscope=(), idle-detection=(), magnetometer=(), microphone=(), midi=(), payment=(), publickey-credentials-get=(), screen-wake-lock=(), serial=(), usb=(), xr-spatial-tracking=()
Threat model, honestly#
This is a static documentation website. Being clear about what it is worth attacking prevents both under- and over-engineering.
In scope:
- Defacement via a compromised deploy path. Mitigated by OIDC with no
long-lived credentials, and by roles that only main can hold. A required environment approval for applies and build provenance attestation are designed in but not yet in force while the repository is private; see Identity and access and Supply chain.
- DNS hijacking. Mitigated by DNSSEC, and by the CAA record making
mis-issuance a policy violation for every public CA.
- Domain spoofing in email. Mitigated by the null-MX lockdown.
- Transport interception. Mitigated by TLS 1.3-only, TLD-level HSTS preload,
and a certificate whose issuance is constrained by CAA.
- Supply-chain compromise of the build. Mitigated by having no dependencies
at all in the site build, and by pinning everything third-party that CI runs: Actions to commit digests, downloaded tools to checksums. Sigstore attestation of what was deployed is designed in but not yet in force; see Supply chain.
- Accidental cost blowout. Mitigated by a budget tripwire.
Explicitly out of scope:
- Application-layer attacks. There is no application: no database, no
authentication, no user input, no server-side rendering. SQL injection and XSS have nowhere to land. This is why there is no WAF (ADR-0009).
- DDoS beyond CloudFront's built-in protection. AWS Shield Standard is
included and sufficient. Shield Advanced is $3,000/month.
- A determined attacker with AWS account access. Single-account by design;
the mitigation is that the account holds nothing but this website.
HTTP response headers#
Set at the edge in a CloudFront response headers policy rather than baked into files, so they apply to every response including errors, and so they are reviewable as code.
| Header | Value | Purpose |
|---|---|---|
Content-Security-Policy | default-src 'none' plus narrow grants | Deny by default. Practical only because the site ships no third-party code. |
Strict-Transport-Security | max-age=63072000; includeSubDomains; preload | Belt and braces over the TLD-level preload. |
X-Content-Type-Options | nosniff | Stops MIME sniffing turning a text file into script. |
X-Frame-Options | DENY | Legacy clickjacking defence; frame-ancestors 'none' in the CSP is the modern one. |
Referrer-Policy | strict-origin-when-cross-origin | No path or query leaks to third parties. |
Permissions-Policy | every feature =() | Camera, microphone, geolocation, USB, serial and the rest, all denied. |
Cross-Origin-Opener-Policy | same-origin | Severs the window reference an opener would otherwise hold. |
Cross-Origin-Resource-Policy | same-origin | Stops other origins embedding these resources. |
Cross-Origin-Embedder-Policy | require-corp | Completes cross-origin isolation. |
X-XSS-Protection | 0 | See below. |
X-XSS-Protection: 0 is deliberate#
The legacy XSS auditor this header controlled has been removed from every current browser, and while it existed it introduced its own vulnerabilities — it could be abused to selectively block scripts and turn a page into an information-disclosure oracle.
Explicitly disabling it is the current recommendation. 1; mode=block is cargo cult that scanners still reward. CSP is the actual control.
The CSP includes Trusted Types#
require-trusted-types-for 'script' turns DOM-XSS sinks — innerHTML, insertAdjacentHTML, document.write, eval — into runtime errors rather than vulnerabilities. It shifts XSS prevention from "review every assignment carefully" to "the unsafe operation does not work".
The site's JavaScript is written to comply: every node is built with createElement and every string set via textContent. See site/assets/whoami.js.
Headers that are stripped#
Server, x-amz-server-side-encryption, x-amz-version-id, x-amz-id-2 and x-amz-request-id are removed. None tells a visitor anything useful; all tell an attacker which stack to target.
One exception: removing the origin's Server: AmazonS3 leaves CloudFront free to add its own Server: CloudFront, which a response headers policy cannot remove. That names only the CDN, which the DNS alias, the IP addresses and the certificate already reveal, so it is accepted. The health check and the check block fail if Server names anything else.
Origin isolation#
The S3 bucket is not a website endpoint and is not public:
- All four public-access blocks enabled.
- ACLs disabled entirely (
BucketOwnerEnforced), which removes the whole class
of public-via-ACL misconfiguration.
- Bucket policy grants
s3:GetObjectonly to the CloudFront service principal,
conditioned on AWS:SourceArn matching this exact distribution. Without that condition, any CloudFront distribution in any AWS account could read the bucket.
- A separate statement denies everything when
aws:SecureTransportis false.
The Lambda Function URL uses AWS_IAM authorisation, never NONE. A NONE Function URL is a public HTTPS endpoint that bypasses CloudFront entirely — no security headers, no caching, and directly billable by anyone who finds it.
Identity and access#
No standing IAM users. No standing access keys: the one exception is a temporary, scoped key that removes itself during an account's very first seed run (ADR-0016). CI authenticates with GitHub OIDC and receives short-lived STS credentials. That includes creating the CI roles: a person applies one small OpenTofu seed per account, and every phase after it runs in a workflow (ADR-0014), so no person applies Terraform. Three roles, each with the narrowest trust condition that lets its job work:
- Pull requests get a read-only role with an explicit
Denyon state writes.
CI runs tofu plan -lock=false, so no write is ever needed and the role stays genuinely read-only. A fork PR can never reach a credential that mutates anything. The weekly drift check uses the same role from main, in a job that cannot write to GitHub (ADR-0021).
- Applies require a GitHub environment approval. The apply role's trust
policy only accepts an OIDC subject of repo:<owner>@<owner_id>/<repo>@<repo_id>:environment:prod, and GitHub will not mint such a token until a required reviewer approves. The approval gate is cryptographic rather than advisory. Not yet in force: required reviewers are unavailable for private repositories on GitHub Free, so until the repository is public applies run only when dispatched by hand. See ADR-0006, "Current status".
- Only
maincan hold a role that writes. An environment's subject says
which environment a job named, not which branch it ran on, so any branch whose workflow names environment: prod would receive the apply role. The apply, deploy and bootstrap trust policies therefore also require the token's ref claim to be refs/heads/main, which AWS STS evaluates as its own condition key. The workflows refuse another branch before entering an environment, and the environments are restricted to main in GitHub as a second layer (ADR-0019). In force for all three roles since 25 November 2026, and verified both ways: each role is still assumed from main, and AWS refuses the deploy and bootstrap roles to a branch. Since 25 November all three environments are restricted to main as well, so GitHub now stops a branch's job before AWS is asked. Changing any of this can lock CI out, so it follows a runbook.
- Content deploys use a third, much smaller role, gated on a separate
prod-deploy environment with no required reviewers. It can write the site bucket and create CloudFront invalidations, and nothing else — no UpdateDistribution, no Route 53, no state writes. Splitting it this way means publishing a documentation change does not need a human approval, so the approval on infrastructure changes keeps its meaning instead of becoming a reflex click.
- Privilege escalation is closed by construction. The apply role can create
IAM roles only under the testz-* prefix and only with a permissions boundary attached, and it is explicitly denied any IAM action against the CI roles, the boundary policy, and the OIDC provider. It cannot widen its own privileges. It is also denied writes to the bootstrap and seed layers' state, which its bucket permissions would otherwise reach (since 24 November 2026).
- Roles CI creates are fenced by the boundary: at most their own log
writes, X-Ray traces and invoking the project's own functions. The last is for the hourly DNSSEC probe, whose schedule invokes it through a role scoped to that one function, with confused-deputy conditions on its trust policy. The probe's own role can write its log group and nothing else (ADR-0020; in force since 25 November 2026).
See ADR-0006.
Supply chain#
The site build has zero dependencies — no npm install, no pip install, no lockfile to audit, no transitive CVEs. The Markdown renderer is ~250 lines of standard-library Python in this repository (site/markdown.py).
That is unusual enough to be worth stating plainly: it is the single largest reduction in attack surface in the whole project, and it is what makes default-src 'none' achievable without a fight.
Beyond that:
- Every GitHub Action is pinned to a commit digest, with its version in a
comment, and every tool CI downloads (OpenTofu, TFLint, Trivy, gitleaks, terraform-docs) is checked against a pinned SHA-256 before it runs. A tag is a promise that can be broken: in March 2026 an attacker force-pushed most tags of the Trivy Action, which this repository then referenced by branch, to credential-stealing commits. Trivy now runs as a checksum-verified binary with the checks built into it, so its rules change only when its version does. The versions and checksums are listed in the conventions.
- Workflow permissions are granted per job. Every workflow sets
permissions: {} at the top. Only the jobs that assume an AWS role can mint an OIDC token, and the scanners run in jobs whose token can read the repository and nothing else. No checkout leaves that token in .git/config (persist-credentials: false), so later steps, third-party tools included, cannot read it from disk.
- Both are checked, not remembered.
make pinsruns first in CI and fails
on an Action not pinned to a commit, a download not checked against a checksum, a latest version, a permission granted at workflow level, or a checkout that keeps the token on disk. It tests itself against known-bad input on every run, so it cannot pass by matching nothing.
- Where a checksum comes from. OpenTofu, TFLint and Trivy sign their
checksum files with Sigstore, and those signatures were verified, naming each project's own release workflow, before the checksums were pinned. No signature was found for gitleaks or terraform-docs, so their checksums prove only that the download has not changed since it was pinned. TFLint fetches its AWS ruleset at the version pinned in .tflint.hcl and verifies the ruleset's signature itself.
- Not covered: the GitHub-hosted runner image and what it preinstalls (the
AWS CLI, Python, jq), Python installed by actions/setup-python, and the Ubuntu packages dns-health installs with apt, which apt verifies against Ubuntu's signing keys. These come from the platform that runs CI at all.
- Updates are not automatic yet. Renovate is configured to propose new
digests and versions but has not yet opened a pull request. It cannot compute a checksum, so a version bump fails CI until a person replaces the checksum.
- Terraform providers are pinned with
.terraform.lock.hclcommitted, which
records expected checksums.
- Not yet in force: build provenance. The deploy workflow attests the site
bundle with Sigstore keyless signing, binding it to the workflow and commit that produced it. GitHub does not store attestations for private repositories owned by a user account, so the step is skipped, and says so in the run summary, until the repository is public (ADR-0011).
gitleaksruns in CI and in pre-commit.- The pre-commit hooks are pinned to commits too. They do not run in CI,
but they run third-party code on the machine that commits, so make pins holds them to the same rule. Until November 2026 one hook repository named a tag that did not exist, so the hooks could not be installed at all.
Privacy#
- No analytics, no telemetry, no cookies, no third-party requests. The site
makes exactly one origin request beyond its own assets: /api/whoami, and only if you have JavaScript enabled.
- CloudFront access logs are off by default. Visitor IP addresses are
personal data this site has no reason to retain.
/api/whoamilogs nothing. It reads headers, serialises them, and returns
them.
- Lambda log retention is 14 days, set explicitly because the default is
"never expire".
- **The DNSSEC probe tells three resolvers about this domain, and nothing about
visitors.** It asks Cloudflare, Google and NextDNS each hour whether testz.dev and dev validate, from an AWS address. The names are public; they are third parties all the same, and two of the three must agree before the probe raises or clears an alarm (ADR-0020).
- No webfonts. System fonts mean no external request and no third party
learning who reads this site.
Security contact#
There is deliberately no /.well-known/security.txt. RFC 9116 makes Contact: mandatory, and this domain has no mailbox by design and publishes no other contact channel, so any security.txt would advertise a route that reaches nobody. Scanners and researchers treat a published security.txt as a promise to listen; publishing none is the honest answer.
For the same reason no PGP key is published. If a contact channel is added later, the key would go out via Web Key Directory at /.well-known/openpgpkey/hu/, because Route 53 cannot publish OPENPGPKEY records.