Move and fence the admin
Change the admin path from /admin with bin/magento setup:config:set --backend-frontname=<something> and keep it out of robots.txt and public docs. It does not stop a targeted attack, but it removes you from the mass scans that try /admin on every Magento they find.
If your team works from fixed addresses or a VPN, allow only those IPs to the admin path at nginx or Cloudflare level. Put the rule in the web server, not in a Magento extension, so it holds even when Magento itself is broken.
Two-factor authentication
Magento 2.4 ships the Magento_TwoFactorAuth module, enabled by default. Keep it on, use Google Authenticator or a hardware key, and do not disable it on production because it is annoying on staging: use bin/magento security:tfa:reset per user instead.
Many hacked stores had 2FA disabled during an upgrade and never turned back on. Check it with bin/magento module:status Magento_TwoFactorAuth after every release.
Accounts, roles and sessions
Give every person their own admin user, remove leavers on their last day, and use roles: a content editor does not need System → Configuration or Payment Methods. Review the user list every quarter.
Set Stores → Configuration → Advanced → Admin → Security: session lifetime, lockout after failed logins, password lifetime and "Add Secret Key to URLs" on. Audit who changed payment settings with the admin action log (Adobe Commerce) or an extension that records config changes.
Patches, extensions and file integrity
Apply Adobe security patches within days, not at the next upgrade, and remove extensions you no longer use: unused code with an admin controller is still attack surface. The security patches guide covers how to test them.
Watch for new or changed files in pub/, app/code and the database tables that hold CMS blocks and config (core_config_data). Injected payment skimmers usually live there; see Magecart skimming.
Prove the checkout still works
Hardening changes headers, IP rules, cookies and caches. Any of them can block the payment provider callback, a payment iframe or the checkout itself. After each change place a test order, or let a monitor do it every hour.
Run the free Magento checkout test after a hardening change: it walks product, cart, shipping and payment in a real browser and shows the step where it stops.
Find out your checkout broke before your customers do.
Real checkout checks for Magento and WooCommerce · free plan · no card requiredMagento checkout monitoring →