Overview
PensionsPortal.ie uses Cloudflare as its CDN, WAF, and DNS layer in front of Vercel. All traffic to*.pensionsportal.ie passes through Cloudflare before reaching Vercel’s edge network. This provides DDoS protection, web application firewall rules, rate limiting, and TLS termination.
DNS Records
Configure the following records in Cloudflare Dashboard → DNS → Records forpensionsportal.ie.
Email records (SPF, DKIM, DMARC, MX) must be set to DNS only (grey cloud). Proxying these record types through Cloudflare would break email delivery and DKIM signature validation.
TLS Configuration
Configure in Cloudflare Dashboard → SSL/TLS.HSTS Configuration
Enable HSTS in Cloudflare Dashboard → SSL/TLS → Edge Certificates → HTTP Strict Transport Security (HSTS):WAF Configuration
Configure in Cloudflare Dashboard → Security → WAF.Managed Rulesets
Enable the following managed rulesets under WAF → Managed Rules:Custom WAF Rules
Create the following rules in Security → WAF → Custom Rules: Rule 1 — Geo-restrict regulated data endpoints This rule challenges non-EU/non-Irish traffic attempting to access regulated pension data APIs. PensionsPortal.ie operates under IORP II, which is an Irish/EU regulatory framework.Disable or modify this rule if expanding to non-EU markets (Wave 2). Ensure legal review of data residency obligations before disabling geo-restriction for any regulated endpoint.
Rate Limiting Rules
Configure in Cloudflare Dashboard → Security → WAF → Rate Limiting Rules.The login rate limit (10 req/min) is intentionally strict to prevent credential stuffing attacks against trustee accounts. Legitimate users should not approach this threshold during normal use. If users report false positives, investigate before raising the limit.
Bot Protection
Configure in Cloudflare Dashboard → Security → Bots.Super Bot Fight Mode may block legitimate API clients such as monitoring services (e.g., BetterUptime). Allowlist known monitoring IPs or user-agent strings in the Cloudflare firewall before enabling.
Zero Trust Configuration Plan
Cloudflare Zero Trust (formerly Cloudflare Access) provides identity-aware access control for sensitive admin paths, replacing IP-allowlisting with company identity authentication. Target state (future hardening):- Create a Cloudflare Access application scoped to
app.pensionsportal.ie/admin/* - Require authentication via Cloudflare Access + company email (Google Workspace or Azure AD IdP)
- Enable device posture checks — allow access only from managed, MDM-enrolled devices
- Log all access events to Cloudflare SIEM / Logpush (forward to your SIEM or audit log store)
- Conduct weekly access reviews — security lead reviews active users and revokes stale access
Zero Trust configuration requires a Cloudflare Zero Trust plan (free tier available for small teams). Review Cloudflare Access documentation before implementing.
Admin Route Protection — Current State
Until Zero Trust is fully configured, the following interim controls apply:- No dedicated
/admin/*URL path exists. SuperAdmin capabilities are not exposed via a separate URL prefix. - Admin users are identified by role in the JWT, not by URL path. The
SuperAdminrole is stored in the database and reflected in the session token. - All
/api/*routes perform server-side role checks using the session JWT before executing privileged operations.
/admin route tree protected by both JWT role check and Cloudflare Access, providing defence-in-depth for the highest-privilege operations.
Performance Settings
Configure in Cloudflare Dashboard → Speed → Optimization and Caching.Cache Rules
Create a Cache Rule in Cloudflare Dashboard → Caching → Cache Rules: Rule: Cache Next.js static assets at edge/_next/static/, making long-lived caching safe — stale files are never served because filenames change with each build.
Do not cache
/api/* paths or /dashboard/* paths at the Cloudflare edge. These routes return user-specific or real-time data. Vercel handles caching for these routes via the Next.js cache headers.Analytics and Monitoring
Web Analytics setup:
Add the Cloudflare Web Analytics script to the marketing site (
www.pensionsportal.ie). This script does not use cookies and does not require a GDPR consent banner, making it suitable for a regulated financial platform.
Security Events review checklist (weekly):
- Check for any WAF rule triggers on
/api/auth/*— spikes may indicate credential stuffing - Review blocked geo-restriction hits on regulated endpoints
- Check rate limit trigger counts — a significant increase may indicate automated probing
- Review any manual
Blockactions and confirm they remain appropriate