cloudcheck 5.0.1.595__py3-none-any.whl → 6.0.0.602__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cloudcheck might be problematic. Click here for more details.
- cloud_providers.json +659 -381
- cloudcheck/providers/__init__.py +40 -40
- cloudcheck/providers/base.py +19 -6
- {cloudcheck-5.0.1.595.dist-info → cloudcheck-6.0.0.602.dist-info}/METADATA +3 -2
- {cloudcheck-5.0.1.595.dist-info → cloudcheck-6.0.0.602.dist-info}/RECORD +7 -7
- {cloudcheck-5.0.1.595.dist-info → cloudcheck-6.0.0.602.dist-info}/WHEEL +1 -1
- {cloudcheck-5.0.1.595.dist-info → cloudcheck-6.0.0.602.dist-info}/entry_points.txt +0 -0
cloudcheck/providers/__init__.py
CHANGED
|
@@ -44,48 +44,48 @@ class CloudProviders:
|
|
|
44
44
|
|
|
45
45
|
def load_from_json(self, force=False):
|
|
46
46
|
# loading from a pickled cache is about 1 second faster than loading from JSON
|
|
47
|
-
if (not force) and self.cache_path.is_file():
|
|
48
|
-
|
|
49
|
-
else:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
for provider_name, provider_class in providers.items():
|
|
60
|
-
provider_name = provider_name.lower()
|
|
61
|
-
provider_json = j.get(provider_name, {})
|
|
62
|
-
self.providers[provider_name] = provider_class(provider_json)
|
|
63
|
-
self.cache_key = self.json_path.stat()
|
|
64
|
-
else:
|
|
47
|
+
# if (not force) and self.cache_path.is_file():
|
|
48
|
+
# self.load_from_cache()
|
|
49
|
+
# else:
|
|
50
|
+
if self.json_path.is_file():
|
|
51
|
+
with open(self.json_path) as f:
|
|
52
|
+
try:
|
|
53
|
+
j = json.load(f)
|
|
54
|
+
for k in list(j):
|
|
55
|
+
j[k.lower()] = j.pop(k)
|
|
56
|
+
except Exception as e:
|
|
57
|
+
log.warning(f"Failed to parse JSON at {self.json_path}: {e}")
|
|
58
|
+
return
|
|
65
59
|
for provider_name, provider_class in providers.items():
|
|
66
60
|
provider_name = provider_name.lower()
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
self.providers =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
61
|
+
provider_json = j.get(provider_name, {})
|
|
62
|
+
self.providers[provider_name] = provider_class(provider_json)
|
|
63
|
+
self.cache_key = self.json_path.stat()
|
|
64
|
+
else:
|
|
65
|
+
for provider_name, provider_class in providers.items():
|
|
66
|
+
provider_name = provider_name.lower()
|
|
67
|
+
self.providers[provider_name] = provider_class(None)
|
|
68
|
+
# self.write_cache()
|
|
69
|
+
|
|
70
|
+
# def load_from_cache(self):
|
|
71
|
+
# with open(self.cache_path, "rb") as f:
|
|
72
|
+
# try:
|
|
73
|
+
# self.providers = pickle.load(f)
|
|
74
|
+
# except Exception as e:
|
|
75
|
+
# with suppress(Exception):
|
|
76
|
+
# self.cache_path.unlink()
|
|
77
|
+
# log.warning(
|
|
78
|
+
# f"Failed to load cloudcheck cache at {self.cache_path}: {e}"
|
|
79
|
+
# )
|
|
80
|
+
|
|
81
|
+
# def write_cache(self):
|
|
82
|
+
# with open(self.cache_path, "wb") as f:
|
|
83
|
+
# try:
|
|
84
|
+
# pickle.dump(self.providers, f)
|
|
85
|
+
# except Exception as e:
|
|
86
|
+
# log.warning(
|
|
87
|
+
# f"Failed to write cloudcheck cache to {self.cache_path}: {e}"
|
|
88
|
+
# )
|
|
89
89
|
|
|
90
90
|
def check(self, host):
|
|
91
91
|
host = make_ip_type(host)
|
cloudcheck/providers/base.py
CHANGED
|
@@ -4,7 +4,7 @@ import ipaddress
|
|
|
4
4
|
import traceback
|
|
5
5
|
import regex as re
|
|
6
6
|
from datetime import datetime
|
|
7
|
-
from radixtarget import
|
|
7
|
+
from radixtarget import Target
|
|
8
8
|
from typing import Dict, List, Union
|
|
9
9
|
from pydantic import BaseModel, field_validator
|
|
10
10
|
|
|
@@ -17,7 +17,21 @@ asndb = None
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
base_headers = {
|
|
20
|
-
"
|
|
20
|
+
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
|
21
|
+
"accept-language": "en-US,en;q=0.9",
|
|
22
|
+
"cache-control": "no-cache",
|
|
23
|
+
"pragma": "no-cache",
|
|
24
|
+
"priority": "u=0, i",
|
|
25
|
+
"referer": "https://www.google.com/",
|
|
26
|
+
"sec-ch-ua": '"Chromium";v="127", "Not)A;Brand";v="99"',
|
|
27
|
+
"sec-ch-ua-mobile": "?0",
|
|
28
|
+
"sec-ch-ua-platform": '"Linux"',
|
|
29
|
+
"sec-fetch-dest": "document",
|
|
30
|
+
"sec-fetch-mode": "navigate",
|
|
31
|
+
"sec-fetch-site": "cross-site",
|
|
32
|
+
"sec-fetch-user": "?1",
|
|
33
|
+
"upgrade-insecure-requests": "1",
|
|
34
|
+
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
|
|
21
35
|
}
|
|
22
36
|
|
|
23
37
|
|
|
@@ -49,7 +63,7 @@ class BaseCloudProvider:
|
|
|
49
63
|
def __init__(self, j):
|
|
50
64
|
self._log = None
|
|
51
65
|
self.ranges = set()
|
|
52
|
-
self.radix =
|
|
66
|
+
self.radix = Target()
|
|
53
67
|
if j is not None:
|
|
54
68
|
p = CloudProviderJSON(**j)
|
|
55
69
|
self.update_domains(
|
|
@@ -142,10 +156,9 @@ class BaseCloudProvider:
|
|
|
142
156
|
def parse_response(self, response):
|
|
143
157
|
pass
|
|
144
158
|
|
|
145
|
-
@classmethod
|
|
146
159
|
@property
|
|
147
|
-
def name(
|
|
148
|
-
return
|
|
160
|
+
def name(self):
|
|
161
|
+
return self.__class__.__name__
|
|
149
162
|
|
|
150
163
|
@property
|
|
151
164
|
def log(self):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cloudcheck
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6.0.0.602
|
|
4
4
|
Summary: Check whether an IP address belongs to a cloud provider
|
|
5
5
|
Home-page: https://github.com/blacklanternsecurity/cloudcheck
|
|
6
6
|
License: GPL-3.0
|
|
@@ -12,9 +12,10 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
16
|
Requires-Dist: httpx (>=0.26,<0.28)
|
|
16
17
|
Requires-Dist: pydantic (>=2.4.2,<3.0.0)
|
|
17
|
-
Requires-Dist: radixtarget (>=
|
|
18
|
+
Requires-Dist: radixtarget (>=2.0.0.32,<3.0.0.0)
|
|
18
19
|
Requires-Dist: regex (>=2024.4.16,<2025.0.0)
|
|
19
20
|
Project-URL: Discord, https://discord.com/invite/PZqkgxu5SA
|
|
20
21
|
Project-URL: PyPi, https://pypi.org/project/cloudcheck/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
cloud_providers.json,sha256=
|
|
1
|
+
cloud_providers.json,sha256=ROE9BT-jk4MxtPprJMS9MsTZdD-fCdunTDigGYrNtcA,912727
|
|
2
2
|
cloudcheck/__init__.py,sha256=FuxQNWSWrhThXVwhuaevh57mUQNtVS-KQ_HCIkfnE0M,416
|
|
3
3
|
cloudcheck/cloudcheck.py,sha256=qgXzRXv6z62V2hfhVSnXf8ariaOMleakoxKdeAeGIPQ,924
|
|
4
4
|
cloudcheck/helpers.py,sha256=Qn7vNh_Uw4Wpg1RWWVIkI5OILNFHQI1gYwIQYrHz9l8,605
|
|
5
|
-
cloudcheck/providers/__init__.py,sha256=
|
|
5
|
+
cloudcheck/providers/__init__.py,sha256=7kRphvQAu-lU9I_dsVY_DMgDNg202Zhmh487x5QsU88,5365
|
|
6
6
|
cloudcheck/providers/akamai.py,sha256=UzuuAq_V9GwlIWMkOJ56Jfv2vdjQN0umiafAyRAW5aw,3591
|
|
7
7
|
cloudcheck/providers/amazon.py,sha256=U-EF5LqQuownlEzAdqLZQCDxU2VsFEer54yC8zVcbl4,1703
|
|
8
8
|
cloudcheck/providers/azure.py,sha256=TpyGhd22iAS0aCt-jH90ZdsnwDzIJ10Dog4DcCeltno,4702
|
|
9
|
-
cloudcheck/providers/base.py,sha256=
|
|
9
|
+
cloudcheck/providers/base.py,sha256=yi6IWV7ANWXal7vnvqibjbbM6jhKoJ-Rmo6DOrI_ygM,5379
|
|
10
10
|
cloudcheck/providers/cloudflare.py,sha256=4iHQEiNEsW08cdyQlrH-7qJa-cgpezJfJbtg13SyJKs,1452
|
|
11
11
|
cloudcheck/providers/digitalocean.py,sha256=yqunC2QNlkRP6ol6pG3XJQl8fwW9baCDmNVfETj1yuM,762
|
|
12
12
|
cloudcheck/providers/fastly.py,sha256=c3Y5cm5R0PMRXGSWDxAiij50X9Mh9ga2xrbHO6RTfKU,575
|
|
@@ -16,7 +16,7 @@ cloudcheck/providers/oracle.py,sha256=Xbi9M0dJf6jlGZuZe6vKCyGFQJNBKopQkyBnwEdjb0
|
|
|
16
16
|
cloudcheck/providers/zoho.py,sha256=4fo0unvG-oVgsKPz5Xa3viq5P5sf69VNu-v0kt1aQK4,477
|
|
17
17
|
cloudcheck/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
18
|
cloudcheck/test/test_cloudcheck.py,sha256=CK6npWw6i1LCAlW0u6y53ee1RXwbyeAcwcH0mPEHNmg,2198
|
|
19
|
-
cloudcheck-
|
|
20
|
-
cloudcheck-
|
|
21
|
-
cloudcheck-
|
|
22
|
-
cloudcheck-
|
|
19
|
+
cloudcheck-6.0.0.602.dist-info/METADATA,sha256=dOxE-2bwTOCASPiRGkyYH4ZdxbH46_0CuV619RzhxAI,2663
|
|
20
|
+
cloudcheck-6.0.0.602.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
21
|
+
cloudcheck-6.0.0.602.dist-info/entry_points.txt,sha256=SzYzxS8FPIBJdwNT4pQhhSostZyrQMxLqzpyuKkJxDU,57
|
|
22
|
+
cloudcheck-6.0.0.602.dist-info/RECORD,,
|
|
File without changes
|