-1

I have a list of IPs and I want to filter out the IPs that come from AWS. Fortunately, AWS publishes a list of their IPs. That list is in a JSON format, so I converted it to a CSV. I then filtered my IP addresses using my_ip = my_ip[~my_ip['col'].isin(amazon_ips['col'])].

Unfortunately, I think that the list is for ranges of IPs, rather than actually containing each IP that an AWS request could have come from. How can I correct for this?

Danny David Leybzon
  • 670
  • 1
  • 9
  • 21

1 Answers1

2

The list you are getting contains IP Ranges using CIDR Notation.

You could programmatically determine the individual IP addresses from a CIDR Block, if required: Python 3: create a list of possible ip addresses from a CIDR notation

Community
  • 1
  • 1
j-u-s-t-i-n
  • 1,402
  • 1
  • 10
  • 16