X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=fba%2Fhelpers%2Fblacklist.py;h=6d0c6ff2da4a947a13a294b8cc9ef5484fa428e6;hb=21c7c13dcdf897008a7f340e606c947092ba51bd;hp=e2e8a002c7ffa82e9322b83f50ef226778abcbba;hpb=ae5597c66caace7a3f8d053503c80d92a5afaeea;p=fba.git diff --git a/fba/helpers/blacklist.py b/fba/helpers/blacklist.py index e2e8a00..6d0c6ff 100644 --- a/fba/helpers/blacklist.py +++ b/fba/helpers/blacklist.py @@ -20,44 +20,70 @@ from fba.helpers import domain as domain_helper logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) +#logger.setLevel(logging.DEBUG) # Don't check these, known trolls/flooders/testing/developing -blacklist = [ - # Floods federation with fake nodes as "research" project - "activitypub-troll.cf", - "activitypub-proxy.cf", - # Similar troll - "gab.best", - # Similar troll - "4chan.icu", - # Flooder (?) - "social.shrimpcam.pw", - "mastotroll.netz.org", - "lhr.life", - "localhost.run", - "loca.lt", - # Testing/developing installations - "ngrok.io", - "ngrok-free.app", - "misskeytest.chn.moe", - "netlify.app", - # block flooder - "everyoneattack.com", - # CSRF - "hexbear.net", # See script in /instances -] +_blacklist = { + "activitypub-troll.cf": "Floods federation with fake nodes as \"research\" project", + "activitypub-proxy.cf": "Floods federation with fake nodes as \"research\" project", + "misskey-forkbomb.cf" : "Floods federation tables with fake nodes", + "gab.best" : "Floods federation tables with fake nodes", + "4chan.icu" : "Floods federation tables with fake nodes", + "social.shrimpcam.pw" : "Floods federation tables with fake nodes", + "mastotroll.netz.org" : "Floods federation tables with fake nodes", + "lhr.life" : "Floods federation tables with fake nodes", + "localhost.run" : "Floods federation tables with fake nodes", + "loca.lt" : "Floods federation tables with fake nodes", + "grid.tf" : "Floods federation tables with fake nodes", + "gitpod.io" : "Floods federation tables with fake nodes", + "everyoneattack.com" : "Floods federation tables with fake nodes", + "vercel.app" : "Floods federation tables with fake nodes", + "run.app" : "Floods federation tables with fake nodes", + "sutty.nl" : "Floods federation tables with fake nodes", + "mdrqnxtagon.pw" : "Floods federation tables with fake nodes", + "denden.world" : "Looks like a valid Mastodon instance, but return exactly (!) 5k instances with trash domains", + "fnaf.stream" : "Trolls with over-long sub-domain name(s)", + "ngrok.io" : "Testing/developing instances shouldn't be part of public instances", + "ngrok.app" : "Testing/developing instances shouldn't be part of public instances", + "ngrok-free.app" : "Testing/developing instances shouldn't be part of public instances", + "misskeytest.chn.moe" : "Testing/developing instances shouldn't be part of public instances", + "netlify.app" : "Testing/developing instances shouldn't be part of public instances", + "ignorelist.com" : "Testing/developing instances shouldn't be part of public instances", + "app.github.dev" : "Testing/developing instances shouldn't be part of public instances", + "tunnel.silicon.moe" : "Testing/developing instances shouldn't be part of public instances", + "hexbear.net" : "Is a Lemmy instance with malicious JavaScript code (shell commands)", + "mastodon.n41.lat" : "Somehow this instance repeatedly causes an OOM here", + "fb.me" : "Facebook websites are never Fediverse instances", + "osl.academy" : "Parked domain, no fediverse instance", + "icolectiva.org" : "Parked domain, no fediverse instance", + "blombus.com" : "Parked domain, no fediverse instance", + "eliotberriot.com" : "Parked domain, no fediverse instance", + "fsam.one" : "Parked domain, no fediverse instance", + "doot.tv" : "Parked domain, no fediverse instance", + "snet.blog" : "Parked domain, no fediverse instance", + "horserock.xyz" : "Parked domain, no fediverse instance", + "free-pic.org" : "Parked domain, no fediverse instance", + "co-mastdn.ga" : "Parked domain, no fediverse instance", + "chocoflan.net" : "Parked domain, no fediverse instance", + "qwest.net" : "Dynamic IP address hosts should not be used for fediverse instances", +} def is_blacklisted(domain: str) -> bool: logger.debug("domain='%s' - CALLED!", domain) domain_helper.raise_on(domain) blacklisted = False - logger.debug("Checking %d blacklist entries ...", len(blacklist)) - for peer in blacklist: - logger.debug("Checking peer='%s' ...", peer) - if peer in domain: + logger.debug("Checking %d blacklist entries ...", len(_blacklist)) + for blocked in _blacklist: + logger.debug("Checking blocked='%s' ...", blocked) + if blocked in domain: logger.debug("domain='%s' is blacklisted.", domain) blacklisted = True + break logger.debug("blacklisted='%s' - EXIT!", blacklisted) return blacklisted + +def get_all() -> dict: + logger.debug("_blacklist()=%d - CALLED!", len(_blacklist)) + return _blacklist