MCPcopy Index your code
hub / github.com/blacklanternsecurity/bbot / validate_org

Method validate_org

bbot/modules/github_org.py:192–211  ·  view source on GitHub ↗
(self, org)

Source from the content-addressed store, hash-verified

190 return repos
191
192 async def validate_org(self, org):
193 is_org = False
194 in_scope = False
195 url = f"{self.base_url}/orgs/{org}"
196 r = await self.api_request(url)
197 if r is None:
198 return is_org, in_scope
199 status_code = getattr(r, "status_code", 0)
200 if status_code == 403:
201 self.warning("Github is rate-limiting us (HTTP status: 403)")
202 return is_org, in_scope
203 if status_code == 200:
204 is_org = True
205 in_scope_hosts = await self.scan.extract_in_scope_hostnames(getattr(r, "text", ""))
206 if in_scope_hosts:
207 self.verbose(
208 f'Found in-scope hostname(s): "{in_scope_hosts}" for github org: {org}, it appears to be in-scope'
209 )
210 in_scope = True
211 return is_org, in_scope

Callers 1

handle_eventMethod · 0.95

Calls 4

api_requestMethod · 0.80
warningMethod · 0.45
verboseMethod · 0.45

Tested by

no test coverage detected