{"id":4962,"date":"2025-12-15T19:50:27","date_gmt":"2025-12-15T10:50:27","guid":{"rendered":"https:\/\/matoken.org\/blog\/?p=4962"},"modified":"2025-12-15T19:50:28","modified_gmt":"2025-12-15T10:50:28","slug":"snac-spam-mitigation","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2025\/12\/15\/snac-spam-mitigation\/","title":{"rendered":"snac\u3067\u306eSPAM\u5bfe\u7b56"},"content":{"rendered":"<div id=\"preamble\">\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/matoken.org\/blog\/wp-content\/uploads\/2025\/12\/snac-susie.png\" alt=\"snac susie\" width=\"48\"><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3055\u304f\u3089\u306e\u30ca\u30ec\u30c3\u30b8\u306b\u8efd\u91cfActivityPub Server \u306esnac \u306b\u3064\u3044\u3066\u306e\u8a18\u4e8b\u3092\u5bc4\u7a3f\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/matoken.org\/blog\/2025\/12\/09\/sakura-knowledge\/\">\u3055\u304f\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306e\u3055\u304f\u3089\u306e\u30ca\u30ec\u30c3\u30b8\u306bsnac\u306e\u8a18\u4e8b\u3092\u5bc4\u7a3f \u2013 matoken&#8217;s blog<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3053\u3053\u306b\u66f8\u304b\u306a\u304b\u3063\u305fsnac \u306e\u3053\u3068\u3092\u3044\u304f\u3064\u304b\u66f8\u3044\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\uff0e<br \/>\n\u4eca\u65e5\u306fsnac \u3067\u306eSPAM \u5bfe\u7b56\u306b\u3064\u3044\u3066\uff0e<\/p>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"paragraph\">\n<p>SPAM \u304c\u6765\u306a\u3044\u306b\u8d8a\u3057\u305f\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304cActivityPub \u3067\u3082\u5076\u306b\u898b\u304b\u3051\u307e\u3059\uff0e\u3082\u3057SPAM \u304c\u6765\u308b\u3068\u304d\u306e\u3053\u3068\u3092\u8003\u3048\u3066\u5bfe\u7b56\u3092\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<br \/>\nsnac \u3067\u306f2\u3064\u306e\u5bfe\u7b56\u304c\u3042\u308b\u3088\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"quoteblock\">\n<blockquote>\n<div class=\"literalblock\">\n<div class=\"content\">\n<pre>SPAM Mitigation\n    There have been some SPAM attacks on the Fediverse and, as too many instances and server implementations out there still allow automatic account creation, it will only get worse.  snac includes some (not very strong) tools for try\u2010\n    ing to survive the SPAM flood that will eventually happen.<\/pre>\n<\/div>\n<\/div>\n<div class=\"literalblock\">\n<div class=\"content\">\n<pre>The  min_account_age field in the main configuration file allows setting a minimum age (in seconds) to consider too recently created accounts suspicious of being a potential source of SPAM. This is a na\u00efve assumption, because spam\u2010\nmers can create accounts, let them dormant for a while and then start to use them. Also, some ActivityPub implementations don't even bother to return a creation date for their accounts, so this is not very useful.<\/pre>\n<\/div>\n<\/div>\n<div class=\"literalblock\">\n<div class=\"content\">\n<pre>From version 2.50, post content can be filtered out by regular expressions.  These weapons of mass destruction can be written into the filter_reject.txt file in the server base directory, one per line;  if  this  file  exists,  all\nposts'  content  will  be  matched (after being stripped of HTML tags) against these regexes, one by one, and any match will make the post to be rejected. Use lower case, the regex will be case insensitive by default.  If you don't\nknow about regular expressions, don't use this option (or learn about them inw some tutorial, there are gazillions of them out there), as you and your users may start missing posts. Also, given that every regular expression  imple\u2010\nmentation supports a different set of features, consider reading the documentation about the one implemented in your system.<\/pre>\n<\/div>\n<\/div>\n<\/blockquote>\n<div class=\"attribution\">\n&#8212; snac(8) \u3088\u308a\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u30a2\u30ab\u30a6\u30f3\u30c8\u4f5c\u6210\u304b\u3089\u65e5\u306e\u6d45\u3044\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u62d2\u5426\">\u30a2\u30ab\u30a6\u30f3\u30c8\u4f5c\u6210\u304b\u3089\u65e5\u306e\u6d45\u3044\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u62d2\u5426<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>1\u3064\u76ee\u306f\u30e1\u30a4\u30f3\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e <code>server.json<\/code> \u3067\u8a2d\u5b9a\u3067\u304d\u308b <code>min_account_age<\/code> \u3067\uff0c\u6295\u7a3f\u3092\u53d7\u3051\u4ed8\u3051\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u4f5c\u6210\u3055\u308c\u3066\u304b\u3089\u306e\u6642\u9593\u304c\u8a2d\u5b9a\u3067\u304d\u307e\u3059\uff0e<br \/>\n\u305f\u3060\u3057\uff0cSPAM \u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3066\u5bdd\u304b\u305b\u3066\u304b\u3089\u904b\u7528\u3057\u305f\u308a\uff0c\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u4f5c\u6210\u65e5\u3092\u8fd4\u3055\u306a\u3044\u5b9f\u88c5\u3082\u3042\u308b\u3089\u3057\u3044\u306e\u3067\u3042\u307e\u308a\u5f79\u306b\u7acb\u305f\u306a\u3044\u3088\u3046\u3067\u3059\uff0e<br \/>\n\u65e2\u5b9a\u5024\u306f <code>0<\/code> \u306b\u306a\u3063\u3066\u3044\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ jq .min_account_age server.json\n0<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u6295\u7a3f\u5185\u5bb9\u3092\u6b63\u898f\u8868\u73fe\u3067\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\">\u6295\u7a3f\u5185\u5bb9\u3092\u6b63\u898f\u8868\u73fe\u3067\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>2\u3064\u3081\u306f\u6295\u7a3f\u5185\u5bb9\u3092\u6b63\u898f\u8868\u73fe\u3067\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3067\u304d\u308b\u3088\u3046\u3067\u3059\uff0esnac \u30c7\u30fc\u30bf\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b <code>filter_reject.txt<\/code> \u3092\u7528\u610f\u3057\u3066\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u4e2d\u306b1\u884c\u305a\u3064\u8a18\u8ff0\u3067\u304d\u308b\u3088\u3046\u3067\u3059\uff0e\u3053\u308c\u306b\u3088\u308a\u5168\u3066\u306e\u6295\u7a3f\u3092HTML \u30bf\u30b0\u3092\u53d6\u308a\u9664\u3044\u305f\u5f8c\u6b63\u898f\u8868\u73fe\u30681\u3064\u305a\u3064\u7167\u5408\u3055\u308c\u4e00\u81f4\u3059\u308b\u6295\u7a3f\u306f\u62d2\u5426\u3055\u308c\u307e\u3059\uff0e<br \/>\n\u6b63\u898f\u8868\u73fe\u306a\u306e\u3067\u30c6\u30b9\u30c8\u3092\u5341\u5206\u3057\u3066\u8a2d\u5b9a\u3057\u305f\u307b\u3046\u304c\u826f\u3055\u305d\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Reverse proxy \u3084Firewall \u306a\u3069snac \u306e\u5916\u3067\u5bfe\u7b56\u3082\u8003\u3048\u3089\u308c\u307e\u3059\uff0e\u305d\u306e\u4ed6\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3082\u3042\u308b\u3088\u3046\u3067\u3059\uff0ee-mail \u3082\u3053\u3093\u306a\u611f\u3058\u3067\u591a\u6bb5\u306b\u3057\u305f\u308a\u3057\u307e\u3059\u306d\uff0e\u305d\u3046\u306a\u308b\u3068Received \u306e\u3088\u3046\u306a\u3082\u306e\u304c\u898b\u305f\u3044\u306a\u3068\u601d\u3063\u305f\u308a\u3082\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/qiita.com\/webscrubbing\/items\/f7bf32ae9feeac5e5004\">Mastodon\u3068\u304b\u306eActivityPub\u30b5\u30fc\u30d0\u30fc\u3067\u4f7f\u3048\u308b\u30b9\u30d1\u30e0\u5bfe\u7b56\u30d7\u30ed\u30ad\u30b7\u3092\u4f5c\u3063\u305f\u3088 #mastodon &#8211; Qiita<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/webscrubbing\/simple-activitypub-spam-filter\/tree\/main\">webscrubbing\/simple-activitypub-spam-filter: Check content and block it<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u304f\u3089\u306e\u30ca\u30ec\u30c3\u30b8\u306b\u8efd\u91cfActivityPub Server \u306esnac \u306b\u3064\u3044\u3066\u306e\u8a18\u4e8b\u3092\u5bc4\u7a3f\u3057\u307e\u3057\u305f\uff0e \u3055\u304f\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306e\u3055\u304f\u3089\u306e\u30ca\u30ec\u30c3\u30b8\u306bsnac\u306e\u8a18\u4e8b\u3092\u5bc4\u7a3f \u2013 matoken&#8217;s blog \u3053\u3053\u306b\u66f8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":""},"categories":[7,6,1231],"tags":[493,1243,1249],"class_list":["post-4962","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-trixie","tag-activitypub","tag-snac","tag-spam"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/4962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=4962"}],"version-history":[{"count":1,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/4962\/revisions"}],"predecessor-version":[{"id":4963,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/4962\/revisions\/4963"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=4962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=4962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=4962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}