• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Amazon AWS Blocking

Scheduled Pinned Locked Moved Firewalling
7 Posts 5 Posters 1.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    MaxBishop
    last edited by Aug 31, 2020, 9:02 PM

    I have 5 WAN-exposed ports on my firewall (SSH on non-standard ports). I restrict incoming traffic using pFBlocker. I also use Suricata to monitor traffic on the WAN and the LAN.

    I have noticed an increasing number of intrusion attempts from AWS EC2 sources. I have also noticed an increasing number of Suricata TLS events (invalid handshakes, invalid certificates, invalid traffic).

    I would like to block every Amazon AWS connection, outbound and inbound, at the firewall. We have no interest in anything provided by AWS servers. The address space for AWS IPs is enormous and I assume that blocking the CIDRs using pFBlocker would significantly impact performance.

    Is there a prudent way to block all outgoing and incoming traffic to and from Amazon AWS servers?

    ? 1 Reply Last reply Aug 31, 2020, 9:25 PM Reply Quote 0
    • ?
      A Former User @MaxBishop
      last edited by A Former User Aug 31, 2020, 9:35 PM Aug 31, 2020, 9:25 PM

      @MaxBishop You can block by ASN. Thing is if you block AWS a huge number of websites will not work. Guess you're ok with that? Lots of firewall rules will slow things some. What hardware do you have?

      1 Reply Last reply Reply Quote 0
      • M
        MaxBishop
        last edited by Aug 31, 2020, 10:40 PM

        Hi,

        My system:
        4-core AMD Ryzen 3 (Typically 2-10% usage)
        8070 MiB (Typically 17% in use)

        I expect users to bark at me if block the entire address space. Whitelisting any sites that are mission critical (and those sites that the big boss wants to visit) is my preliminary strategy.

        I now see your post from Dec 22, 2019 describing how to create aliases from ASNs. My research shows that the ASN of interest is 14618.

        If I have that right, I'll give it a whirl.

        ? 1 Reply Last reply Aug 31, 2020, 10:59 PM Reply Quote 0
        • ?
          A Former User @MaxBishop
          last edited by A Former User Aug 31, 2020, 11:22 PM Aug 31, 2020, 10:59 PM

          @MaxBishop
          **** Why not setup a vpn and allow users past the firewall that way and do away with the open ports? ****

          Amazon has lots of ASN's. https://bgp.he.net/ is a good tool to use for lookups. Just put Amazon in the search box. I see 15. I think, don't know, that they use address blocks as needed and any organization by ASN is long gone. It'll be hit or miss. Is the boss going on holiday? That would be a good time to have a go at it... ;)

          That hardware should be fine. pfsense manages large tables (aliases) pretty well (2.4.5 issue not withstanding and that's been fixed).

          I do wonder if this is much to do about nothing. Scans (script kiddies) are common. If your up to date with your software they can bang away at the front door, they're not going to get in... Be sure the cure is not worse than the disease.

          If you know how you could write a rule for suricata that blocks any ssh traffic from ip's other than your trusted users...

          1 Reply Last reply Reply Quote 0
          • S
            serbus
            last edited by Sep 1, 2020, 4:02 AM

            Hello!

            https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html

            John

            Lex parsimoniae

            1 Reply Last reply Reply Quote 0
            • J
              johnpoz LAYER 8 Global Moderator
              last edited by johnpoz Sep 1, 2020, 4:19 AM Sep 1, 2020, 4:11 AM

              @MaxBishop said in Amazon AWS Blocking:

              I would like to block every Amazon AWS connection, outbound and inbound

              You understand this is going to stop you from talking quite a bit of stuff on the internet.. Shit is not going to work that you prob want to work.. A lot of stuff is hosted on aws IPs..

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              1 Reply Last reply Reply Quote 0
              • P
                pwood999
                last edited by pwood999 Sep 9, 2020, 3:43 PM Sep 9, 2020, 3:42 PM

                If your SSH users coming from specific IP ranges, then change the inbound SSH rule to only allow their IP's.

                Better still get remote users to connect via VPN first.

                You could also report the offending AWS IP to Amazon. It might be script kids using the free AWS trials ?

                Who's using AWS hosting

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received