Locking Down the Magento Admin: 12 Security Checks

Locking Down the Magento Admin: 12 Security Checks

Card skimmers and hijacked admin accounts are still the most common ways Magento stores get compromised. Patching fixes known bugs. Hardening shrinks everything else an attacker can reach. Work through these twelve checks.

The admin panel

  1. Move the admin away from /admin to a custom path.
  2. Keep two-factor authentication on for every admin account.
  3. Limit admin access to known IP addresses or a VPN.
  4. Delete unused accounts and give everyone their own login.
  5. Use roles with only the permissions each person needs.

Two commands help here:

php bin/magento info:adminuri
php bin/magento admin:user:unlock USERNAME

The server

  1. Make code directories read-only for the web server user in production.
  2. Block PHP execution in pub/media and other upload folders.
  3. Patch the operating system, PHP and database, not only Magento.
  4. Use SSH keys, and turn off password and root logins.
location ~* ^/media/.*\.php$ {
    deny all;
}

The storefront

  1. Apply a strict Content Security Policy on checkout to stop injected skimmers.
  2. Place a web application firewall in front of the store.
  3. Scan for malware daily and alert on any change to core or checkout files.

Warning signs

Admin users nobody recognises, new JavaScript on checkout, or files changed outside a deployment all need immediate attention. Put the store into maintenance mode, keep the logs and bring in experienced help quickly.

Need a second pair of eyes on this? Our team handles Magento development every week. See how we can help.

Keep reading

Related articles

All articles

Need a hand?

Stuck on something similar?
We can fix it with you.

Send us the problem. A senior developer reads every message and replies within one working day.