What we design around your workflow
Hardening turns audit findings into running controls. Most of it is specific: a header that stops injected scripts running, a session that ends at logout, a CORS rule that names its origins, a secret moved out of the repository. Any control can break something if switched on carelessly, so we roll each one out in stages, watch what it blocks, and record every change.
Security headers
Deploy a nonce-based Content-Security-Policy, HSTS, and supporting headers, starting in report-only mode.
Sign-in hardening
Add multi-factor authentication and passkeys, block breached passwords, and throttle failed attempts.
Session safety
Set secure cookie attributes, renew session IDs at sign-in, and enforce server-side timeouts.
Input and API controls
Validate input on the server, encode output by context, and name CORS origins.
Secrets, patches, and logs
Move secrets into a manager, automate dependency updates, and alert on security events.
Add browser security headers in stages
Headers tell the browser what it may run, load, and remember. A strict Content-Security-Policy based on nonces or hashes lets only scripts the server marked as trusted execute, which blunts cross-site scripting; allowlist policies, by contrast, can often be bypassed. We deploy it first with Content-Security-Policy-Report-Only, collect violations, fix the inline scripts and tags that trip it, then enforce. Strict-Transport-Security tells browsers to use only HTTPS for the period in max-age, optionally across subdomains. X-Content-Type-Options, an explicit Referrer-Policy, frame-ancestors against clickjacking, and a Permissions-Policy that disables unused features complete the set.
Report-only first
Read violation reports before enforcing, so the policy does not block your own checkout.
Nonces over allowlists
Mark trusted scripts per response instead of listing domains an attacker might abuse.
HSTS with care
Raise max-age gradually, and include subdomains only when all serve HTTPS.
Primary sources
- web.dev: Mitigate XSS with a strict CSPPrefers nonce- or hash-based policies to bypassable allowlists.
- IETF: RFC 6797, HTTP Strict Transport SecurityDefines max-age and includeSubDomains for HTTPS-only access.
- OWASP: HTTP Security Response Headers Cheat SheetSettings for nosniff, Referrer-Policy, frame-ancestors, and Permissions-Policy.
Make account takeover hard
A password alone is a weak lock, because passwords get phished, reused, and guessed. NIST's SP 800-63B-4, the US federal digital identity guideline, final since July 2025, requires services at its AAL2 level to offer at least one phishing-resistant option and permits syncable authenticators there. We add passkeys and app-based codes, check new passwords against breached and common values instead of forcing composition rules, and throttle failed attempts. Sessions get Secure, HttpOnly, and SameSite cookies, a fresh ID at sign-in and on role changes, and server-enforced timeouts and logout.
Phishing-resistant options
Offer passkeys alongside app-based codes, and require them for administrators.
Smarter password checks
Block breached and common passwords at signup rather than demanding symbols and scheduled changes.
Server-side session control
End sessions on the server at logout and timeout, not only by deleting a cookie.
Primary sources
- NIST SP 800-63B-4: Authentication and Authenticator ManagementRequires a phishing-resistant option at AAL2 and password blocklists, and bars composition rules.
- OWASP: Session Management Cheat SheetCookie attributes, ID renewal, timeouts, and server-side invalidation.
Close injection and cross-origin gaps
Every value from a browser, partner, or webhook is untrusted until the server checks it. We validate input against allowlists of expected types, lengths, and formats, use parameterized queries throughout, and encode output for the context it lands in, whether HTML, attribute, URL, or script, using the framework's escaping where it exists. CORS lists the exact origins allowed, because the Fetch standard forbids a wildcard origin on credentialed requests, and reflecting whatever origin arrives undoes the protection. Sign-in, password reset, search, and export endpoints get rate limits per account and per address.
Allowlist validation
Define valid input per field and reject everything else at the server.
Context-aware encoding
Escape output for HTML, attributes, URLs, and scripts, and avoid raw HTML insertion APIs.
Named CORS origins
List the origins that may call the API with credentials, and test that others are refused.
Primary sources
- WHATWG: Fetch StandardAccess-Control-Allow-Origin cannot be the wildcard when credentials are included.
Keep secrets, dependencies, logs, and backups in order
Hardening decays without maintenance. Secrets move out of code into a secrets manager with per-service access, rotation, and pre-commit scanning for new leaks. Dependency updates arrive as small automated pull requests, with security advisories flagged. Failed sign-ins, access control failures, and admin actions are logged without passwords, tokens, or session IDs, and alerts reach a person who can act; the OWASP Top 10:2025 lists security logging and alerting failures as a category of its own. Backups are encrypted, stored apart from production, and restored in regular tests.
Managed secrets
Scope each key to one service, and rotate it on a schedule and after any exposure.
Steady patching
Merge small dependency updates on a set cadence, and fast-track those with known exploits.
Alerts with owners
Route suspicious sign-in and permission activity to someone on call, with a written runbook.
Primary sources
- OWASP: Secrets Management Cheat SheetCentralize, rotate, and scan for secrets, with least-privilege access.
- OWASP: Logging Cheat SheetWhich security events to log, and which values to keep out of logs.
Realistic limits and operator controls
Risk shrinks but does not vanish
Hardening narrows the ways in, but it cannot make an application immune to new vulnerabilities.
Some controls add friction
Multi-factor prompts and shorter sessions change the user experience, so each is tuned with your users in mind.
Legacy code can delay strict policies
Inline scripts and old widgets can hold back an enforced CSP until they are rewritten or replaced.
Frequently asked questions
How is hardening different from a security audit?
An audit finds and documents weaknesses; hardening implements the fixes and controls. Many teams audit first and use the findings as the hardening backlog.
Will a Content-Security-Policy break our site?
It can if enforced blindly. We start in report-only mode, fix what the reports show, and enforce once legitimate pages stop triggering violations.
Must every user have multi-factor authentication?
Not necessarily. Many products require it for staff and administrators and offer it, passkeys included, to everyone else, with a recovery path that does not reopen the door.
Can hardening help with customer security questionnaires?
Yes. The controls and their documentation answer many common questions about sessions, secrets, and logging, though certification and attestation come from independent auditors.
