Welcome!

Blog Feed Post

The Curious Case of the WordPress Docker Container and the Devious XML-RPC Denial of Service Attack

Republished from 04/29 as it was lost due to a Docker Container crash… Irony!

I have an article in the recently released “DZone Guide to Building and Deploying Applications on the Cloud” entitled “Fullstack Engineering in the Age of Hybrid Cloud”. In this article I discuss the need and skills of a Fullstack Engineer with relation to troubleshooting and repairing complex, distributed hybrid cloud applications. My recent experiences with troubleshooting issues with my Docker WordPress container only reinforce the details I wrote about in this piece. Without my comprehensive understanding of both the infrastructure and application layer I don’t believe I could have achieved resolution (if I have, but more on that later).

1969479-dz-cloud2016cover-lgMy Docker WordPress container has always had issues with the “Error Connecting to Database” issue, but initially it would happen once a month and I would just re-start the container. I had read that the issue was fixed by moving to WordPress 4.5, so I upgraded, which came with its own challenges given these containers are supposed to be immutable.

Unfortunately, I designed my container when Docker architecture was in its infancy and so separating out and linking a MySQL container and the WordPress container as well as storing data on a separate volume are all features which emerged, or became more easily used, in later versions. Eventually, I will need redesign around 1.11 features, but for now, I’m just trying to keep up what I currently have. I did try just moving the database files onto permanent storage mapped in to the container as a volume, but all I did was fight with file permissions for a day and MySQL never ended up starting.

Recently, it became more and more difficult to keep the container up, so I upgraded to the latest Ubuntu 14.04 kernel and when that didn’t seem to help the issue I upgraded Docker from 1.4 to 1.11. None of these seemed to correct the issue. However, Docker 1.11 leverages the new architecture and uses cgroups, which resulted in cgroup out of memory thread killer posting messages to my console.

Screen Shot 2016-04-29 at 6.13.20 AM

Now, I could see that mysqld was being terminated at some point due to insufficient memory. To solve the memory issue, I tried optimizing the WordPress LAMP stack for low memory and even migrated from a 1G virtual machine to a 2G instance. It seems no matter how much memory I threw at this problem the longest the WordPress site would be active before the database connection issue appeared was an hour.

Totally baffled at this point, I started chasing down a lead regarding WordPress issues occurring on my cloud service provider. It seemed the issue I was seeing was happening to many others on Digital Ocean, perhaps this was a VPS (DO’s Droplet architecture is VPS-based) issue and not a Docker issue. DO responded on its forum to the various postings stating that running out of memory is common result of the known XML-RPC Denial of Service attack.  XML-RPC is the API interface for WordPress.

Wait! What am I doing? No one’s going to bother attacking my little old blog, it can’t be that. Back to optimizing memory use. Oh crud, this is still not getting me anywhere after two weeks.

Unfortunately, again my immutable container architecture limited my ability to see logs and SSH connections were often terminated due to low memory as well. Once I terminated the container without committing the container the logs were lost. So, I had to modify the current container to use an external volume for all the log files and now wrote them out to permanent storage.

Whoa! What do I find in the apache2 access.log after the next time the issue occurs? Well, when I did a tail of the last 200 entries I found my site was being attacked by a Googlebot, and there were a lot more entries in addition to those. In the end, I was a victim of a denial of service attack.

I believe its important to look at what data I had available and the characteristics identified by the logs and error messages. Nothing screamed DoS attack consuming mass number of threads on the Apache server and driving memory usage to 0 so that the memory manager was sacrificing threads to keep the OS alive (does that make anyone else think of Kirk screaming to Scotty, “all power to life support”?). When the attack stopped, mysqld_safe restored the thread, but it seems the socket or some other interprocess mechanism didn’t allow WordPress to communicate with the MySQL.

Piecing this together after the fact required a mix of skills. It might have been easier if I was doing live monitoring and tracking inbound requests while also constantly checking that WordPress could communicate MySQL, but realistically, this is a dramatic step when all else has failed.

Through this I learned a lot about container architecture, but this issue is probably still lingering. I’m just denying all requests to access XML-RPC from outside IP addresses at this time and the WordPress has been up for over 24 hours. More importantly, it really reinforces what I wrote about in the article and I don’t believe I could have reached this point if I didn’t have a good understanding of the infrastructure, operating system, networking, Docker and LAMP stack

Read the original blog entry...

More Stories By JP Morgenthal

