In the previous article, we discussed becoming familiar with Amazon Web Services (AWS), and the pitfalls that may occur while using AWS. The areas that were examined closely were:  billing pitfalls, autoscale pitfalls, common engineering mistakes and security issues.

WordPress Security

This article ties in with the previous article in the sense that both articles address security issues. Each entity has their own list of security concerns, but how to address those issues is what these articles are for. Strengthening your enterprise site security will not only boost your number clientele to your site, but will also have your site running as optimal as possible. If you are curious about how to correct security mistakes or looking for tips on how to bolster your security system, then look no further!

Tips for a Well Protected WordPress Enterprise Site

A few tips found below will be helpful tools when managing a WordPress Enterprise Site. This section will address the importance of running the latest and up to date version of WordPress

  • One of the best preemptive ways to secure your site is to run the latest version of WordPress. This may seem like a no-brainer, but it is usually one of the most overlooked solutions out there. This is by far one of the easiest ways to keep your site secure. In order to do so, keep your WordPress install up to date by enabling automatic updates. The automatic updates can be arranged to reflect your needs. They can cover all major and minor updates, such as maintenance and security, or just the basic updates needed for your enterprise site.

  • Your customization of WordPress updates doesn’t have to end there. You may also manage your own updates to the core platform. That way you are able to stay up to date on new releases found under the WordPress core announcement lists. For any major or minor WordPress releases, be sure to read the release notes beforehand. That way you are able to make sure everything is working by developing a test plan. Running the test plan in a test environment ensures that everything is working as expected so you may easily organize your production environments.
  • Also, make sure that you allow your development and editorial teams time for a few key targets. Your team should be given a set window for testing. Then they should be able to commit to organizing the WordPress release as soon as possible. Major WordPress releases will accompany plenty of notice, sometimes with weeks of lead time for testing prior to release. This includes betas and release candidates as well. Minor WordPress releases are usually much smaller in scope and they only address certain concerns. Minor releases will not be behind in their release.

Tips for managing the customization process of WordPress:

  • WordPress is very useful with how much freedom it gives users to customize their applications to what their needs are. This customization comes from a variety of existing Plugins and Themes that are shared through a community environment. WordPress also allows users the possibility to create their own custom Plugins and Themes if they wish.
  • The freedom that allows your enterprise site the ability to customize also comes with the capacity to tailor the customizations to what you are looking for. WordPress already supports the management of Plugins and Themes within the WordPress administration. This default setting is very helpful for WordPress users in most settings. There are also scenarios in which the default is not ideal. Sometimes the WordPress default is too different from the development workflows and policies of others. You may look to other management tools besides WordPress that are better in line with the needs of your organization.
  • In order to take the reins of Plugin and Theme management, you must follow a couple of steps. First be sure to disable the ability that allows the WordPress administration to install and modify Plugins and Themes. Then store all of the site’s customizations of their Plugins and Themes in a source repository. A source repository is isolated from the WordPress installation center. The code changes of Plugins and Themes will only be probable within the source repository. Only authorized developers who are allowed to ship code will have write access to the source repository. They should also keep a limit on read access to those who actually require it. By enforcing coding standards on your enterprise site’s customizations will guarantee that the upgrade path for WordPress is safe and that your applications will be secure.

Different Tips to Keep Users Secure:

A critical part of managing the security of your WordPress application is by examining closely the users who have access to WordPress’ administration.

  • A key component to managing the security of your WordPress applications is managing the security of the users with access to WordPress’ administration. There are a few important things that are recommended for individual users. WordPress’s user system already contains the concept of Roles and Capabilities. This permits the enterprise site owner (you) control over what the users are allowed or not allowed to do inside your application. Always be sure to consider who should obtain the Administrator position. This is key! The Administrator role determines who can change key settings. If you would like an even more stringent control of permissions, then there is great flexibility by the use of custom roles and competences.
  • Always enable the two-factor authentication. This ensures that users on various platforms or sites must have access to administrator tools and functions.
  • One simple way to keep users secure is to utilize strong passwords for logins.
  • Another easy method is to ensure that your WordPress user traffic is over SSL. This ideally would extend throughout the entire application.
  • You can also keep users secure by leveraging a corporate SSO. You can explore options such as using SAML-based SSO for access to the WordPress administration. This seamlessly allows access control and accompanies various features such as two-factor administration specifically from the organization.
  • One last tip is to always monitor for distrustful login activity. This includes IP addresses that may look malicious to your organization. Keep your eyes peeled for suspicious logins!

