Use app.UseHsts(); app.UseHttpsRedirection(); store DataProtection keys in Azure Key Vault or KMS with rotation.
compliance-soc2-essentialssecurity-hardening+1
High
Require step-up MFA for privileged operations
Actions like role changes, key rotations, and exports of PII require MFA re-authentication within the last 5 minutes; record mfa_verified_at in the audit log.
compliance-soc2-essentialssecurity-hardening
High
Require TLSv1.2+ and secure cookies
Configure http.Server with tls.Config{MinVersion: tls.VersionTLS12} and set cookies with Secure, HttpOnly, SameSite.
compliance-soc2-essentialssecurity-hardening
High
Structured audit log middleware with trace IDs
Attach a trace_id (e.g., from request header or generated UUID) and emit structured JSON logs for login, role change, and data export routes.
compliance-soc2-essentialsobservability-logging
Low
Audit logging with MDC trace IDs
Populate MDC with userId and traceId; include them in log pattern; log security events as JSON.
compliance-soc2-essentialsobservability-logging
Low
Cookie policy with SameSite and Secure defaults
Configure CookiePolicyOptions to enforce SameSite=Lax or Strict, HttpOnly, and Secure for all auth cookies.
compliance-soc2-essentialssecurity-hardening+1
Low
Data retention job with classification
Run a scheduled job that deletes telemetry after 30 days and anonymizes PII after the retention window; log deletions with data_class and count.
compliance-soc2-essentialsprivacy-pii+1
Low
Define change freezes and emergency override protocol
Establish maintenance windows and freeze periods; emergency overrides require incident_id, approver, and post-facto review logged in the audit trail.
compliance-soc2-essentialsci-cd-build-hygiene
Low
Deny logging of secrets with a custom layer
Implement a tracing layer that scans fields and redacts patterns (JWT, API keys, emails) before output.
compliance-soc2-essentialsprivacy-pii+1
Low
Disable debug and verbose errors in production
Set APP_DEBUG=false and hide stack traces; send errors to a centralized logger with trace_id instead.
compliance-soc2-essentialssecurity-hardening
Low
Filter sensitive parameters from logs
Use $dontFlash in app/Http/Middleware/TrimStrings.php or logging processors to redact 'password', 'token', 'ssn', and emails.
compliance-soc2-essentialsprivacy-pii+1
Low
Gate production changes with tickets and approvals
All production deployments must reference a change ticket ID, peer approval, and linked rollout plan; write the change_id to the audit log on deploy.
compliance-soc2-essentialspr-hygiene+1
Low
Mask tokens before logging HTTP requests
Intercept Authorization headers and redact bearer/JWT values; attach requestId to every log line.
compliance-soc2-essentialsprivacy-pii+1
Low
Monolog processors to redact PII
Configure Monolog to add a processor that redacts emails, tokens, and SSNs before writing logs; include request_id.
compliance-soc2-essentialsprivacy-pii+1
Low
Propagate context with timeouts for external calls
Use context.WithTimeout for HTTP and DB calls; log request deadlines and results; treat timeouts as audit-worthy events.
Wrap logger to filter emails and tokens using regex before logging; include trace_id in every entry.
compliance-soc2-essentialsprivacy-pii+1
Low
Reference external standards and benchmarks
Where relevant, include links to RFCs, regulatory guidance, or benchmarks in the ADR (e.g., RFC 9110 for HTTP, PCI DSS sections), under a 'References' section.
docs-adrsapi-conventions+1
Low
Security headers and request logging
Add middleware to set HSTS, X-Content-Type-Options, and secure cookies; log JSON with actor and trace_id for auth and admin routes.
compliance-soc2-essentialssecurity-hardening+1
Low
Standardize incident response workflow and postmortems
On Sev1/Sev2 incidents, capture timeline, root cause, remediation, and owner in a postmortem within 5 business days; link incident_id in all related commits and changes.
compliance-soc2-essentialsdocs-adrs+1
Low
Structured audit events
Emit JSON audit events via ActiveSupport::Notifications with user_id, action, resource_id, and request_id.
compliance-soc2-essentialsobservability-logging
Low
Structured audit events with ILogger
Log security events via ILogger with properties {Action, UserId, ResourceId, Result, TraceId}; configure sink to JSON and send to SIEM.
compliance-soc2-essentialsobservability-logging
Low
Version and deprecate APIs with logged contract changes
Expose explicit API versions (e.g., v1, v2). Breaking changes require a deprecation window and a CHANGELOG entry; log api_version in requests for traceability.