I got my first DDoS (and what you can do to help prevent it)

Поделиться
HTML-код
  • Опубликовано: 18 мар 2024
  • My Products
    📖 ProjectPlannerAI: projectplannerai.com
    🤖 IconGeneratorAI: icongeneratorai.com
    📝 ThumbnailCritique: thumbnailcritique.com
    Useful Links
    💬 Discord: / discord
    🔔 Newsletter: newsletter.webdevcody.com/
    📁 GitHub: github.com/webdevcody
    📺 Twitch: / webdevcody
    🤖 Website: webdevcody.com
    🐦 Twitter: / webdevcody

Комментарии • 292

  • @WebDevCody
    @WebDevCody  4 месяца назад +81

    from all the comments I've read from people smarter than myself, you should probably just use cloudflare.

    • @nickwoodward819
      @nickwoodward819 4 месяца назад

      Does cloudflare protect backend routes? Say when using astro? I'm guessing not and they have a spend cap?

    • @AndrieMC
      @AndrieMC 4 месяца назад

      ​@@nickwoodward819 It'll always protect, unless you disabled prot for that record or ddos ips

    • @WebDevCody
      @WebDevCody  4 месяца назад +10

      @@nickwoodward819it sits in front of ALL your stuff; you point your DNS to cloudflare and it proxies to your API or UI.

    • @nickwoodward819
      @nickwoodward819 4 месяца назад

      @@WebDevCody yeah that's what I'm learning now. here's a thought: am I safer with the safer platform that seems to have less of a problem with DDoS but seems less willing to refund, or the f'ups that are vercel/netlify that are scared of the negative publicity and seemingly will...
      +1 for vps rn

    • @anonanon7368
      @anonanon7368 4 месяца назад +18

      do a video on how to add cloudflare

  • @SeibertSwirl
    @SeibertSwirl 4 месяца назад +154

    lol “$3,000/month so that’s obviously not gonna happen.” I’m sorry, I burst out laughing lol

    • @SeibertSwirl
      @SeibertSwirl 4 месяца назад +1

      @@nobody124... huh?

    • @abhishekkhande8564
      @abhishekkhande8564 4 месяца назад +1

      Wtf 😢

    • @nonstopper
      @nonstopper 4 месяца назад

      Relax. @@nobody124...

    • @DevSecOpsAI
      @DevSecOpsAI 4 месяца назад +6

      they way he said it, just so nonchalant, actually funny

    • @dejangegic
      @dejangegic 4 месяца назад +1

      ​@@nobody124... you dropped this 🤴🏿

  • @tisaname8490
    @tisaname8490 4 месяца назад +130

    getting a huge bill like one of those infamous 100k+ dollars bill aws stories is what scares me

    • @twitchizle
      @twitchizle 4 месяца назад +16

      you dont have any user, you wont get one of those

    • @daphenomenalz4100
      @daphenomenalz4100 4 месяца назад +1

      ​@@twitchizle if we just delete the iam user that is using the services, will it not charge? Or will it still charge because we have a cluster or bucket assigned?

    • @basepasandhai1906
      @basepasandhai1906 4 месяца назад

      @@daphenomenalz4100 yes they will charge if any instances are active and users are hitting your website.

    • @nickwoodward819
      @nickwoodward819 4 месяца назад +15

      It's the $5000 bill that will end your start up but not get enough traction on social media that should scare you

    • @JoshSmeda
      @JoshSmeda 4 месяца назад +1

      Set budget alarms.

  • @LukasSoftwareDeveloper
    @LukasSoftwareDeveloper 4 месяца назад +73

    I like how people rant about cloud solutions. And there is a good example how you can go bankrupt. And we're back on square one - on-premise is the powerhouse of the cell. I prefer dead server and downtime than pay money for stuff I do for fun.

    • @rico454
      @rico454 4 месяца назад +1

      Wouldn’t you have this same issue on prem anyways? If you don’t have any sort of rate limiting or DDOS protection then it doesn’t matter whether you’re on-prem or on cloud. Your machines will end up using more resources like electricity, your cooling systems will need to work harder, and your application will become unavailable to other users, irrespective of whether it’s cloud or not.
      Using the cloud might even have been beneficial in this case because cloud can easily scale

    • @emilemil1
      @emilemil1 4 месяца назад +1

      This. The main reasons I'd go for a cloud solution is if low latency is a must, or if you need a lot of scalability, or if you lack the hardware expertise to manage a server.

    • @nickwoodward819
      @nickwoodward819 4 месяца назад +4

      @@rico454 nah, they aren't likely to be auto scaling, so the service will just go down rather than produce a massive bill

    • @JustPlayerDE
      @JustPlayerDE 4 месяца назад

      @@rico454 i agree, the cloud will for sure scale your wallet no matter what ^^
      unless you make money with something that needs to be online no matter what happens it will only cost you money if it is online no matter what happens, scaling will come with a very big cost at the end if you are not careful enough and uncontrolled scaling can hurt a lot more than a server running a little bit warmer for some seconds.

    • @Akantor111222
      @Akantor111222 4 месяца назад +1

      @@rico454 In what world electricity bill could be hundreds of thousands of dollars? Beside, there is a upper bound to how much on-premise can scale, if you get DDoS-ed and you run out of resource, your server simply goes down. The danger of cloud is that you have access to seemingly unlimited resource and as a result, you don't have an option to just let the server die.

  • @MoreToLore
    @MoreToLore 4 месяца назад +24

    Great video! Would love to see a video on VPS setup and how you would migrate over. Thinking about doing the same with my side projects

  • @TheDonHatim
    @TheDonHatim 4 месяца назад +30

    You're getting in there. The perfect setup is a VPS with Cloudflare as a reverse proxy. Cloudflare also provides a way to write IaC through their Wrangler CLI, if that's your cup of tea. One thing is for sure, all this usage pricing nonsense would go out of the window. A WAF for $3000/month?!!!!!

    • @Adrian_Galilea
      @Adrian_Galilea 4 месяца назад

      I feel you, and somewhat agree, but I don't think it's the right solution for everyone.
      Most people are on free tiers forever that won't incur in payments or have built-in killswitches, by the time they have a "scare" like his and go 250 overbudget(if that happens), you would be even with them after all those years of VPS's not to mention the hours you spent both learning and maintaining.

    • @alexanderhuliakov6012
      @alexanderhuliakov6012 4 месяца назад

      Is using Cloudflare as a reverse proxy ok for API? It's at least more latency for all requests, right?

    • @Kanookoochn
      @Kanookoochn 4 месяца назад

      ​​@@alexanderhuliakov6012its good for rate limiting thepublic api, but yeah its adding more latency

    • @nothassy784
      @nothassy784 4 месяца назад

      @@alexanderhuliakov6012 Used it a lot for my projects, and you don't notice it much at all. The physical location of your server vs. the client would have a much bigger impact than this

  • @wk3
    @wk3 4 месяца назад +13

    When you get a DDOS attack you will probably see a large number of different source IPs. Maybe a dynamic rate limit based on the last x hours with an minimum and maximum can do the trick.
    If you move to a different solution, I would be happy to see it in oneof your videos.

  • @embiem_
    @embiem_ 4 месяца назад

    Nice insights for AWS & SST, thanks!
    I've mainly deployed via EC2 so far and usually without load balancing if it's just a side project. What I use then to handle simple DoS attacks/request spams are some iptables conntrack rules on the actual machine / in the deployed container. The single container also helps having a predictable bill, but ofc won't scale. Whenever a side project actually gets lots of traffic, then I'll upgrade to multiple instances with load balancing.

  • @imkir4n
    @imkir4n 4 месяца назад +1

    And this is some content i always looking for thanks mate

  • @kissuosts4704
    @kissuosts4704 4 месяца назад +3

    interesting to see you change from being AWS enthusiast to seeing the value of a VPS. Am a fan of Vultr for these types of systems.

  • @stevanfreeborn
    @stevanfreeborn 4 месяца назад +2

    I think it's great you are sharing this experience. It really drives home for me the importance of always needing to consider rate limiting up front when beginning a project. Probably even best to implement that rate limiting at the application level too.

    • @WebDevCody
      @WebDevCody  4 месяца назад

      Yeah I obviously need to make my side project more precessional before I bankrupt myself

    • @stevanfreeborn
      @stevanfreeborn 4 месяца назад

      Just love all the content you produce and so appreciative of it.

    • @roughywatcher
      @roughywatcher 4 месяца назад

      I think this is the solution. Isn't nextjs middleware capable of setting request limits. I just asked chat gpt and got:
      // middleware.js or a specific middleware file in your Next.js project
      import { NextResponse } from 'next/server';
      // Example of a very basic in-memory rate limiter
      const rateLimitMap = new Map();
      export function middleware(request) {
      const ip = request.ip;
      const currentTime = Date.now();
      if (rateLimitMap.has(ip)) {
      const { lastRequestTime } = rateLimitMap.get(ip);
      if (currentTime - lastRequestTime < 1000) { // Limit to 1 request per second for example
      return new Response('Rate limit exceeded', { status: 429 });
      }
      }
      rateLimitMap.set(ip, { lastRequestTime: currentTime });
      return NextResponse.next();
      }

  • @kevinzunigacuellar
    @kevinzunigacuellar 4 месяца назад +5

    Funny how technology goes full circle. Back to on premise, it might be slower but it's great for free products.

  • @excalibur2417
    @excalibur2417 4 месяца назад +14

    That's the main reason I avoid pay as you go plans - a ddos attack could really drain your wallet.

  • @fullstack_journey
    @fullstack_journey 4 месяца назад +52

    Would having Cloudflare as a first layer would have prevented it?

    • @lozyodella4178
      @lozyodella4178 4 месяца назад +10

      If correctly set yes.

    • @WebDevCody
      @WebDevCody  4 месяца назад +11

      yeah probably, everyone here says their service is great

    • @perc-ai
      @perc-ai 4 месяца назад

      @@WebDevCodycloudflare is literally the best we use it in production for 4M monthly active users site

    • @StanOgn
      @StanOgn 4 месяца назад

      @@WebDevCody what about if it was on vercel, they say they have some ddos protection...

    • @AndriusLau
      @AndriusLau 4 месяца назад

      @@StanOgn there are articles where you can read how to configure Cloudflare and Vercel. The main issue is caching, so to avoid two layers of caching (in Cloudflare and Vercel), some adjustments are needed.

  • @maazmunir9213
    @maazmunir9213 4 месяца назад +13

    hey cody a full tutorial on switching to a VPS would be really good!

    • @belkocik
      @belkocik 4 месяца назад

      Would love too see how to set up a VPS

    • @paladin9876
      @paladin9876 4 месяца назад

      @@belkocik you put your shit in docker and if you want multiple webapps you use nginx to map the ports to their correct domain, thats pretty much it.

    • @nothassy784
      @nothassy784 4 месяца назад

      @@belkocik It's not fun with initial setup, but it's not that difficult either. A bit more tricky if you want to do everything right with not running as root and per-app users in terms of getting NodeJS up and running for those accounts.
      My usual setup was something like
      Domain from NameCheap
      CloudFlare as DNS, with proxying for protection
      NGINX as reverse proxy to multiple NodeJS apps

  • @larbiishak1974
    @larbiishak1974 4 месяца назад +4

    a vps with containers is the best thing you can do to reduce cost. that saved me from a huge bill.. Strongly advice you to migrate to a vps or use it for new projects

  • @charb423
    @charb423 4 месяца назад +1

    It pains me when I hear about bad actors. I mean we have enough we are dealing with but bad people are real. They are very real and your situation is real. I am sorry this happened to you. On a good side you found a valuable lesson through this and share it with us.

    • @WebDevCody
      @WebDevCody  4 месяца назад

      Yeah, just kind of sucks that you just can’t trust anyone. At least there’s way of prevent it I was just too lazy to actually do the work on my side projects when I should have done it from the get-go.

  • @kurt5457
    @kurt5457 4 месяца назад +1

    Love to see a vid on cloudflare as layer over s3 etc.

  • @ben-gibb
    @ben-gibb 4 месяца назад

    Love how your voice comes through - what mic do you use?

    • @WebDevCody
      @WebDevCody  4 месяца назад

      Mxl 990, got it on Amazon for like $100

  • @jose6183
    @jose6183 4 месяца назад +2

    Yeah a VPS is probably the most reasonable choice in this scenario. Thanks for sharing your experience, I think I'm going to move my projects as well.

    • @oSpam
      @oSpam 4 месяца назад +1

      But a lot of VpS providers still charge Ingress fees. So the 1TB of data might have still added up? Any confirmation on this?

    • @kissuosts4704
      @kissuosts4704 4 месяца назад

      @@oSpamdepends on the provider. Vultr is $0.01 per GB when going over your plan's limit(2TB or more)

  • @EddyVinck
    @EddyVinck 4 месяца назад

    Love these practical real world videos
    Hope you don’t have to make too many of them 😅

  • @ultraquad
    @ultraquad 4 месяца назад +1

    That sucks. Have you thought about having your app in a docker container and let the service manage the amount of cpu cores depending on load but you can set a max cap? I've never done it before so I'm curious on your input if you've done something similar and if there are drawbacks.

    • @sarabwt
      @sarabwt 4 месяца назад

      Don't do it, not worth it on AWS. First off, you have Fargate and if you want to autoscale that it's complicated and expensive anyways (1vCPU + 1GB RAM is 20$ I think), you will then also need an IP which is 3.5$ + you will need a load balancer, which is 20$ + 2 IP (7$) for a grand total of ~50$/month. Congrats, you pay 50$ for 1vCPU and 1GB RAM. It is absolutely criminal. For reference: on Hetzner you can get a server with Intel Xeon E5-1650V3, 256GB RAM + 2 500GB Datacenter SSD disks for this price.
      Pro tip: Don't ever fall for lambda. Yes, you get 1M requests free, but you are locked in, have a weird programming model + if something like in the video happens and you fuck up caching/don't cache some stuff, AWS will skin you alive.
      Pro tip 2: Don't ever host your shit on AWS, pick Linode or something similar and put CloudFlare in front. Hell, pay 5$/month on DigitalOcean and you will get CD for free + have a way better experience because of UI.

  • @lardosian
    @lardosian 4 месяца назад +4

    So in theory a new inexperienced Dev could setup an app on AWS, get ddos's and end up with a bill of around 100K?

  • @zhanezar
    @zhanezar 4 месяца назад +5

    would cloudflare stop this ? , also would love a tutorial on a Digital Ocean type VPS droplet , especially how to host multiple sites

  • @amorto3420
    @amorto3420 4 месяца назад +2

    If you ever decide to host your nextjs projects in a vps, would you please make a little bit detailed video on that?

    • @WebDevCody
      @WebDevCody  4 месяца назад +2

      Yeah doing it soon

  • @underflowexception
    @underflowexception 4 месяца назад

    if you run npm run build on the server itself it will use a good amount of memory assuming it's one of the lower tiers so make sure you build it off the vps and transfer the build files or bake everything pre-built into a container

  • @dr.lazysloth3415
    @dr.lazysloth3415 4 месяца назад

    I'm assuming all cloud solutions have a similar setup/cost.
    I don't have experience with this but does putting an extra anti ddos vps in front of aws help? No idea on the cost but then you don't have to move your apps.
    Curious what path you will take. Great video!

    • @oSpam
      @oSpam 4 месяца назад +1

      To be fair that’s a great idea. It comes with the drawback of too many requests will just make it slower and slower and timeout requests. It would just be like a proxy that filters through traffic. Great idea, I’d love to hear more about this

    • @sarabwt
      @sarabwt 4 месяца назад

      @@oSpam It's a terrible idea and it defeats the purpose of CloudFront.
      You have CloudFront (edge locations) to serve as proxy close to the user and cache the response. For example - you host your site in N. Virginia and I make a request in Italy. Request will go from my home, to the nearest data center to my location, to US, come back to data center, be cached and come to me. The next request a user close to me will make, will not make the round trip to US, but will just return the same response that got cached.
      If you put a proxy in front of cloud front in N. Virginia for example, my request will go from my home, to the proxy in US, to cloudfront edge location, to the server in US, be cached in US cloudfront, be cached on the US proxy, and only then be returned to me. The next request will have to go to US.
      If you have a static site, you would ideally cache everything for a long time on cloudfront and for some time in the browser, and on each deploy, invalidate the cloudfront cache if needed. If you get DDoSed, you will just pay a lot, but there is nothing you can do in that situation.

  • @kubre
    @kubre 4 месяца назад

    VPS with containers where maybe putting restrictions on the container on how much resources it would scale because I've seen single container go up upto 300% and bring down everything

  • @TyMac711
    @TyMac711 4 месяца назад +1

    Sheild "standard" is an option in the CloudFront settings. It may not have been enabled.

    • @WebDevCody
      @WebDevCody  4 месяца назад

      I'm pretty sure it's always enabled by default

  • @abirganguly9099
    @abirganguly9099 4 месяца назад +1

    I think there's is an option to just kill the ec2, lambdas, distributions once it reaches a certain budget. I think it's called budget actions? Like we can set alarms in budget, also actions can be set.

    • @WebDevCody
      @WebDevCody  4 месяца назад +1

      I'll have to read up on that

    • @SogMosee
      @SogMosee 4 месяца назад

      I second budget actions

  • @kaloyangeorgiev6824
    @kaloyangeorgiev6824 4 месяца назад +1

    What about Digital Ocean? They even have applications tab now, without the need for us to set up the servers. Let me know if I am wrong :)

  • @daedalus5070
    @daedalus5070 4 месяца назад +3

    I get so scared by this stuff that I login to my Vercel account to check it even though its on a hobby plan with no billing setup at all 😅

    • @ewwitsantonio
      @ewwitsantonio 4 месяца назад

      Ah you just prompted me to check my hobby account and people have been spamming my sites with tons of bots trying to find vulnerable wordpress paths. :( It's a placeholder site that I don't share the URL of! Nothing is safe :(

  • @nothassy784
    @nothassy784 4 месяца назад

    Could maybe use Varnish if you want the cache benefit

  • @analogsensor
    @analogsensor 4 месяца назад

    I would love to see as an example how to setup and deploy nextjs project to vps.

  • @rexeus
    @rexeus 4 месяца назад +1

    Cloud flare gives it for free .. create a few nodes K8s cluster using tailscale and use cloud flare in front of it and you are golden.

  • @FarisEdits
    @FarisEdits 4 месяца назад

    great video

  • @roberth8737
    @roberth8737 4 месяца назад +16

    This is one of the “easy” benefits you get with Vercel - if something is clearly ddos, they block it or take the charge.

    • @nickwoodward819
      @nickwoodward819 4 месяца назад +3

      Yeah, I'm not relying on their judgment as to whether I should pay them... The fact that they haven't got a spend cap is *nuts*

    • @AndersGustafsson87
      @AndersGustafsson87 4 месяца назад

      They have some automatic mitigation but they dont pay your bill, unless you are a popular content creator

    • @neociber24
      @neociber24 4 месяца назад

      ​@@nickwoodward819 I think they added it the last week

    • @jeremybuckets
      @jeremybuckets 4 месяца назад

      This just isn't true. Plenty of examples online of nobodies getting their DDoS bills refunded.@@AndersGustafsson87

    • @WebDevCody
      @WebDevCody  4 месяца назад

      is that written in writing in their SLA? "we will pay for any DDOS bandwidth your app receives"? I highly doubt it

  • @Kimitri
    @Kimitri 4 месяца назад

    I never used Cloudflare so I have one question if someone can answer me. So, to set Cloudflare to protect my Nextjs application against DDOS it will work like a CDN or a Reverse Proxy? If CDN so basically it will be a CDN above a CDN because SST use Cloudfront ? And if a Reverse Proxy, so basically I'll lose the pros of use Cloudfront to distribute the static content around the world because all the requests will comes from Cloudflare ?

  • @EusebioResende
    @EusebioResende 4 месяца назад +2

    For the size of your projects, I would go with a VPS to keep it as simple as possible (less moving parts). At least until you start having millions of requests a day and making a boatload of money.
    I understand the fun on setting this systems up, but maybe, just maybe, this time you over-engineered it.
    Still great insight so I appreciate the video. Thanks.

    • @WebDevCody
      @WebDevCody  4 месяца назад

      I 💯 agree at this point and I’m moving alll my side projects into a single vps and hosting behind cloudflare

  • @Kimitri
    @Kimitri 4 месяца назад +1

    I don't understand, I thought Cloudfront had a defaut DDOS protection like Cloudflare, if don't it's scare me. Would you post a video setting Cloudflare in your project? Because I search a lot for it include in official SST discord and I had not find a proper way to do it.

    • @WebDevCody
      @WebDevCody  4 месяца назад +1

      Cloudfront has shield standard which says they handle some ddos 🤷‍♂️

    • @Lostlabs
      @Lostlabs 4 месяца назад

      @@WebDevCodythey handle everything basically if you know what you’re doing basically you can set up a reverse proxy on your backend and block all requests bypassing cloudflare

  • @elvisike3110
    @elvisike3110 4 месяца назад

    Please make a video of
    - your deployment process to AWS including docker config and shell scripts for full-stack and backend projects.
    - setup with cloudflare
    - setup with services like digital ocean
    Thank you
    🙏🙏

  • @sylarfx
    @sylarfx 4 месяца назад

    you can also limit number of concurrent lambda instances, the default is 1000

  • @m_hussain_mustafa
    @m_hussain_mustafa 4 месяца назад +4

    I usually do the poor mans (hard budget limit) DDOS protection for my side-projects. If I go over $10 bucks then just shut down the project. 😀😅. Great video though.

    • @nicholas4523
      @nicholas4523 4 месяца назад

      Is there guide to how to do this?

    • @comosaycomosah
      @comosaycomosah Месяц назад

      i sshould prolly splurge this fiscal year and push mine from 5 to 10$ lol

  • @heyjitendra
    @heyjitendra 4 месяца назад

    Cody I think CF has got DDOS protection on free plan too...
    Also can you try hetzner. I am currently hosting the server on it used by like 2000-3000 folks at my college.
    Some things I miss is dev preview deployments, edge middleware... Speed is descent

    • @neevot
      @neevot 4 месяца назад

      On Hetzner you have around 20 TB free, but after you start to pay pro consumed TB, but they also have an anti ddos in place

    • @heyjitendra
      @heyjitendra 4 месяца назад

      Yea I am surprised that even entry level vps have 20TB bandwidth. So it's great@@neevot

  • @bdotsamir
    @bdotsamir 4 месяца назад

    i've seen a couple of other comments asking this, but why wouldn't you use something else like Cloudflare to proxy all of your traffic before it hits AWS?

    • @bdotsamir
      @bdotsamir 4 месяца назад +1

      Oh, I hadn't gotten to the point in the video before commenting this. You mentioned cloudflare has DDoS protection for $20/mo. That's actually not entirely true, you *can* get DDoS protection for free, though I'm not sure what the licensing agreement is (commercial uses etc etc)

  • @EduarteBDO
    @EduarteBDO 4 месяца назад

    I think you can configure you aws to hard shutdown if billing go above a defined value, but I'm not so sure. This can work for pet projects that you don't care if they go off. This can prevent creating an infinite loop while developing and getting an infinite bill too.

    • @TheStruders
      @TheStruders 4 месяца назад

      No you can't.. you can setup billing alerts that tell you when you hit a limit, but nothing is going to shut down

    • @EduarteBDO
      @EduarteBDO 4 месяца назад

      @@TheStruders yeah after that I went looking, and it seems that I have to code a hard shutdown myself using lambda and billing event. I think I'll try doing that for my pet project. Not really a hard shutdown but just turning off the public access of any api

    • @SogMosee
      @SogMosee 4 месяца назад

      @@EduarteBDO can you programmatically turn off cloudfront access too? I know you can add deny policy to apigw, but apigw wasnt what got dos here

    • @EduarteBDO
      @EduarteBDO 4 месяца назад

      @@SogMosee I don't know much about cloudfront but with aws sdk you can do pretty much anything that you can do in the console, so in the worst case you can delete the cloudfront configuration.

  • @Meow-cr1tq
    @Meow-cr1tq 4 месяца назад

    Im new to your channel, are u using a bot to like the comments? (just out of curiousity)

  • @ismailzahhar
    @ismailzahhar 4 месяца назад

    I think if you contact AWS support and clarify you got an attack, they can reduce the costs

  • @taquanminhlong
    @taquanminhlong 4 месяца назад

    i think you should move your frontend to the edge and backend to your own vps, and it would be much cheaper if your backend does not eat too much resources, like when you write them in go or rust

    • @WebDevCody
      @WebDevCody  4 месяца назад

      the front end is what caused this high charge; it was all the requests to the VPN cache

    • @oSpam
      @oSpam 4 месяца назад

      @@WebDevCodyCDn? Yeah you’re right. They probably didn’t watch the video 😅
      I think too many people are suggesting bad rush moves. They need to watch your other video on why to never use a VPS for production 😂

  • @javisartdesign
    @javisartdesign 4 месяца назад +1

    Just bought a raspberry pi and create your own homelab to host your services

  • @Daddyjs
    @Daddyjs 4 месяца назад

    more vids like this, thanks

  • @gymothybumpkins
    @gymothybumpkins 4 месяца назад

    Any idea why/who ddos'd you? Might be interesting to see a tear down of that. Was it from many ips or just 1?

    • @WebDevCody
      @WebDevCody  4 месяца назад

      I didn’t setup real monitoring and logging either 😂 no clue what the ip

  • @REAZNx
    @REAZNx 4 месяца назад +3

    How come you dont use Vercel, Netlify, or something similar? I used to use a cheap VPN for everything, then moved to Vercel for the convenience of CI/CD, DDoS protection, scalability etc.

    • @nickwoodward819
      @nickwoodward819 4 месяца назад

      You still get charged if attacks get through, which they do. Limiting spending caps to pro plans is also BS

    • @REAZNx
      @REAZNx 4 месяца назад

      @@nickwoodward819 Yeh they do in some cases, but as we've learned from twitter, tweeting about it gets that sorted fairy quick. But for what they offer for the price, its extremely entising

    • @karlembeast
      @karlembeast 4 месяца назад

      Can't you use the free plan from Vercel?
      Since it doesn't require a payment method (ex. credit card,) you won't get charged.
      Or is the free plan too limiting?

    • @oSpam
      @oSpam 4 месяца назад

      @@karlembeastusing the free plan can still get you charged though most likely. Just because you don’t have a linked card doesn’t mean you don’t sign a contract with them. It’s likely illegal to just not pay, you’d need to speak to their support

    • @nickwoodward819
      @nickwoodward819 4 месяца назад

      @@karlembeast Just because you've not provided a card doesn't mean you don't owe the money

  • @hari9321
    @hari9321 4 месяца назад +2

    I still remember the day webdevcody told he will never use a bare server for any deployment. Now he realises the risk in not using a simple vps in place for aws services.
    I have this fear all day when I use aws which make sure i learned how to setup and maintain a $5 vps 😂

  • @Techgether
    @Techgether 4 месяца назад

    Is it not possible to set rate limit on fetching the API on your end? Since WAF is also using just IP address to set the restrictions.

    • @WebDevCody
      @WebDevCody  4 месяца назад +1

      I’m getting charged for CDN requests, not from api requests

  • @mettle_x
    @mettle_x 4 месяца назад +1

    DoS and DDoS are two different attacks. I think you got the DoS attack, not DDoS if most of the requests are coming from a few IP addresses. DDoS is not easily preventable using simple rate limiting. To prevent DDoS, consider dynamic rate limiting like exponential backoff strategy, mix of global limits, per IP & per user rate limits, browser checks and ML based captchas, CSRF tokens, no direct IP access (domain-bound to server app), no direct A record to DDoS mitigator like Cloudflare - use AAAA record and set firewall to block IPv4 to your virtual servers and Cloudflare will handle IPv4 traffic and route it to your IPv6 only servers. These will prevent IPv4 based devices/botnet to join the DDoS attack.

    • @WebDevCody
      @WebDevCody  4 месяца назад +1

      I trust what you say. I didn’t have monitoring setup or logging to view ip addresses so at this point I’m in the dark 😂

  • @ordinarygg
    @ordinarygg 4 месяца назад

    Welcome to reality) great video!

  • @The23Chika
    @The23Chika 4 месяца назад

    Id totally use a vps. It’s cheap. It’s fun to setup; it gives you a ton of flexibility. And it’s just 20 bucks a month including a Plesk license. VPS all the way

  • @aspirine17
    @aspirine17 4 месяца назад +1

    Why cloudfront didn't rate limit it?
    It has rate limit by default, you can't write while (true) fetch. script, after few request's it will start returning 429 error
    So was all this bandwidth made from thousand of IPs or how?

    • @oSpam
      @oSpam 4 месяца назад

      I believe like he briefly mentioned in the video that he didn’t use Cloudflare. Likely used Route53. Which out of the box just comes with DNS and not WAF. You’re correct, with CF you get an ootb firewall - not sure how good it is but I know it works at least. He was asking in the video if he should use cloud front, probably is a good plan

    • @aspirine17
      @aspirine17 4 месяца назад

      But still, he had cloudfront why didnt it block requests

    • @oSpam
      @oSpam 4 месяца назад

      @@aspirine17 did he say that though? Like I say, he likely just used Route53. If he does, yeah the default settings should protect. Though personally I add additional rate limits and block suspicious activity in cloudflare for free under their “10 free rules”

  • @AndriusLau
    @AndriusLau 4 месяца назад +17

    Cloudflare?

    • @neociber24
      @neociber24 4 месяца назад +1

      Doesn't cloudflare have limited support for node?

    • @AndriusLau
      @AndriusLau 4 месяца назад

      @@neociber24 what about node? Use Cloudflare proxy, nothing to do with node

    • @WebDevCody
      @WebDevCody  4 месяца назад +1

      what's your question? I talk about cloudflare in this video.

    • @AndriusLau
      @AndriusLau 4 месяца назад

      @@WebDevCody I watched half of your video, and just suggested to put a Cloudflare proxy to avoid these situations. Cloudflare has a free plan that gives the DDOS protection. just the free plan has simple Bot mitigation. From docs:
      All Cloudflare plans offer unlimited and unmetered mitigation of DDoS attacks. Customers are not charged for attack traffic ever, period. There’s no penalty for spikes due to attack traffic, requiring no chargeback by the customer.

    • @heyjitendra
      @heyjitendra 4 месяца назад

      I think he meant cloudflare for managing DNS and you will get free DDOS protection I guess@@neociber24

  • @complikatd
    @complikatd 4 месяца назад +1

    What about just using Cloudflare as your CDN?

  • @bk1507
    @bk1507 4 месяца назад +5

    cloudflare ddos is best in class

  • @bedirhancelayir3295
    @bedirhancelayir3295 4 месяца назад

    Having same concerns for side projects eventually i think i will go through same path to vps

  • @leetkhan
    @leetkhan 4 месяца назад

    I’m surprised you didn’t use CF. It’s like budget deployment 101

  • @krisbude9607
    @krisbude9607 2 месяца назад

    About 2 years ago I reached the limit of my free tier firebase just by forgetting my dependency array in a useEffect in React .... very very quickly! . Anyway... it took me quite some time to figure out what what happening. Maybe someone tried to access your api in this way by accident?

  • @taylororeilly5506
    @taylororeilly5506 4 месяца назад +2

    Amazon could just do what everyone has been asking for years and make a killswitch for when the bill goes over a threshold but then again Bezos may need to buy a new space weiner so nevermind

  • @crazycode2578
    @crazycode2578 4 месяца назад +2

    vercel has Basic DDoS Mitigation on Pro plan

    • @nickwoodward819
      @nickwoodward819 4 месяца назад +5

      so the up sell is that below their Pro plan they're inadequate?

    • @nickwoodward819
      @nickwoodward819 4 месяца назад +1

      @@zeusvargasLaughably only if you *pay* for the Pro tier. So they're admittedly leaving you exposed as a customer because you're on the wrong tier. Vercel are a joke.

    • @andy-hb1ln
      @andy-hb1ln 4 месяца назад

      @@nickwoodward819if you don't pay for the pro tier, they don't have your CC. so there is no way for them to charge you if your hobby tier site gets ddosed.

    • @maitre999
      @maitre999 4 месяца назад

      ​@@nickwoodward819 pro tier 20$, i think you are the joke 😂 Maybe you want that your bill will be negative one also?

    • @nickwoodward819
      @nickwoodward819 4 месяца назад

      @@maitre999 Not sure that I care what you think if that's the level of English you use to express your thoughts, but just for the hard-of-thinking at the back:
      *The cost of the pro tier quite obviously doesn't justify the gutting of basic spending controls in the free plan. No one should expect to be left vulnerable to massive bills because they haven't upgraded*
      It could be $3 and there would be no justification for *not* having spending caps when they're obviously available.

  • @shivanshubisht
    @shivanshubisht 4 месяца назад

    use free cloudflare dns + ddos protection instead?

  • @frostytf2
    @frostytf2 4 месяца назад

    Are things like Vercel free tier really not capable of providing enough functionality for what you need, especially since these are "free side-projects" ?

    • @WebDevCody
      @WebDevCody  4 месяца назад +1

      you can't host commerical applications which make money (which my side projects do sometimes make money) on vercel free plan according to their license.

  • @GeraldScholz
    @GeraldScholz 4 месяца назад

    VPS with cloudflare on front. Good enough for semi small projects

  • @feralaca123
    @feralaca123 4 месяца назад

    This services are not meant for hobby projects. I allocate a fixed amount of money per month on my hobbies: books, manga, and my two websites. I make sure I never spend more than that

  • @TheStruders
    @TheStruders 4 месяца назад

    If you contact AWS support and prove that you got attacked, its the first time, and you've now setup WAF, they'll refund you the cost of the attack

  • @electricshmoo
    @electricshmoo 4 месяца назад

    Cloud is such a waste of money. Still don't understand why everyone drinks that Koolaid..

  • @supersonicph
    @supersonicph 4 месяца назад

    request limiter may help?

  • @combatLaCarie
    @combatLaCarie 4 месяца назад

    have a script that shuts down the machine if get a billing alert etc. But yeah, I wont touch aws for personal stuff. But yes of course, your service goes down during that time. But that's fine for personal stuff. And your service might be down from the ddos anyway!

  • @Cyber_Lanka
    @Cyber_Lanka 4 месяца назад

    Isn't Cloudflare a good solution for this?

  • @kasper369
    @kasper369 4 месяца назад

    Can we get a video on deploy next.js using sst , preety plz

    • @vitinhuffc
      @vitinhuffc 4 месяца назад

      search the channel, you'll find this video

  • @anonymoussloth6687
    @anonymoussloth6687 4 месяца назад

    Is it possible to add cloudflare to a sst project?

    • @WebDevCody
      @WebDevCody  4 месяца назад +1

      Yeah, just don’t use route53 and instead point your domain to cloudflare and then point cloudflare to your cloudfront distribution I think

  • @micosair
    @micosair 4 месяца назад

    I`m looking into AWS for their GPU instances(AI stuff) - otherwise I woudnt touch that behemoth with a 10 foot pole - too confusing,too big,too enterprisey and huge risk of this stuff happening if you dont have a PHD in AWS.

  • @bnssoftware3292
    @bnssoftware3292 3 месяца назад

    Doesn't AWS provide some sort of free built in ddos prevention?

    • @WebDevCody
      @WebDevCody  3 месяца назад

      I think aws shield advanced does but it’s 3k a month

  • @albertoarmando6711
    @albertoarmando6711 4 месяца назад

    doesn't digialocean charge a fixed amount per month? I'm not sure why people insist on running AWS (or any cloud) for small projects. Even a cheap shared hosting will do in most cases.

    • @benardallotey
      @benardallotey 4 месяца назад

      The thing is that free is still cheaper than cheap. This definitely helps weigh the pros and cons, but I’ll still use google cloud run with a max instance of 1 before I use a VPS.

  • @Anshucodes
    @Anshucodes 4 месяца назад

    what to use to prevent ddos on aws something almost free !

  • @cryMoreLoL
    @cryMoreLoL 4 месяца назад

    Rate limits are easily circumvented.

  • @JakobRossner-qj1wo
    @JakobRossner-qj1wo 4 месяца назад +5

    Why not use Vercel or Netlify? Then you are not longer responsible for DDOS attacks and you don't have to pay additionally for this protection.

    • @doreto95
      @doreto95 4 месяца назад +3

      This is not true. Netlify or Vercel will still charge you for execution time and bandwidth.

    • @crazycode2578
      @crazycode2578 4 месяца назад

      ​@@doreto95 but vercel has basic DDoS Mitigation on Pro plan

    • @GabrielSouza-sz5ju
      @GabrielSouza-sz5ju 4 месяца назад

      @@doreto95 Didn't they recently implement soft and hard limits (at least I'm sure Vercel did) because of a scandal where somebody got charged $100k on their hobby project?

    • @nickwoodward819
      @nickwoodward819 4 месяца назад

      Incorrect, you should change this comment - Vercel and Netlify *DO* charge you for attacks, and if their protection was adequate enough they wouldn't provide spending caps to Pro account holders like it was a benefit

    • @JakobRossner-qj1wo
      @JakobRossner-qj1wo 4 месяца назад +1

      Hey guys, sure Netlify or Vercel charge for execution time etc. BUT they handle DDOS protection for you without you having to pay extra.
      AND they are willing to not charge users if their protection failed.

  • @mind.journey
    @mind.journey 4 месяца назад

    My question is how can you manage to spend $11 per month with 5+ apps, cloudfront, S3, possibly ELB, RDS, Redis cache, etc?

    • @WebDevCody
      @WebDevCody  4 месяца назад +1

      2 of my apps use convex free tier, 1 of my applications used planetscale free tier for a year, another 2 application use supabase db free tier

  • @hamzadlm6625
    @hamzadlm6625 4 месяца назад

    sorry for your money loss and thank you for sharing the knowledge

  • @darrenhinde2971
    @darrenhinde2971 4 месяца назад

    Does SST work with nextjs14?

  • @parisosuch7326
    @parisosuch7326 4 месяца назад

    step one: put a hard limit/budget cap on your third party service
    I don’t know if AWS doesn’t support this but other third party 4:18 applications do

    • @TFDusk
      @TFDusk 4 месяца назад

      They do. The budgeting service he showed has the option to cut off all services at a certain price. He may not want to do that for what I can only guess to prevent disruption for users.

  • @meslzy
    @meslzy 4 месяца назад

    But why ppl do ddos? I'm afraid now for lunching my software 😢

    • @kriansa
      @kriansa 4 месяца назад

      Don't be, it's not nearly as common as you might think. You should be worried about not finding users.

  • @Calmac_
    @Calmac_ 4 месяца назад

    Cloudflare is your answer my dude

  • @anasouardini
    @anasouardini 4 месяца назад

    What's with these D-DoS attacks? what do they even gain from this? are they even competitors?

  • @mariusoprea8587
    @mariusoprea8587 4 месяца назад

    Sad that happened 🙁 have you tried to contact AWS and explain them the situation? Maybe you get a refund for that? 🤔

  • @frank13621
    @frank13621 4 месяца назад

    I keep seeing AWS horror stories for normal people and small businesses. Seems absolutely ridiculous to not have a way to set a cap. I have an app that is going to need infrastructure setup soon and I am wondering if there are any other options.

  • @arpitgoyal189
    @arpitgoyal189 4 месяца назад

    so you that means that any attacker can actually do an ddos on side project website that doesnt pay for waf are vulernable thats not good for amazon

    • @WebDevCody
      @WebDevCody  4 месяца назад

      Even if you pay for waf I think they still charge you per request? Idk you’d think off of this would be very black and white to understand, but it’s not

  • @kasper369
    @kasper369 4 месяца назад

    Can you not just code a rate limit , i am sure the code for rate limit and little bit ddos prventation code will be easy no?

    • @WebDevCody
      @WebDevCody  4 месяца назад

      not when the static assets are hosted on a CDN; then you have no code that executes.

  • @user-tb4ig7qh9b
    @user-tb4ig7qh9b 4 месяца назад

    I hope this fixes your problem

  • @Pharoxx105
    @Pharoxx105 4 месяца назад

    I think it’s ridiculous you have to understand all of these stuff just to not get a giant bill. Can’t see myself using AWS or similar services… I’m very confident I know what I’m doing and still I feel like I’m taking a risk with these services because one wrong misconfiguration and they can totally bankrupt me? No thanks. I prefer to pre-pay for hosting and not worry about that stuff. What’s the point of using a managed hosting service if you still need to worry about stuff like this?

  • @Admin...
    @Admin... 4 месяца назад

    AWS should provide DDos protection for free for their overpriced services. They literally making bank right now lol

  • @moneymaker7307
    @moneymaker7307 4 месяца назад +3

    AWS are probably the one Sponsoring the attack. There is a conflict of interest if you have to pay cloud service provider for ddos attach.
    You got attack now you have to pay for a service

  • @jeremybuckets
    @jeremybuckets 4 месяца назад

    3:39 AWS pricing is absurd once you start to do something even remotely interesting. I can't wait until SST has first class Cloudflare support.