How to Make WordPress Safe and Secure for Enterprise Sites

WordPress is not a platform to be fearful of getting hacked or not being safe enough for users to enjoy. WordPress has many opportunities, as mentioned above, to fortify your enterprise site to be as optimal as possible. What are some more ways that your WordPress enterprise site can be as secure as can be? The answers will be discussed in the sections below.

Optimizing Enterprise Site From the Get Go

When most site developers are optimizing an enterprise site, they will spot check their work with Moz’s on-page grader. This is a tool that examines your page and provides you with feedback (as well as a grade) of how many points you’ve accumulated. WordPress usually passes the test with outstanding results without having to make any prior adjustments. However, that is contingent on making sure that the Theme you are using has been coded with SEO best practices. The only pertinent changes that need to occur with your WordPress site are items that your marketing team would need to change. These include placement of key words in the copy, colors, and titles. WordPress is unique in this way from other platforms. Other platforms usually have a multitude of problems that are revealed via Moz’s on-page grader.

Secure Site Access

We mentioned in the above section about the importance of securing enterprise site passwords. There are ways of to fortify WordPress further than just locking down a site website. Some best practices of securing your WordPress enterprise site are as follows:

  • Always abide by the Principle of Least Privileges and maintain only one administrator level user. Only allow users the amount of permission they need to accomplish their tasks.
  • Be sure to restrict administrative access to a whitelist of IPs or ban IPs based on their geographic location.
  • Include a firewall to your enterprise site that will block common code attacks.
  • Include a brute-force protection to prevent bots from trying to invade your site by guessing your password.
  • Include a 2-facotr authentication for user logins.
  • Always remember to run an automatic malware scanner in order to spot malicious code.
  • Modify the URL of common admin areas (wp-admin, wp-content).
  • Replace the default database prefix in order to prevent the injection of malware to your site.
  • Engage SSL connections for the administrator area and/or for the entire website.
  • Disengage the backend file editor as well as the Plugin and Theme installer.
  • Restrict user registration.
  • Keep the WordPress platform and plugins current and up to date.
  • If your enterprise site runs into problems, then be sure to keep regular offsite backups handy for easier rollback.

Server Security Should Never be Neglected

You can never be too careful with making sure your enterprise site is secure. Even though you do your due diligence by checking that your WordPress installation is secure, do not over look the fact that hackers can get access directly to your site. They can get access very easier to your server if the proper preventative methods are not in place. Enterprise-level site hosts and dedicated web developers must implement a few measures to secure their sites completely. These measures are listed below:

  • Block all external server access (cPanel, WHM, FTP, SSH, SQL, etc.) or allow access through IP whitelist only.
  • Utilize brute-force fortification measures before user traffic ever hits WordPress.
  • Block standard attacks with a protective IP configuration.
  • Tailor your file permissions to prevent access to certain WordPress files.
  • Include server-side passwords that need to be obtained before any access is given to WordPress’ login or admin pages.
  • Always backup the server repeatedly and hoard the files offsite.
  • Uses services, such as Cloudflare, to add another layer of security to your site. They can provide tools such as blocking cross site scripting, SQL injection, comment spam, and email harvesters.
  • Set PHP to not allow access to the server and not permitting attackers’ ability to inject harmful code.

Avoid User Error at All Costs

The user is usually the most susceptible to technical problems. A developer can design and create a secure enterprise site with all the best practices mentioned above, but there may still be some exposed areas. Several tips on strengthening these weaknesses include:

  • When logging into WordPress, make sure that the computer you are on has virus and malware protection running. Do not login if these aren’t running.
  • The same theory applies to WiFi. Unsecured public WiFi is not safe to use. Don’t log into your WordPress on unsecured public WiFi without a VPN connection.
  • There may come a time that you must use WiFi without a VPN. Setup a low-level WordPress user that can write content, but does not have the ability to publish or edit existing content.
  • Emailing passwords is another way to end up in trouble. Use a service like NoteShred to send delicate information.
  • When storing passwords, do so in a secure place. Word does not count as a secure storage device! You can utilize software like 1Password to efficiently manage passwords.
  • Software should not be allowed to remember passwords. Entry should be necessary with each login.

