Hi there 👋

Incoherent ramblings from a Principal Magento Engineer. Covering SRE / Devops / Platform Eng / Magento Dev

Stop Overpaying for New Relic Data Ingest by reducing Tracing Data

I was doing some health checks on some new brownfield projects we’ve taken on recently, ahead of migrating them to our own infrastructure. And I noticed that their NewRelic invoices seemed abnormally high for the amount of traffic the stores received. I was expecting most of the stores to still be in the free tier, or at least under 200/300GB total ingest. Looking at the “Manage Data” account page in NewRelic....

August 27, 2024 · 2 min · 339 words · Me

Magento Trojan Orders (CVE-2022-24086) - addAfterFilterCallback

So it appears the Magento 2 Trojan order exploit (CVE-2022-24086) is making the rounds again. With the recent rise in exploit attempts I am going to go out on a whim, and assume the exploit kit was recently sold/released again. Trojan Order was identified and patched back at the start of 2022. The relevant security Bulletin is APSB22-12. It states versions 2.3.0 to 2.3.3 are not affected but any other versions below 2....

August 16, 2024 · 3 min · 511 words · Me

Magento 2 Optimising Static Content Deploy

Typically a lot of Magento 2 stores are slow to build, some taking up to and over an hour. This becomes a bigger pain point as stores grow and more themes & locales are added. Often optimising build time is often towards the bottom of the priority list. The Magento Static Content Deploy Docs provides a good amount of detail on this subject, and is a good read. Just remember, typically, your pipeline execution time also affects your time to release fixes to critical production issues....

August 12, 2024 · 4 min · 641 words · Me

How to debug Magento Javascript components in DevTools

Often when debugging frontend functionality, I find myself reaching for access into Magento Javascript components. To either read the current state or invoke various methods within that component to test return values. But how do we do this? How do we get, lets say, the current quote? It’s quite simple really, we just call require instead of define like we would in a component. Slap a debugger call in the body and now you can play with that component to your hearts content....

August 8, 2024 · 1 min · 139 words · Me

Cleaning Up Github Actions Artifacts via cli

There are a handful of guides on how to clean-up old Github Action Artifacts. The issue I have with the ones I’ve seen, is they are really convoluted solutions for such a simple task. I am making an assumption here that you are using the Github CLI tool. If you are not, then your missing out, go give it a go (even just for this task). You can even use the CLI directly within your workflows if you can to run the clean-up as a nightly task etc....

August 5, 2024 · 2 min · 261 words · Me

Blocking TOR exit routes

One of my clients have recently seen a surge in TOR traffic with zero conversion from them. And has requested for them to be blocked, since its no point in autoscaling the infrastructure, leading to increased cost, for non converting anonymous traffic. We have a few different ways to block TOR/Onion traffic, firstly we can just click some buttons in cloudflare and problem solved. But thats boring, and does not protect us if we move away from Cloudflare in the future (maybe they’ll deem we are a ’enterprise’ at some point 🙃)....

July 22, 2024 · 2 min · 298 words · Me

Simple 2 line fix for Polyfill.io Malware in Magento 2

A simple two line Nginx config update can remove any reference of the polyfill Malware from coming out of your store. What is the Polyfill.io Malware? As you likely have already heard, the polyfill.io domain has been serving malware. And there is still a concerning number of sites that still are including scripts from that domain. Cloudflare and Fastly have both released alternative services that only require a change of domain....

July 12, 2024 · 2 min · 293 words · Me

Check if your Magento site is safe from CosmicSting (CVE-2024-34102)

I’ve been sat on this post and POC for CosmicSting (CVE-2024-34102) for a little while, giving time for stores to patch the vulnerability. Chances are, if you still have not applied the patch your store will have been probed and compromised by now since there are a handful of POCs out in the wild. So I highly encourage you to make sure the patch is applied (its simple, a single file diff)....

July 7, 2024 · 2 min · 333 words · Me

Flushing Magento 2 Varnish Like a Pro

Flushing Magento 2 cache is simple right? Just click the Orange “Cache Clear” button in the Admin, or run php bin/magento cache:clean from the command line. Speaking to other developers and merchants, this seems to be the way everyone deals with refreshing cached content. Even if its just affecting a single page or product. It does not take a genius to realise flushing the entire Magento cache, means a significantly lower cache hit rate for the short term....

June 4, 2024 · 2 min · 383 words · Me

How to delete spam customer accounts in Magento2

Summary Over the last few years, we’ve noticed an increase in the complexity of spam bots signing up to Magento 2 stores. They used to just spam customer accounts using the same email/email domain likely on ending in .qq.com .ru etc. So it used to be easy to just bulk delete based on the TLD especially for sites that do no ship to China / Russia etc. Whereas the last few years I’m observing them using standard mail providers such as gmail....

May 24, 2024 · 3 min · 598 words · Me