How do I protect my D2C store from DDoS attacks and bad bots?

Practical protection for small D2C brands against DDoS attacks, scrapers, card testing and fake sign-ups: CDNs, AWS Shield, WAF rules and rate limits.

Anadoris Digital · · 4 min read

Surveillance camera shadow
Photo: Siarhei Horbach / Unsplash (CC0)

Not every traffic spike is good news. Some come from bots scraping your prices, testing stolen cards on your checkout, creating fake accounts to abuse a sign-up offer, or flooding your site to knock it offline. During a sale or a limited drop, bots can also try to buy up stock before real customers get a chance.

Small brands are not too small to be targeted. Automated attacks scan the internet for anything reachable. The aim is not perfect protection but sensible layers that stop common attacks cheaply and alert you to the rest. Each layer should be simple enough that your team understands what it blocks and how to adjust it when a real customer gets caught.

Know what you are defending against

  • DDoS attacks: floods of traffic meant to overwhelm your site or API.
  • Scrapers: bots copying prices, product data or content.
  • Card testing: bots trying stolen card numbers through your payment flow.
  • Credential stuffing: bots trying leaked passwords on customer or admin logins.
  • Fake sign-ups and coupon abuse: bots exploiting first-order discounts or referral offers.
  • Inventory hoarding: bots adding limited stock to carts to block real shoppers.

What hosted platforms already cover

Shopify and similar platforms protect their storefronts and checkouts with their own network defences and bot protections, and payment gateways run fraud checks. You still choose settings, such as requiring verification on account creation and enabling the fraud tools your gateway provides. The bigger gap is anything custom: a headless frontend, an API, a webhook receiver, an internal tool or a promotional microsite.

Layers for the systems you own

  • Put every public endpoint behind a CDN such as CloudFront, which includes AWS Shield Standard for common network-level attacks at no extra charge.
  • Keep origins private so attackers cannot bypass the CDN and hit servers directly.
  • Add AWS WAF with AWS managed rule groups for common web exploits and known bad sources.
  • Use rate-based rules to limit how often one source can call login, sign-up, coupon or checkout-related endpoints.
  • Consider AWS WAF Bot Control or a CAPTCHA or challenge on sensitive actions such as sign-up.
  • Verify Shopify webhook signatures so only Shopify can trigger your order processing.
  • Protect admin tools behind single sign-on or an IP allow list, not just a password.

Other providers, such as Cloudflare or Akamai, offer comparable layers. Choose based on where your systems run and what your team can manage. Check current pricing for firewall rules, bot control and request volumes before enabling them broadly.

Watch for unusual patterns

Turn on WAF logging and set alarms for sudden rises in blocked requests, error rates or traffic to sensitive endpoints. Watch business signals too: a burst of failed payments, many new accounts from similar email patterns, or a coupon redeemed far more than expected. These often reveal bot activity before infrastructure metrics do. Share a short list of these signals with your support and marketing teams, who are often the first to notice odd orders or complaints.

During an attack

  • Confirm it is an attack, not a successful campaign, by checking sources and patterns.
  • Tighten rate limits or enable challenge rules on the affected paths.
  • Block clearly malicious sources, countries you do not sell to, or specific patterns, temporarily.
  • Pause affected offers if coupons or sign-up rewards are being abused.
  • Contact your provider's support if the attack overwhelms your defences, and tell your payment gateway if card testing is involved.
  • Afterwards, record what happened and turn the temporary rules you kept into permanent ones.

AWS Shield Advanced adds dedicated DDoS response support and cost protection features, at a significant subscription cost. Most small brands do not need it, but check current terms if you face repeated large attacks.

Protect admin and staff logins too

Attackers often go after the people rather than the website. Staff accounts on Shopify, your AWS account, email and courier dashboards are valuable targets, and a stolen password can do more damage than any flood of traffic. Require multi-factor authentication on every staff login, remove accounts for people who have left, and give each person only the permissions they need.

For custom admin tools, avoid exposing login pages to the whole internet where you can. Place them behind single sign-on, a VPN or an IP allow list, and add rate limits and alerts for repeated failed logins. These steps block a large share of automated attacks without any effect on customers.

Where to start

List every public endpoint you own outside your commerce platform. Make sure each one sits behind a CDN with its origin hidden. Add AWS WAF with managed rules and a rate limit on login and sign-up routes, and turn on logging. Then review your payment gateway's fraud settings and your store's account sign-up protections before your next sale or drop, when bots are most active.

Related service: AWS & Cloud Management · More on this topic: AWS & Cloud Management articles

Common questions

Is my Shopify store protected from DDoS attacks?

Shopify protects its platform and your storefront with its own network defences, so you do not need to buy separate DDoS protection for the store itself. Custom apps, APIs and sites you host elsewhere are your responsibility and need their own protection.

What is AWS WAF?

AWS WAF is a web application firewall that inspects requests to CloudFront, load balancers and API Gateway. You add rules, including AWS managed rule groups, to block common attacks, rate-limit abusive sources and filter bots. You pay based on rules and requests, so check current pricing.

How do I stop bots from using my discount codes?

Limit codes to one use per customer, require account verification, rate-limit sign-ups and coupon checks, and watch redemption patterns. Avoid publishing high-value codes openly. For new-customer offers, consider adding challenges or verification steps to sign-up.

What is card testing?

Card testing is when fraudsters use bots to try stolen card numbers through small purchases or payment attempts to see which work. Signs include many failed payments in a short time. Enable your gateway's fraud tools, add rate limits and challenges, and alert on spikes in failures.

Your next chapter

Let’s build what comes next.

A new website. A better system. A simpler way to work. Tell us where you want to begin.

Discuss your project