0

I have a Python script that runs an nmap command simply using subprocess. I need to run this every time an ip is added to a BQ dataset. My initial thought was to use google cloud functions to run this for the new ip, but realized that google cloud function didn't have the ability to use nmap as far as i'm aware. My next thought was to set up some VM where i could create a venv with nmap included, but doubt this is ideal. I know there are several google service that have networking, such as cloud DNS and their cloud security scanner, but as far as i can tell they don't help with this.

put simply is there a better way to trigger and run a python nmap command script every time a new IP is added to a dataset, other than creating a vm?

All ideas welcome, Thanks for taking the time !

1 Answers1

0

I haven't tested this personally but maybe creating a docker container with nmap or using an existing one , like this example and then using cloud run is worth a shot.

I couldn't get python-nmap to work in Cloud functions, presumably due to needing underlying nmap at OS level

Andres S
  • 1,168
  • 7
  • 11
  • Did you try to run nmap using cloud run? I have en error: "setup_target: failed to determine route to domain.com (domain IP)" It resolves a domain name. I also connected it to VPC but still have this error – Wojciech Maślanka Jul 21 '22 at 13:52
  • fyi I also set "Route all traffic through the VPC connector" but still have this error I use this nmap - https://hub.docker.com/r/instrumentisto/nmap/dockerfile It works on local machine – Wojciech Maślanka Jul 21 '22 at 14:15