snowflakedb / SnowAlert

Security Analytics Using The Snowflake Data Warehouse
Apache License 2.0
182 stars 57 forks source link

add azure collect public IP addresses #571

Closed sfc-gh-dwyleczukstern closed 2 years ago

sfc-gh-dwyleczukstern commented 2 years ago

https://docs.microsoft.com/en-us/rest/api/virtualnetwork/public-ip-addresses/list-all

Add the capability to collect Azure public IP addresses

tested by running locally —

% SA_ENV=dev ipython --pdb -- runners/connectors_runner.py AZURE_COLLECT_CONNECTION --debug --apis='subscriptions.public_ip_addresses'
/usr/local/lib/python3.8/site-packages/IPython/core/interactiveshell.py:936: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
  warn("Attempting to work in a virtualenv. If you encounter problems, please "
[38981] -- START DC AZURE_COLLECT_CONNECTION --
[38981] RUN metadata recorded.
[38981] GET subscriptions: DDD calls, DDD remain
[38981] GET https://management.azure.com/subscriptions?api-version=2019-06-01
[38981] <- 200
...
[38981] -> data.azure_collect_connection (CCC rows)
[38981] GET public_ip_addresses: CCC calls, CCC remain
[38981] GET https://management.azure.com/subscriptions/AAA/providers/Microsoft.Network/publicIPAddresses?api-version=2021-03-01
[38981] <- 200
...
[38981] -> data.azure_collect_public_ip_addresses (BBB rows)
[38981] RUN metadata recorded.
[38981] -- END DC AZURE_COLLECT_CONNECTION --