This is currently a Work-In-Progress.
The goal of this project is to be able to quickly determine what Software-as-a-Service (SaaS) owns a particular IP address or range of IP addresses.
Input: Provided an IP address: 213.199.183.0
or an IP range in CIDR notation: 213.199.183.0/24, try to provide whether this IP address or range belongs to a SaaS provider.
Result : {"error": "", "data": {"region": "", "platform": "Azure", "systemService": "", "cloud": "Public"}}
For coding and running locally, the following is required:
-
Python 3.11+ For deployment:
-
Download the code:
git clone [email protected]:fartbagxp/aas-cidr-ranges.git
-
Setup dependencies:
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
-
Run the code to test it out:
- python test.py
I'm of the opinion that third party packages should be locked down to version and updated manually for production builds, which is why the requirements.txt file is locked down to version.
Python does not offer a default way of updating this file natively, so one way to work around it is to run the following to trick the requirements.txt
file into upper versions and reinstalling the setup, and freezing a locked down dependency upon completion.
sed -i 's/[~=]=/>=/' requirements.txt
pip install --upgrade --force-reinstall -r requirements.txt
pip freeze > requirements.txt
-
Install deployment dependencies:
npm install
-
Package the serverless build:
npm run package
-
Run the deployment:
npm run deploy
-
The endpoint URL will be published as part of the deployment logs.
-
Test it out!
curl https://<lambda endpoint>.execute-api.<aws-datacenter>.amazonaws.com/dev/belong?ip=213.199.183.0
Results:
{"error": "", "data": {"region": "", "platform": "Azure", "systemService": "", "cloud": "Public"}}