Securing Laravel Cloud Applications: What the Platform Handles and What You Still Own
Laravel Cloud now runs PHP, Go, Rust, Rails, Django and Node apps. It sets safe environment defaults, terminates TLS and puts a WAF in front of you. It does not turn on HSTS, rate limit your routes, or stop the edge caching a response you meant to be private. Here is the split.
On 1 December 2026 Laravel opened Laravel Cloud to applications beyond Laravel PHP: Laravel Rust and Laravel Go, plus Rails, Django and Node.js. A managed platform takes real work off your plate, and it also makes it easy to assume more is handled than actually is.
This guide separates the two, using the Laravel Cloud documentation as of 6 December 2026. Laravel does not publish a formal shared-responsibility matrix, so the split below is our reading of what the docs say the platform does.
What the platform handles
Environment defaults. For Laravel apps, Cloud "generates an APP_KEY for each environment" and sets APP_ENV=production, APP_DEBUG=false and APP_URL on every deployment. The two most damaging Laravel misconfigurations, debug mode in production and a weak or shared key, are closed off by default. The docs add: "don't copy your local .env file's key to Cloud".
No .env file for Go and Rust. For those runtimes, "no .env file is written at runtime". Variables are set on the process, so there is no file to expose.
TLS. Cloud issues and renews the certificate when you attach a domain.
The edge. Requests pass "through DDoS mitigation and Web Application Firewall (WAF) security layers" on Cloudflare. The Cloudflare OWASP Core Ruleset applies to default domains and to custom domains proxied through Cloudflare.
Path blocking. New environments block requests for sensitive paths such as /.env, /.git/config and /storage/logs/laravel.log, and there is a rule for PHP probes against non-PHP apps.
Two headers at the edge. X-Frame-Options: DENY and X-Content-Type-Options: nosniff.
Trusted proxies for Laravel Go. The framework trusts Cloud's proxies, so client IPs and HTTPS detection are correct without configuration.
Compliance. SOC 2 Type 2 and ISO 27001, with HIPAA and a BAA on Enterprise and Private Cloud.
What you still own
1. Turn on HSTS
The docs say HSTS is "disabled by default". It is one toggle in the environment's edge settings and sends max-age=31536000. Until you flip it, a first visit over http:// can be intercepted. Confirm with the header checker.
2. Send a Content-Security-Policy
Neither the platform nor any of the Laravel frameworks sends a CSP. Add it in application middleware, with a nonce for scripts. The same goes for Referrer-Policy and Permissions-Policy.
3. Control the edge cache
This is the Cloud-specific risk most likely to surprise you. By default the edge caches 200, 206 and 301 responses for 120 minutes unless the response has Set-Cookie or Authorization, or the application sets Cache-Control.
Consider an API endpoint authenticated by a custom header or a query-string token, returning JSON with no cookie. It is a 200 with no Set-Cookie. If nothing sets Cache-Control, the edge may serve one user's response to the next caller of the same URL.
Send an explicit header on everything user-specific:
Cache-Control: private, no-store
Then verify from outside by requesting an authenticated URL twice, the second time without credentials.
4. Rate limit
Edge rate limiting is not on by default. Basic limiting at 100 requests per minute per IP is available on Growth and Business plans, with advanced rules and bot categories on Business. Whatever your plan, throttle login, password reset and expensive API routes in the application as well, since only the application knows which user is making the request. Laravel Rust and Go apply no rate limits by default.
5. Restrict CORS
All three Laravel frameworks allow any origin on api/* out of the box. The WAF does not change that. See CORS misconfigurations.
6. Manage secrets deliberately
- Use the Secrets Manager for credentials. It is organisation-level and "write once, read never", with up to 30 secrets per environment, injected as environment variables at deploy. Changing a secret needs a redeploy.
- Custom variables override injected ones. If you define
APP_DEBUGorAPP_KEYyourself, your value wins. Check that no environment carriesAPP_DEBUG=trueleft over from debugging. - Variables are available during builds. Your build commands and every npm or Cargo build script run with access to them. A malicious dependency with an install script can read production secrets at build time. Keep build dependencies audited.
npm ci --audit falseis the pre-filled first build step for Rust and Go. Runnpm auditin your own CI.
7. Lock down who can operate the environment
Cloud includes an in-browser console, with an audit log, and a Cloud MCP server that can be set per organisation to read and write, read only, or no access. A console is production shell access. Limit who has it, require two-factor authentication on every account, and set MCP access to the lowest level your team needs. An AI agent with write access to your hosting account is a privileged user.
8. Know what is not captured
The docs note that the Issues feature "doesn't capture errors from Laravel Rust applications yet", and the same is true for Go. If you run either, set up your own error tracking so that a spike of 500s or authentication failures reaches someone.
9. Network isolation
Private networking, a dedicated edge and IAM roles are Private Cloud features. On standard plans, assume your application is on shared infrastructure and reachable only through the edge, and keep database and cache credentials strong and rotated.
10. Everything in the application
Authentication, authorisation, input validation, file uploads, dependency updates and session settings are unchanged by where you host. The Laravel security checklist applies to PHP apps on Cloud, and the Laravel Rust and Laravel Go guides cover the new runtimes.
Default domains, previews and forgotten environments
Every environment gets a default platform domain in addition to any custom domain. Preview and staging environments are internet-reachable, often with real data and weaker settings, and are easy to forget. Keep an inventory of environments, delete the ones you are not using, and remove DNS records that pointed at deleted environments so they cannot be claimed by someone else.
A ten-minute check after your first deploy
- Enable HSTS in the edge settings.
- Run the header checker and note what is missing.
- Request an API route with an
Origin: https://example.orgheader and see whether it is reflected. - Request an authenticated JSON URL without credentials and confirm you get
401, not a cached copy. - Check the session cookie has
Secure,HttpOnlyandSameSitewith the cookie checker. - Review custom environment variables for anything that overrides a Cloud default.
- Confirm who has console and MCP access.
Or run a free StackShield scan against the environment's domain, which covers the header, cookie, CORS, TLS and exposed-file checks in one pass. The platform protects the layer below your application. What your application says in its own responses is still up to you, and it is the part an attacker sees first.
Is your Laravel app exposed right now?
34% of Laravel apps we scan have at least one critical issue, and most teams do not find out until something breaks. The free scan checks your live app in 60 seconds. Then StackShield re-runs every check after each deploy, so a fix you ship today does not quietly regress next week.
Frequently Asked Questions
Is Laravel Cloud secure by default?
The platform layer is well covered: TLS certificates, DDoS mitigation, a web application firewall, blocking of sensitive paths, and APP_DEBUG=false with a generated APP_KEY on every deployment. Application-level security is still yours: authentication, authorisation, CORS, Content-Security-Policy, rate limiting and dependency updates.
Does Laravel Cloud enable HSTS?
No. The Laravel Cloud docs state HSTS is disabled by default. There is a toggle in the environment edge settings that sends it with a max-age of 31536000.
Does Laravel Cloud rate limit my application?
Not by default. Basic edge rate limiting of 100 requests per minute per IP is available on Growth and Business plans, and advanced rules on Business. You should also rate limit sensitive routes in the application.
Can the Laravel Cloud edge cache private pages?
It can if the response looks cacheable. Responses with status 200, 206 or 301 are cached for 120 minutes by default unless they carry Set-Cookie or Authorization, or the application sets Cache-Control. Send Cache-Control: private or no-store on anything user-specific.
Does the Laravel Cloud WAF mean I do not need a security scanner?
No. A WAF blocks known attack patterns in requests. It does not tell you that your CORS policy is open, your CSP is missing, a cookie lacks the Secure flag or a staging subdomain is exposed. Scanning checks your configuration; the WAF filters traffic.
Related Articles
95% of Cloud Security Failures Are Misconfigurations: A Laravel Deployment Checklist
95% of cloud security failures stem from human error, not platform vulnerabilities. This checklist covers the most common misconfigurations in Laravel deployments: exposed storage buckets, overly permissive IAM, missing network segmentation, database exposure, Redis security, leaked .env files, and debug endpoints left open in production.
SecuritySecuring Laravel Queues and Background Jobs
Your queue runs code with no user watching, often with elevated access, on payloads sitting in plaintext. Here is how to encrypt sensitive jobs, lock down the backend, validate user input inside handle(), and keep failed_jobs from leaking your secrets.
SecuritySecuring Your Laravel CI/CD Pipeline: A Practical DevSecOps Guide
With 70% of teams releasing continuously, your CI/CD pipeline is a high-value target. This guide covers securing GitHub Actions and GitLab CI for Laravel projects: secrets management, composer audit integration, SAST scanning, container security, deployment hardening, and artifact signing with practical YAML configs.
Compare StackShield
Security Checklists
Laravel Production Deployment Security Checklist
A comprehensive security checklist for deploying Laravel applications to production. Covers environment config, server hardening, access control, and monitoring.
20 itemsLaravel API Security Checklist
Secure your Laravel API endpoints against common vulnerabilities. Covers authentication, input validation, rate limiting, and response security.
Stay Updated on Laravel Security
Get actionable security tips, vulnerability alerts, and best practices for Laravel apps.