Laravel security checklist for enterprise systems

Laravel security is not a slogan plugin. Identity, roles, input, files, deploy secrets, and backups must close before launch. This is the minimum checklist KGSM runs on enterprise systems that hold users and financial documents — not a marketing badge after a breach.

This piece is for An IT or system owner who must close security on an enterprise Laravel app before go-live. A post-launch breach means leaked finance data, downtime, and a rebuild that costs more than prevention.

Identity, sessions, and roles

Login must be on HTTPS, mark the session cookie HttpOnly and Secure, and never ship admin or a guessable manager email as the default user. Two-factor for finance and super-admin roles has operational value, not just a badge. Lock the account after failed tries and rate-limit /login to slow guessing. “Everyone is admin” in an enterprise app means an intern can export payroll. Build roles with explicit abilities: view, edit, delete, export. Invalidate sessions after a password change so a stolen token dies. In Laravel keep mass assignment behind $fillable and stop admin routes from being guessable URLs. Before handoff KGSM creates an accountant user and tries to open the payroll menu; if it opens, permissions are still wide. That work belongs in web development, not after launch.

Input, CSRF, uploads, and XSS

Every enterprise form needs CSRF. Design token APIs separately from cookie forms so the two are not mixed by mistake. Validate in Form Requests, not only in the frontend. Keep Blade escaping on by default and allow {!! !!} only for controlled HTML. Uploads must limit type and size, store a random name, and never execute from a public folder; PHP uploaded as an image still happens. Build SQL with the query builder or bindings; concatenating input into a custom report string is the most common inside hole. Rate-limit contact and password-reset forms to cut spam and mailbox floods. If you have public pages, technical SEO also takes HTTPS and security headers seriously; those are not separate projects. At handoff KGSM posts a forbidden file and a script string at the forms so the checklist is not paper-only.

Secrets, deploy, and dependencies

Never leave .env in a public repo or a downloadable folder. Keep the app key, database password, and gateway tokens different between production and staging. Turn debug off in production; an error page with file paths is a map for an attacker. Schedule Laravel and Composer updates monthly, not when a breach hits the news. Remove abandoned packages; every dependency is attack surface. Run queue workers as a separate user so one leaked job does not own the web process. If you have several servers, keep APP_KEY in sync or sessions and field encryption break. KGSM hands SSH and hosting panels to the client’s name; secrets on a developer’s personal account mean you lock up when that person leaves. Ask for the update-support path in the contract via contact.

Backups, logs, and restore practice

Skipping backups because month one felt quiet is the classic way to lose financial documents. Database and attachment snapshots need a schedule, encryption, and at least one copy off the production box. Practice restore on staging; a file that will not open is not a backup. Log failed logins, role changes, report exports, and document deletes so disputes and intrusions have evidence. See disk, failed-queue, and SSL-expiry alerts before customers do. A full pentest is not always required; this checklist on real data closes most opportunistic attacks. If internal automation shares the app, separate office automation with roles so a clerk inbox cannot reach payroll export. Security is not a phase after the panel looks pretty; each staged demo should close one of these items.

Before you sign, make these points explicit:

  • Turn debug off in production; file paths are a break-in map.
  • Split the accountant role from super-admin and test with that account.
  • Store uploads outside an executable public path.
  • Put Composer updates on the monthly maintenance calendar.
  • A backup you never restored is only a feeling of safety.
  • Log role changes and report exports.
  • Do not share .env and gateway keys between staging and production.
  • Rate-limit login and password reset from day one.

What keeps showing up in projects

A panel with APP_DEBUG on leaked a controller path to the internet after a validation error.

An intern on an admin role downloaded the payroll Excel because abilities were not split.

An image upload dropped a PHP file in public and the site died overnight.

Backups lived on the same disk; a drive failure took both copies.

Gateway tokens stayed in a developer’s personal git repo and leaked after they left.

An unlimited password-reset form filled the mailbox with forged requests.

KGSM runs this checklist before enterprise handoff and puts update support in the contract.

If this is close to your project, start with Custom organizational systems, Custom sales systems, Organizational customer portals, Laravel development, or continue with Website security for Iranian businesses: the essentials. For a written first-version scope, use the contact form.

Frequently asked questions

What is the Laravel security minimum before launch? +
HTTPS and secure cookies, split roles, CSRF and validation, upload limits, hidden .env, debug off, tested backups, and logs of sensitive actions.
Do we need a penetration test? +
Useful for highly sensitive data. Most systems get the main coverage from this checklist plus real-role tests at KGSM handoff.
Who applies updates? +
It must be in the contract. KGSM prices monthly maintenance apart from version one so the app does not go dark.
Is WordPress on the same server dangerous? +
A weak WordPress admin exposes the whole box. Split access and keep plugins updated.
What if we are already breached? +
Cut access, keep logs, rotate secrets, and restore from a clean backup. Prevention is cheaper; send scope via [contact](https://kgsm.ir/contact) for a review.
#Laravel security #website security #CSRF #KGSM