From e0a28f9b8c3e4377cfbbda06bd2f1be23f36b8ca Mon Sep 17 00:00:00 2001 From: TheTechromancer Date: Thu, 18 Dec 2025 15:53:34 -0500 Subject: [PATCH 1/2] 8.5.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- pyproject.toml | 2 +- src/lib.rs | 1 - uv.lock | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51e72cf..21be663 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,7 +115,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cloudcheck" -version = "8.5.0" +version = "8.5.1" dependencies = [ "env_logger", "log", diff --git a/Cargo.toml b/Cargo.toml index 81dc4a9..eb9e3af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cloudcheck" -version = "8.5.0" +version = "8.5.1" edition = "2024" description = "CloudCheck is a simple Rust tool to check whether an IP address or hostname belongs to a cloud provider." license = "GPL-3.0" diff --git a/pyproject.toml b/pyproject.toml index 7863a43..9569133 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "cloudcheck" -version = "8.5.0" +version = "8.5.1" description = "Detailed database of cloud providers. Instantly look up a domain or IP address" readme = "README.md" requires-python = ">=3.9" diff --git a/src/lib.rs b/src/lib.rs index 558dfe7..4f45975 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -346,7 +346,6 @@ mod tests { ); } - #[ignore] #[tokio::test] async fn test_lookup_windows_blob_domain() { let cloudcheck = CloudCheck::new(); diff --git a/uv.lock b/uv.lock index 4ee4736..1c226dc 100644 --- a/uv.lock +++ b/uv.lock @@ -140,7 +140,7 @@ wheels = [ [[package]] name = "cloudcheck" -version = "8.5.0" +version = "8.5.1" source = { editable = "." } [package.dev-dependencies] From 48d65bf2daaf0c921302918d27216f50587e40bc Mon Sep 17 00:00:00 2001 From: TheTechromancer Date: Thu, 18 Dec 2025 15:57:52 -0500 Subject: [PATCH 2/2] microsoft --- cloudcheck/providers/microsoft.py | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 cloudcheck/providers/microsoft.py diff --git a/cloudcheck/providers/microsoft.py b/cloudcheck/providers/microsoft.py new file mode 100644 index 0000000..b6d0894 --- /dev/null +++ b/cloudcheck/providers/microsoft.py @@ -0,0 +1,37 @@ +from cloudcheck.providers.base import BaseProvider +from typing import List, Dict + + +class Microsoft(BaseProvider): + v2fly_company: str = "microsoft" + tags: List[str] = ["cloud"] + # {"org_id": "MSFT-ARIN", "org_name": "Microsoft Corporation", "country": "US", "asns": [3598,5761,6182,6194,6291,6584,8068,8069,8070,8071,8072,8073,8074,8075,12076,13399,13811,14719,14783,17144,17345,20046,22692,23468,25796,26222,30135,30520,30575,31792,32476,36006,40066,46182,54396,63245,63314,395496,395524,395851,396463,397096,397466,397996,398575,398656,398657,398658,398659,398660,398661,398961,400572,400573,400574,400575,400576,400577,400578,400579,400580,400581,400582,400884]} + # {"org_id": "ORG-MA42-RIPE", "org_name": "Microsoft Limited", "country": "GB", "asns": [35106]} + # {"org_id": "ORG-MDMG3-RIPE", "org_name": "Microsoft Deutschland MCIO GmbH", "country": "DE", "asns": [200517]} + # {"org_id": "ORG-MOPL2-AP-APNIC", "org_name": "Microsoft Operations PTE Ltd", "country": "SG", "asns": [132348]} + # {"org_id": "ORG-MSPL4-AP-APNIC", "org_name": "Microsoft Singapore Pte. Ltd.", "country": "US", "asns": [45139]} + org_ids: List[str] = [ + "MSFT-ARIN", + "ORG-MA42-RIPE", + "ORG-MDMG3-RIPE", + "ORG-MOPL2-AP-APNIC", + "ORG-MSPL4-AP-APNIC", + ] + _bucket_name_regex = r"[a-z0-9][a-z0-9-_\.]{1,61}[a-z0-9]" + regexes: Dict[str, List[str]] = { + "STORAGE_BUCKET_NAME": [_bucket_name_regex], + "STORAGE_BUCKET_HOSTNAME": [ + r"(" + _bucket_name_regex + r")\.(blob\.core\.windows\.net)" + ], + } + + _ips_url = "https://download.microsoft.com/download/0/1/8/018E208D-54F8-44CD-AA26-CD7BC9524A8C/PublicIPs_20200824.xml" + + def fetch_cidrs(self): + response = self.request(self._ips_url) + ranges = set() + for line in response.text.splitlines(): + if "IpRange Subnet" in line: + ip_range = line.split('"')[1] + ranges.add(ip_range) + return list(ranges)