← All articles

Checklist · 2026-07-03

Magento 2 Hardening Checklist (40 Steps, Copy-Paste)

Hardening is the difference between a store that shrugs off an attack and one that gets popped. This is a practical, copy-paste Magento 2 hardening checklist grouped into ten areas — work top to bottom, and you'll close the gaps behind almost every real-world compromise.

Want to know where you stand first? Run a free MageArgus scan — it checks your version, headers, exposed files and more in under a minute.

By the numbers
  • Most breached stores were missing a patch that had been available for monthsSansec / MageArgus incident data
  • 2FA + a custom admin path stops the overwhelming majority of admin brute-forceAdobe Commerce security guidance

1. Patching & versions

2. Admin access

Details in the admin hardening guide.

3. File & folder permissions

No world-writable files; app/etc/env.php readable only by the app user:

find var pub/static generated -type d -exec chmod 770 {} \;
find var pub/static generated -type f -exec chmod 660 {} \;
chmod 600 app/etc/env.php
  • Block PHP execution in pub/media and pub/static.
  • 4. Transport & headers

    See security headers explained.

    5. Content Security Policy

    Move CSP from report-only to an enforced script-src allow-list to block skimmers on checkout — how to enforce Magento CSP.

    6. Extensions & code

    7. Secrets & integrations

    8. Backups & recovery

    9. Monitoring

    10. Incident readiness

    Frequently asked questions

    How long does hardening take?

    The high-impact items — patch, 2FA, custom admin path, permissions, HTTPS/HSTS and an enforced CSP — can be done in a day. Backups, monitoring and CSP tuning are ongoing.

    Do I need every item?

    Prioritise patching, admin hardening and CSP first — those close the paths behind most real compromises. Then work through the rest.

    Related reading

    Scan your store free →