bucket-stream_5.py 917 B

123456789101112131415161718192021
  1. def process(self, message, context):
  2. if message["message_type"] == "heartbeat":
  3. return
  4. if message["message_type"] == "certificate_update":
  5. all_domains = message["data"]["leaf_cert"]["all_domains"]
  6. if ARGS.skip_lets_encrypt and "Let's Encrypt" in message["data"]["chain"][0]["subject"]["aggregated"]:
  7. return
  8. for domain in set(all_domains):
  9. # cut the crap
  10. if not domain.startswith("*.")\
  11. and "cloudflaressl" not in domain\
  12. and "xn--" not in domain\
  13. and domain.count("-") < 4\
  14. and domain.count(".") < 4:
  15. parts = tldextract.extract(domain)
  16. for permutation in get_permutations(parts.domain, parts.subdomain):
  17. self.q.put(BUCKET_HOST % permutation)