WordPress Best Practices for Handling Heavy Traffic

This article should have provided you with tips and ideas on how to protect your enterprise site. With the ever-changing world of technology, there are always different updates occurring to better protect your site.

Elastic Load Balancing (ELB) assists your website by serving content and routing content to run on various WordPress sites (if required). In other words, ELB is a load balancing solution. ELB supports the circulation of requests across several Availability Zones within an AWS Region. You can also create a health check for the application load balancer that would automatically cease sending traffic to individual instances that have were unsuccessful. A software crash is an example of this. It is recommended to use the WordPress admin login page for the health check because this page provides necessary information. It will inform you that the web server is operating and that it is configured to serve PHP files accurately. Your developer is allowed to create a custom health check page that also examines other resources.

Elasticity is a necessary component of the AWS Cloud. This allows you to launch more web server capacity and be flexible with the amount you need at a given time. Auto Scaling is an AWS service that automates the ability to scale your Amazon EC2 capacity to match your needs. You can also set up Auto Scaling to have the amount of EC2 instances increase flawlessly during any spikes in demand. This will allow performance to be well maintained and then decreases automatically when the spike goes down. Costs will be minimalized from this as well. ELB also allows the addition and removal of Amazon EC2 hosts from the load-balancing rotation. ELB will fluidly grow or shrink the load-balancing capacity depending on the amount of traffic. This requires not manual intervention whatsoever.

Web Tier Must be Stateless

Since Auto Scaling allows various web servers to be configured, your web tier must be stateless. A stateless application is an application that requires no knowledge of former interactions and has no storage of session information. Within the WordPress platform, this entails that all end users have the same response no matter what web server processed their request. A stateless application can scale horizontally because any request can be serviced by the first available computer resource. Think of web server instances as an example. When the capacity is no longer needed, any singular resource can be safely disposed of when the running tasks have been emptied. The resources do not need to be broadcasted to your peers; you just need to distribute the workload to them.

WordPress core is stateless with user session data storage. This is because it depends on cookies that are found in the client’s web browser. Session storage is not a huge concern unless you have a custom code or plugin installed. These custom codes rely more on native PHP sessions. Though, WordPress was initially created to run on a single server. This means that it may store some data on the server’s local file system. When running WordPress in a multi-server configuration, this only results with issues. There is inconsistency across all web servers such as if a user uploads a new image, then it is only stored on one of the servers.

That example proves why WordPress’ defaults need to be improved. This means running configurations more seamlessly and to move important data to shared storage. The best practices for this include having a database as a separate layer outside the web server. This will allow use of shared storage to store user uploads, themes, and plugins.

Amazon Aurora is a MySQL and PostgreSQL likeminded relational database created for the cloud. This connects the performance and availability of high-end commercial databases with the straightforwardness and cost-effectiveness of open source databases. Aurora MySQL improves MySQL performance and availability by fully mixing the database engine with a purpose-built distributed storage system that is backed by SSD. This solution is fault-tolerant and self-healing. It can replicate six copies of your data across three Availability Zones. This is also intended for greater than 99.99% availability, and incessantly backs up your data in Amazon S3. Amazon Aurora is intended to routinely detect any database crashes and restart without the need for crash recovery.

When your database scales, then your database cache will also need to scale. ElastiCache has certain features to scale the cache across numerous nodes in an ElastiCache cluster. This also includes scaling across multiple Availability Zones in a Region for improved availability. As you scale your ElastiCache cluster, you should make sure that you organize your caching plugin to connect using the configuration endpoint. This ensures that WordPress can use new cluster nodes as they are added and ceasing from using old cluster nodes as they are taken out. You will also need to design your web servers to use the ElastiCache Cluster Client for PHP and update your AMI to store this change.

An alternative to managing different cloud components by hand is to use terraform. With terraform you can implement the infrastructure as code without worrying about the actual API calls. ScaleDynamix has been using terraform in production for our enterprise WordPress hosting platform for a few years now without any issues.