Skip to content

Commit

Permalink
resolve master conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechromancer committed Nov 16, 2023
2 parents 6d4573c + 6dd740d commit af3c086
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
16 changes: 8 additions & 8 deletions cloud_providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"srtcdn.net"
],
"ips_url": "https://techdocs.akamai.com/property-manager/pdfs/akamai_ipv4_ipv6_CIDRs-txt.zip",
"last_updated": "2023-11-16T18:05:46.084415",
"last_updated": "2023-11-16T13:11:30.891305",
"name": "Akamai",
"provider_type": "cdn",
"regexes": {}
Expand Down Expand Up @@ -6272,7 +6272,7 @@
"thinkboxsoftware.com"
],
"ips_url": "https://ip-ranges.amazonaws.com/ip-ranges.json",
"last_updated": "2023-11-16T18:05:45.173688",
"last_updated": "2023-11-16T13:11:30.959467",
"name": "Amazon",
"provider_type": "cloud",
"regexes": {
Expand Down Expand Up @@ -9968,7 +9968,7 @@
"windowsazurestatus.cn"
],
"ips_url": "https://download.microsoft.com/download/0/1/8/018E208D-54F8-44CD-AA26-CD7BC9524A8C/PublicIPs_20200824.xml",
"last_updated": "2023-11-16T18:05:44.985482",
"last_updated": "2023-11-16T13:11:31.093681",
"name": "Azure",
"provider_type": "cloud",
"regexes": {
Expand Down Expand Up @@ -10037,7 +10037,7 @@
"workers.dev"
],
"ips_url": "https://api.cloudflare.com/client/v4/ips",
"last_updated": "2023-11-16T18:05:45.005327",
"last_updated": "2023-11-16T13:11:30.764321",
"name": "Cloudflare",
"provider_type": "cdn",
"regexes": {}
Expand Down Expand Up @@ -11736,7 +11736,7 @@
"nginxconfig.io"
],
"ips_url": "https://digitalocean.com/geo/google.csv",
"last_updated": "2023-11-16T18:05:45.694039",
"last_updated": "2023-11-16T13:11:31.340025",
"name": "DigitalOcean",
"provider_type": "cloud",
"regexes": {
Expand Down Expand Up @@ -15687,7 +15687,7 @@
"github.com"
],
"ips_url": "https://api.github.com/meta",
"last_updated": "2023-11-16T18:05:45.228744",
"last_updated": "2023-11-16T13:11:30.887920",
"name": "GitHub",
"provider_type": "cdn",
"regexes": {}
Expand Down Expand Up @@ -16358,7 +16358,7 @@
"googleapis.com"
],
"ips_url": "https://www.gstatic.com/ipranges/cloud.json",
"last_updated": "2023-11-16T18:05:45.011275",
"last_updated": "2023-11-16T13:11:30.761584",
"name": "Google",
"provider_type": "cloud",
"regexes": {
Expand Down Expand Up @@ -17030,7 +17030,7 @@
"sun.com"
],
"ips_url": "https://docs.oracle.com/en-us/iaas/tools/public_ip_ranges.json",
"last_updated": "2023-11-16T18:05:45.497847",
"last_updated": "2023-11-16T13:11:31.246319",
"name": "Oracle",
"provider_type": "cloud",
"regexes": {}
Expand Down
4 changes: 4 additions & 0 deletions cloudcheck/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def load_from_json(self):
self.providers[provider_name] = provider_class(
provider_json, self.httpx_client
)
else:
for provider_name, provider_class in providers.items():
provider_name = provider_name.lower()
self.providers[provider_name] = provider_class(None, self.httpx_client)

def check(self, host):
if is_ip(host):
Expand Down
15 changes: 8 additions & 7 deletions cloudcheck/providers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CloudProviderJSON(BaseModel):
name: str = ""
domains: List[str] = []
cidrs: List[Union[ipaddress.IPv4Network, ipaddress.IPv6Network]] = []
last_updated: datetime = datetime.now()
last_updated: datetime = datetime.min
bucket_name_regex: str = ""
regexes: Dict[str, List[str]] = {}
provider_type: str = "cloud"
Expand All @@ -42,12 +42,13 @@ class BaseCloudProvider:
def __init__(self, j, httpx_client=None):
self._httpx_client = httpx_client
self._log = None
p = CloudProviderJSON(**j)
self.domains = set(
[d.lower() for d in set(list(self.domains) + list(p.domains))]
)
self.ranges = CidrRanges(p.cidrs)
self.last_updated = p.last_updated
if j is not None:
p = CloudProviderJSON(**j)
self.domains = set(
[d.lower() for d in set(list(self.domains) + list(p.domains))]
)
self.ranges = CidrRanges(p.cidrs)
self.last_updated = p.last_updated

self._bucket_name_regex = re.compile("^" + self.bucket_name_regex + "$", re.I)

Expand Down

0 comments on commit af3c086

Please sign in to comment.