SR-INFRA-008 — Public Web Security Baseline: System Requirements

By Engineering Team•October 23, 2026•3 min read
Metadata Details
System Name Public web security baseline
Document ID SR-INFRA-008
Author Engineering Team
Status Draft / Implementation

Traces back to BRD-INFRA-008. Implements workspace rules 10 and 11. Drift and adopting existing settings are in SR-INFRA-009 SR-NF-05 and this document’s SR-NF-02; validation before merge in SR-INFRA-001 SR-NF-03; least privilege in SR-INFRA-006; placeholders in published text in SR-INFRA-007 SR-F-08. Requirement IDs repeat across SRs; cite them with the document ID (e.g. SR-INFRA-008 SR-F-02).


1. Functional System Requirements

ID Description Traceability (BRD)
SR-F-01 (Strict TLS) The zone setting ssl is strict, so the edge validates the origin certificate and connections are encrypted end to end. BR-1.1
SR-F-02 (HTTPS Redirect and Rewrites) The zone settings always_use_https and automatic_https_rewrites are on, so plain HTTP requests are redirected and mixed-content links are upgraded at the edge. BR-1.1
SR-F-03 (Minimum TLS Version) The zone setting min_tls_version is 1.2, which refuses TLS 1.0 and 1.1. BR-1.1
SR-F-04 (HSTS, Staged) HSTS is set through the security_header zone setting with strict_transport_security enabled and nosniff on. max_age is the variable hsts_max_age_seconds, default 86400 seconds, validated between 0 and 31536000. include_subdomains and preload stay off. max_age is raised in steps only after the site and its www host are confirmed HTTPS-only. BR-1.1, BR-1.6
SR-F-05 (Managed Ruleset) Cloudflare’s free managed ruleset, on by default on every free zone, is relied on and not declared again in code; it is checked in the dashboard after a zone is created. The OWASP core ruleset needs a paid plan, so documents describe the free baseline as managed protection against known high-impact vulnerabilities, never as OWASP coverage. BR-1.2
SR-F-06 (Custom Rules) A cloudflare_ruleset in phase http_request_firewall_custom holds two rules: block every method other than GET and HEAD, and block common exploit probes. BR-1.2, BR-1.5
SR-F-07 (Rate Limiting) The zone’s one free rate-limit rule, a cloudflare_ruleset in phase http_ratelimit over the whole zone (expression true), blocks a client sending more than rate_limit_requests_per_10_seconds requests (default 50) in a 10-second period, for 10 seconds: the only period and block the free plan accepts. Clients are counted by source IP address and edge location. Each zone has its own free quota of one rate-limit rule and five custom rules; two custom rules are used (SR-F-06). BR-1.3
SR-F-08 (Placement) Encryption settings are declared in tls.tf, the custom and rate-limit rulesets in waf.tf and the threat settings in security.tf, in the site’s shared module deploy/modules/site/, which both environment roots call; each root is applied by the site’s infrastructure workflow. Account-level items are declared in <bootstrap-repo>, never in a site module. BR-1.4
SR-F-09 (Provider Currency) New zone settings and rule options arrive through provider upgrades. Every root module of the project is upgraded to the same provider version in one pull request. BR-1.2, BR-1.4
SR-F-10 (Direct Upload Only) Every Pages project is direct upload, with no Git connection and no preview builds. Content reaches a project only through the site’s release workflow, with that environment’s Pages-only publishing token. BR-1.13
SR-F-14 (Threat Settings) The zone settings security_level (medium) and browser_check (on) are declared in code, so a dashboard change shows as drift. BR-1.2
SR-F-11 (Test Asset Expiry) A cloudflare_r2_bucket_lifecycle rule deletes objects in the non-production assets bucket after assets_expiry_days (default 7). The variable defaults to null in the site module, so production is unaffected. BR-1.12
SR-F-12 (State Bucket Layout) One private state bucket holds live state under workloads/ (no lock, no expiry) and timestamped encrypted copies under history/, protected by a cloudflare_r2_bucket_lock retention rule on that prefix only. Object versioning is not relied on. A script run by GitHub Actions writes the copies (SR-F-13). BR-1.11
SR-F-13 (Automatic History Copies) A shell script copies each changed state object under workloads/ to history/<module>/<UTC time>-<digest>.tfstate.encrypted, skipping a state whose digest already has a copy. The site’s infrastructure promotion runs it after each apply, only if it succeeded, holding that environment’s lock, so a copy never reads a state mid-write; the setup layer’s production workflow copies its own state after a successful apply; a person runs the host equivalent right after an apply from a dev container. No scheduled workflow runs. A failed copy fails the job. BR-1.11

2. Non-Functional & Security Requirements

ID Specification Traceability (BRD)
SR-NF-02 (Adopting Existing Settings) A baseline setting that already exists in the zone is adopted with an import block. The plan must show no change for it before anything else is edited. State is never edited by hand. BR-1.4
SR-NF-04 (Plan Limits) The zone’s plan decides which managed rulesets and rate-limit options exist. The decision to rely on a paid-only feature is recorded before it is added, and the baseline otherwise stays within the free plan. BR-1.5
SR-NF-06 (No Access Layer) No cloudflare_zero_trust_* resource is declared. Sign-in protection for an administrative site is a separate requirement set, created when such a site exists. BR-1.4
SR-NF-08 (No Expiry on Live State) No expiry or lock rule is declared on any prefix or bucket that holds live state objects. A retention lock blocks overwrite, so it would fail every apply. BR-1.11, BR-1.12
SR-NF-09 (Account Sign-In) The hosting account uses a FIDO2 hardware key. Removal of SMS and authenticator-app factors is verified in the dashboard and the finding recorded. The owner is the only member. Checklist: bootstrap docs/runbooks/account-hardening.md. BR-1.7
SR-NF-10 (Audit Notification) The provider offers no audit-log or administrative-change alert type, so this is a manual review of the audit log by the owner. BR-1.8
SR-NF-11 (Registrar and Zone Status) Registrar accounts for both domains use hardware-key 2FA and a locked-down account email. No provider alert type exists for a zone leaving active status, so zone status is checked by hand after any DNS or registrar change. The registrar transfer lock is recorded as insufficient on its own. BR-1.9
SR-NF-12 (Usage Alerts) R2 has no hard cap once a payment method is on file. Four alerts are declared in the bootstrap module and sent to the owner: provider incident, HTTP DDoS attack, security insights and Universal SSL events, the account-wide alert types a static site on the free plan can use. The billing-usage alert for R2 storage is made by hand at 8 GB, because the provider needs product and limit values it does not document. Alert types for paid products, such as advanced DDoS, load balancing, health checks, Page Shield script monitoring and brand protection, are not declared. BR-1.10
SR-NF-13 (Offline Recovery) The state passphrases and the password-manager recovery kit are kept offline. Copies of the encrypted state are written to history/ automatically (SR-F-13). BR-1.11