JP Morgenthal is a veteran IT solutions executive and Distinguished Engineer with CSC. He has been delivering IT services to business leaders for the past 30 years and is a recognized thought-leader in applying emerging technology for business growth and innovation. JP's strengths center around transformation and modernization leveraging next generation platforms and technologies. He has held technical executive roles in multiple businesses including: CTO, Chief Architect and Founder/CEO. Areas of expertise for JP include strategy, architecture, application development, infrastructure and operations, cloud computing, DevOps, and integration. JP is a published author with four trade publications with his most recent being “Cloud Computing: Assessing the Risks”. JP holds both a Masters and Bachelors of Science in Computer Science from Hofstra University.

Latest Stories
IBM helps FinTechs and financial services companies build and monetize cognitive-enabled financial services apps quickly and at scale. Hosted on IBM Bluemix, IBM’s platform builds in customer insights, regulatory compliance analytics and security to help reduce development time and testing. In his session at 20th Cloud Expo, Tom Eck, Industry Platforms CTO at IBM Cloud, will discuss how these tools simplify the time-consuming tasks of selection, mapping and data integration, allowing developers ...
In order to meet the rapidly changing demands of today’s customers, companies are continually forced to redefine their business strategies in order to meet these needs, stay relevant and continue to see profitable growth. IoT deployment and development is integral in this transformation, and today businesses are increasingly seeing the value of investing their resources into IoT deployments. These technologies are able increase ROI through projects such as connecting supply chains or enabling sm...
Most DevOps journeys involve several phases of maturity. Research shows that the inflection point where organizations begin to see maximum value is when they implement tight integration deploying their code to their infrastructure. Success at this level is the last barrier to at-will deployment. Storage, for instance, is more capable than where we read and write data. In his session at @DevOpsSummit at 20th Cloud Expo, Josh Atwell, a Developer Advocate for NetApp, will discuss the role and value...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend @CloudExpo | @ThingsExpo, June 6-8, 2017, at the Javits Center in New York City, NY and October 31 - November 2, 2017, Santa Clara Convention Center, CA. Learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
You know you need the cloud, but you’re hesitant to simply dump everything at Amazon since you know that not all workloads are suitable for cloud. You know that you want the kind of ease of use and scalability that you get with public cloud, but your applications are architected in a way that makes the public cloud a non-starter. You’re looking at private cloud solutions based on hyperconverged infrastructure, but you’re concerned with the limits inherent in those technologies.
As enterprise cloud becomes the norm, businesses and government programs must address compounded regulatory compliance related to data privacy and information protection. The most recent, Controlled Unclassified Information and the EU’s GDPR have board level implications and companies still struggle with demonstrating due diligence. Developers and DevOps leaders, as part of the pre-planning process and the associated supply chain, could benefit from updating their code libraries and design by in...
SYS-CON Events announced today that EARP Integration will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. EARP Integration is a passionate software house. Since its inception in 2009 the company successfully delivers smart solutions for cities and factories that start their digital transformation. EARP provides bespoke solutions like, for example, advanced enterprise portals, business intelligence systems an...
SYS-CON Events announced today that Outscale, a global pure play Infrastructure as a Service provider and strategic partner of Dassault Systèmes, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Founded in 2010, Outscale simplifies infrastructure complexities and boosts the business agility of its customers. Outscale delivers a secure, reliable and industrial strength solution for its customers, which in...
SYS-CON Events announced today that Progress, a global leader in application development, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Enterprises today are rapidly adopting the cloud, while continuing to retain business-critical/sensitive data inside the firewall. This is creating two separate data silos – one inside the firewall and the other outside the firewall. Cloud ISVs oft...
As cloud adoption continues to transform business, today's global enterprises are challenged with managing a growing amount of information living outside of the data center. The rapid adoption of IoT and increasingly mobile workforce are exacerbating the problem. Ensuring secure data sharing and efficient backup poses capacity and bandwidth considerations as well as policy and regulatory compliance issues.
The 21st International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Digital Transformation, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with the 21st International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. @ThingsExpo Silicon Valley Call for Papers is now open.
SYS-CON Events announced today that Interoute has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Interoute is the owner operator of Europe's largest network and a global cloud services platform, which encompasses over 70,000 km of lit fiber, 15 data centers, 17 virtual data centers and 33 colocation centers, with connections to 195 additional partner data centers. Our full-service Unifie...
For financial firms, the cloud is going to increasingly become a crucial part of dealing with customers over the next five years and beyond, particularly with the growing use and acceptance of virtual currencies. There are new data storage paradigms on the horizon that will deliver secure solutions for storing and moving sensitive financial data around the world without touching terrestrial networks. In his session at 20th Cloud Expo, Cliff Beek, President of Cloud Constellation Corporation, w...
SYS-CON Events announced today that Twistlock, the leading provider of cloud container security solutions, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Twistlock is the industry's first enterprise security suite for container security. Twistlock's technology addresses risks on the host and within the application of the container, enabling enterprises to consistently enforce security policies, monitor...