MCPcopy Create free account
hub / github.com/adobe/Marinus / main

Function main

python3_cron_scripts/get_crt_sh.py:248–367  ·  view source on GitHub ↗

Begin Main...

(logger=None)

Source from the content-addressed store, hash-verified

246
247
248def main(logger=None):
249 """
250 Begin Main...
251 """
252 if logger is None:
253 logger = LoggingUtil.create_log(__name__)
254
255 now = datetime.now()
256 print("Starting: " + str(now))
257 logger.info("Starting...")
258
259 # Set up the common objects
260 mongo_connector = MongoConnector.MongoConnector()
261 ct_collection = mongo_connector.get_certificate_transparency_connection()
262 zones = ZoneManager.get_distinct_zones(mongo_connector)
263 jobs_manager = JobsManager.JobsManager(mongo_connector, "get_crt_sh")
264 jobs_manager.record_job_start()
265
266 save_location = "crt-sh"
267 download_method = "dbAndSave"
268
269 parser = argparse.ArgumentParser(
270 description="Download DNS and/or certificate information from crt.sh."
271 )
272 parser.add_argument(
273 "--fetch_dns_records",
274 action="store_true",
275 help="Indicates whether to add DNS entries to the database",
276 )
277 parser.add_argument(
278 "--download_methods",
279 choices=["dbAndSave", "dbOnly"],
280 default=download_method,
281 help="Indicates whether to download the raw files or just record in the database.",
282 )
283 parser.add_argument(
284 "--cert_save_location",
285 required=False,
286 default=save_location,
287 help="Indicates the folder name when choosing dbAndSave",
288 )
289 parser.add_argument(
290 "--storage_system",
291 choices=[
292 StorageManager.StorageManager.AWS_S3,
293 StorageManager.StorageManager.AZURE_BLOB,
294 StorageManager.StorageManager.LOCAL_FILESYSTEM,
295 ],
296 default=StorageManager.StorageManager.LOCAL_FILESYSTEM,
297 help="Indicates where to save the files when dbAndSave is chosen",
298 )
299 args = parser.parse_args()
300
301 if args.cert_save_location:
302 save_location = args.cert_save_location
303
304 if args.storage_system == StorageManager.StorageManager.LOCAL_FILESYSTEM:
305 if "/" not in save_location:

Callers 1

get_crt_sh.pyFile · 0.70

Calls 9

record_job_startMethod · 0.95
record_job_completeMethod · 0.95
add_new_domain_namesFunction · 0.85
create_logMethod · 0.80
get_distinct_zonesMethod · 0.80
check_save_locationFunction · 0.70
make_https_requestFunction · 0.70

Tested by

no test coverage detected