トップ «前の日記(2013-02-02) 最新 次の日記(2013-08-24)» 編集

"yasunori's tedious diary"

2005|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|08|09|10|11|
2011|01|03|04|05|06|07|08|09|10|11|12|
2012|01|03|04|05|08|09|10|
2013|01|02|08|09|10|11|12|
2014|01|03|04|07|08|09|10|
2015|01|07|08|09|10|12|
2016|01|02|03|04|
2017|11|
2026|08|

2013-08-17

_ [コンピュータ] squidGuard のメモ

小学4年生になるタロウに専用のパソコンを使わせることにしたので、URL フィルタリングを導入することにした。Windows のペアレンタルロックは別途様子を見て入れる。
ports で squidGuard があったのでそれを入れることにした。以下備忘録。

/usr/local/etc/squid/squid.conf の編集(追記) port 10080 は iphone/iPad 用の広告ブロック用につかっているので、10081 を子供用に squidGuard のリダイレクト対象として追加する。

#
# squidGuard
#
acl proxy_normal myport 10080
acl proxy_guard myport 10081
url_rewrite_access deny SSL_ports
url_rewrite_access deny localhost
url_rewrite_access deny !proxy_guard
url_rewrite_access allow proxy_guard
url_rewrite_program /usr/local/bin/squidGuard -c /usr/local/etc/squid/squidGuard
.conf

/usr/local/etc/squid/squidGuard.conf を作成。サンプルを変更して、ルールの追加した。 時間指定はとりあえずやらない。

dbhome /var/db/squidGuard
logdir /var/log/squid
#
# TIME RULES:
# abbrev for weekdays:
# s = sun, m = mon, t =tue, w = wed, h = thu, f = fri, a = sat
time allowhours {
     weekly smtwhfa 07:00 - 21:30
}
#
# SOURCE ADDRESSES
#
source localnet-clients {
     ip 192.168.124.0/24
}
source allowhosts {
     ip 192.168.124.1
}
#
# DESTINATION CLASSES
#
dest hacking {
        domainlist hacking/domains
        urllist hacking/urls
}
(略)
dest localrule {
        domainlist localrule/domains
        urllist localrule/urls
        log /var/log/squid/block.log
}
acl {
     allowhosts {
        pass any
     }
     #localnet-clients within allowhours {
     localnet-clients {
         pass     !hacking !violence !proxy !porn !mail !warez !gambling !drugs
!audio-video !aggressive !ads !in-addr !localrule
     }
     default {
         pass     none
         redirect http://www.furuta.com/
     }
}

追加したルールは /var/db/squidGuard 以下に配置。owner/group を squid:squid にしておくこと。(これをしないと読めなくてはまる)
ルールを追加したら、以下の処理を忘れずに実行。

# /usr/local/bin/squidGuard -C all

トップ «前の日記(2013-02-02) 最新 次の日記(2013-08-24)» 編集