Actually, if you are reading this, you are not presently a resident fossil in the brand-new Operator Speaking Tar Pit.
… but watch yourself – you never know …
Tar Pit Operation
- Record incoming user agent, IP address
- Compare user agent, IP address to Black List
- On match, apply ban level (deny, poison) protocol
Tar Pit Administration
Review MySQL database for suspicious / undesirable hits and insert bans accordingly.
What this means for those I have banned: this site simply will not work the way you’d expect. Strange things will happen. Binary will be served (very slowly) instead of the text that you were anticipating. Your feed monitoring software will let you down.
I was plotting to release a WordPress plugin when I realized that the tar pit script is simple enough to work with just about any PHP-driven application… so I’ll have some source code to post as soon as I come up with a working administrative interface (though if you really want to play around with the code and you’re comfortable using SQL, e-mail me and I’ll send something your way).
For now, the MySQL schema:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `ban_agents` (
`ban_agent_id` int(11) NOT NULL AUTO_INCREMENT,
`ban_agent_name` varchar(150) COLLATE utf8_bin NOT NULL,
`ban_level` enum('deny','poison') COLLATE utf8_bin NOT NULL DEFAULT 'poison',
`ban_agent_reason` varchar(150) COLLATE utf8_bin NOT NULL,
`ban_agent_timestamp` datetime NOT NULL,
PRIMARY KEY (`ban_agent_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `ban_ips` (
`ban_ip_id` int(11) NOT NULL AUTO_INCREMENT,
`ban_ip_name` int(11) NOT NULL,
`ban_level` enum('deny','poison') COLLATE utf8_bin NOT NULL DEFAULT 'poison',
`ban_ip_reason` text COLLATE utf8_bin NOT NULL,
`ban_ip_timestamp` datetime NOT NULL,
PRIMARY KEY (`ban_ip_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `ban_ranges` (
`ban_range_id` int(11) NOT NULL AUTO_INCREMENT,
`ban_range_start` int(11) NOT NULL,
`ban_range_end` int(11) NOT NULL,
`ban_level` enum('deny','poison') COLLATE utf8_bin NOT NULL DEFAULT 'poison',
`ban_range_reason` varchar(150) COLLATE utf8_bin NOT NULL,
`ban_range_timestamp` datetime NOT NULL,
PRIMARY KEY (`ban_range_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `hits` (
`hit_id` int(11) NOT NULL AUTO_INCREMENT,
`hit_context` enum('page','feed','feed-atom','feed-rss','feed-rss2','sitemap') COLLATE utf8_bin NOT NULL DEFAULT 'page',
`hit_ip_address` int(11) NOT NULL,
`hit_user_agent` varchar(150) COLLATE utf8_bin NOT NULL,
`hit_timestamp` datetime NOT NULL,
`hit_disposition` enum('pass','tested','deny','poison') COLLATE utf8_bin NOT NULL DEFAULT 'pass',
`ban_reason_table` enum('none','ban_agents','ban_ips','ban_networks','ban_ranges') COLLATE utf8_bin NOT NULL DEFAULT 'none',
`ban_reason_id` int(11) NOT NULL,
PRIMARY KEY (`hit_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;