Showing posts with label UTM. Show all posts
Showing posts with label UTM. Show all posts

Feb 24, 2020

setup SSL VPN Client for Sophos UTM

概要

(1)ネットワーク定義、ユーザ定義の後、
(2)ユーザ向けポータル機能を有効にして、
(3)当該ユーザとしてログインし、
(4)ovpnファイルをダウンロード。
(5)デバイス側でのセットアップを行う。

注、上記(2),(3)を面倒がって、管理者でpemファイルを取得しても成功しない。
 (1)の後は、そこさえ気を付ければ難しくないです。

参考にしたところ

Sophos UTM: Remote Access via SSL and VPN - Configuration Guides
https://community.sophos.com/kb/en-us/116038
ここにあるマニュアルを参照すれば良い(↓)

Remote Access via SSL (UTM 9, English)
http://www.sophos.com/en-us/medialibrary/PDFs/documentation/utm90_Remote_Access_Via_SSL_geng.pdf

Setup a Sophos UTM SSL VPN In 7 Simple Steps!
https://www.fastvue.co/sophos/blog/sophos-utm-ssl-vpn-setup-guide/
本家サイトよりこちらの方がPDFを開く必要がなく、手軽かも。
細かい手順は、手元と一致しなかった(下記、例)が、ハマるような難度でもないです。
(例、アンドロイド用に「インストール」しようとしても、ovpnファイルダウンロードのみしか行われない..等)

Feb 7, 2020

Sophos UTM Home renew license

読まずにやっていてはまりかけたので、メモ

・ASG Home Use License expired renew?

i. MyUTMにログイン ( https://myutm.sophos.com )

ii. 右肩の 'License Management'をクリック。下にスクロールして 'Home User License’ セクションへ。

iii. license ID をクリックして、「license information」を開く

iv. 下にスクロールして、'Action' セクションへ。そして、'Delete License'をクリック。
すると「license will be expired」と言われる。
(注、expiredした後に作業に取り掛かった。手元ではUTMproxy機能は死んでいたが、
VPN機能自体は有効だった。vpn経由 & proxy不使用な環境下で作業可だった。)
'Ok expire license'をクリック。
自動的にライセンス管理ページへ飛ぶ。

v. 下にスクロールして、'Home User License’ セクションへ。そして、'Create License'をクリック。
新しい Home User Licenseが生成される。

vi. license ID をクリックし、スクロールして、‘Actions’ へ、さらに ‘Download License File’を選択。
このファイルを保存し、UTMアプライアンスにアップロードする

・参考、Download Sophos UTM Home Edition and follow instructions:


Jan 3, 2020

ホームIoTのセキュリティ対策

◆目的

1.自宅で TV、スマホ、PC、その他まとめて Sophos UTMの傘で保護。
2.直結ISPやマンションのスーパーマニアからのプライバシ保護(クラウドSPからの保護は残課題)。

◆環境

こんな環境整備をやってみた。



◆前提

1. ラズパイ起動時に、Sophos UTMとの間で、SSL-VPNセッションを自動的に確立し、
 ラズパイがSSL-VPNクライアントとして動作済みとします。
関連
・OpenVPN linux client automatically at boot、メモ
 https://akasaka-taro.blogspot.com/2019/12/openvpn-linux-client-automatically-at.html

2. さらにラズパイををAccess Point化して
 各ホームデバイスからインターネットアクセス可能とします。
関連
・raspberry pi を access point 化 (2018/01/09)
 https://akasaka-taro.blogspot.com/2018/06/raspiap.html
3. ラズパイに有線LANアダプタを追加、eth1として稼働済みとします。
 TVは やはり有線接続することにしました。
関連
・有線LANアダプタ、ラズパイ(Debian系)用
 https://akasaka-taro.blogspot.com/2020/01/landebian.html

◆起動スクリプト

『前提』が整ったら、残るはmasquerading等の設定。
raspberry pi を access point 化』でも触れた起動スクリプトを、以下の通り変更。

iw phy0 interface add mon0 type monitor; ifconfig mon0 up

dnsmasq --interface=eth1  --except-interface=lo --bind-interfaces --dhcp-range=$DHCP-ETH01,12h --server=$DNS-ETH01

dnsmasq --interface=wlan0 --except-interface=lo --bind-interfaces --dhcp-range=$DHCP-WLAN0,12h --server=$DNS-WLAN0

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

iptables -A FORWARD -i tun0  -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o tun0  -j ACCEPT

iptables -A FORWARD -i tun0  -o eth1  -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth1  -o tun0  -j ACCEPT

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

sysctl -w net.ipv6.conf.all.disable_ipv6=1 && sysctl -w net.ipv6.conf.default.disable_ipv6=1

/usr/sbin/route add    -net $UTM-NET gw $MANSION-ROUTER eth0
/usr/sbin/route delete default gw $MANSION-ROUTER eth0
/usr/sbin/route add    default gw $SSL-VPN-ADDR-IN-UTM tun0

cat /etc/resolv.conf.new > /etc/resolv.conf

※上記変数について
$DHCP-ETH01: ケーブル接続クライアント向けにeth1で割り当てるDHCPレンジ
$DNS-ETH01: 上記レンジのDNSサーバIP
$DHCP-WLAN0: Wi-Fiクライアント向けにwlan0で割り当てるDHCPレンジ
$DNS-WLAN0: 上記レンジのDNSサーバIP
$MANSION-ROUTER: マンションの(直結・上位の)ルータIP
$SSL-VPN-ADDR-IN-UTM: UTM自身に割り当てられたSSL-VPNのIP

◆その他、追加設定

/etc/resolv.conf が書き換わらないようにする(今回の環境では、dnsmasqのDNS設定がクライアントに反映されるので、必須でもないのだが、念のため)。

1. # vi /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
dns = none # この行を追加

2. # systemctl restart NetworkManager

参考
・[RHEL7]/etc/resolv.conf 強制上書き無効 (2017/10/20)
 https://qiita.com/a-hiroyuki/items/559ccde6d948d31af939



Dec 21, 2019

Reset Sophos UTM active IP licence count

split tunneling を定義しないまま SSL VPNした上で
最寄りの/24なネットワーク全体を走査すると、結果的にライセンスオーバーの誤認が起こりうる。そんな時の回避策。

1. To verify the existing license count

a) コンソール/sshでログオンして
 # /usr/local/bin/count_active_ip.plx --showcount
b) Webの管理メニューからは
 look to management / licensing / active IP's
 すると過去7日分の使用IPが確認できるらしい

2. To reset IP count

1) Login to unit via SSH (you must have the "loginuser"
     and "root" user passwords set via the web interface).
2) Type "cc" and hit enter
3) Type "licensing" and hit enter
4) Type "active_ips@" and hit enter
5) Type "=[]" and hit enter
6) Type ".." and hit enter
7) Type "user_limit_exceeded$" and hit enter
8) Type "=0" and hit enter
9) Tyipe "exit", to quit, and hit enter.

At this point the IP table should be flushed and the unit should no longer be in violation of the license.

Please keep in mind that this is a quick fix to a licensing issue.
If you really have too many devices on your network, please consider purchasing a license for the devices you have.

参考にしたところ

1 a), 2
  Reset Sophos UTM active IP licence count (2014.12.30)
https://community.spiceworks.com/how_to/103441-reset-sophos-utm-active-ip-licence-count

1(b)
  License usage: EXCEEDING 110% OF USER COUNT on Sophos UTM (2017.05.02)
https://community.sophos.com/products/unified-threat-management/f/utm-manager-formerly-acc/86750/license-usage-exceeding-110-of-user-count-on-sophos-utm

Dec 8, 2019

OpenVPN linux client automatically at boot、メモ

目的

ラズパイ起動時に、Sophos UTMとの間で、SSL-VPNセッションを自動的に確立する。

前提

Sophos UTM の基本設定は完了し、PCやスマホから手動でSSL-VPN接続して、インターネットWeb参照等できているものとします。
raspiの基本設定も同様に完了済みとします(Debian系ディストリビューション)。

導入

# apt install openvpn
 ※ OpenVPN≒SSL-VPN (ref. *1)

設定

1. Sophos UTMから証明書ファイルを取得
 (1) マネジメント>ユーザポータル>詳細タブで ユーザポータルページを有効にする。
 (2) VPNセッションを張りたいユーザの".ovpn"ファイルをダウンロード、
   /etc/openvpn/client/user0001.ovpn として保存。
 (3) ln -s /etc/openvpn/user0001.conf /etc/openvpn/client/user0001.ovpn
   (*.ovpn = *.conf として機能する)
2. SSL-VPNクライアントのクレデンシャル
 (1) 次のようにファイルを指定
      # vi /etc/openvpn/client/user0001.ovpn
    auth-user-pass /etc/openvpn/client/auth0001.txt
 (2) 上記TXTファイルの中身は次のように記述
  一行目:該当ユーザ名
  二行目:パスワード
  ※プレインテキストなのもどうかと思うが、
   rootでシングルユーザ前提の環境なら許容範囲か。
   念のため chmod 600 とかしておくと良いだろう(動作未確認)。

参考にしたところ

*1  よくある質問
 https://www.openvpn.jp/faq/
 『OpenVPNはSSL-VPNですか? はい』

・How to Connect to a VPN Automatically on Linux (2017.08.28)
 https://www.maketecheasier.com/connect-vpn-automatically-linux/

・Starting OpenVPN client automatically at boot
 https://askubuntu.com/questions/464264/starting-openvpn-client-automatically-at-boot

関連

・raspberry pi を access point 化 (2018.01.09)
 https://akasaka-taro.blogspot.com/2018/06/raspiap.html

May 11, 2019

メモ、中国でもLINE Facebook Gmailが使える「香港SIM」、その二

中国行きに備え、
前回(2018春)の「8日間2GB」版(約1,050円)に加え、
②今回「30日間3GB」版(約1,440円)も購入した(下写真)。
 

Amazonの日本語製品説明にタイポがあったりするので、制限ギリギリで使う人は写真の裏書もじっくり確かめる方が良いでしょう。

開通時China Unikom香港からSMSが届くが、任意の宛先にはSMS発信不可。
また音声通話もかけられない事を確認した(仕様通り)。

当該デバイスで初めて使う場合は「SIMを入れ替えて再起動後、APNに3gnetを設定。ローミングをOn」するが、私は以前に使った事があり、ローミングOn設定後すぐ使えた。

使用感

今回、下図の地域を数百キロ/日 移動した。
SIM二枚 & スマホ二台 有ると、二台とも電池切れするリスクも少なく、安心できる。
山間部も含め、メール、地図、ニュース記事を読む分には、いずれのSIMも問題なかった。


電波受信強度を示す▲が△に変わる場合もあった(すぐ▲に戻ってはいた)。
動画やVoIPが必要な場合は要注意かも(ホテルでSkypeした時は、まあ使えたが)。

ちなみに、この地域のホテルのWi-Fiは、日本のVPSとのVPN接続(PPTP, L2TP, 変則portのSSL-VPN)にいずれも接続できなかった。タイミングは、即座にブロックされる訳ではなく、「お、使えるか? にしても長過ぎる」と思っている内に接続失敗の旨 表示され、これを2, 3度試すとホテルのWi-Fi APから「Wi-Fi接続不可」と即時表示されるようになった。おしおきモードか!? 

毎晩別の(経営も当然異なる)ホテルで、この「おしおき」動作が共通していた点が興味深い。個々のWi-Fi APで、同じ設定に統一しているのだとしたら、その統制に驚くほかない。

そんなリスクを避ける意味でも、網通香港SIMの容易さ・手堅さを改めて感じる旅だった。

Dec 29, 2017

How to allow Skype through Sophos UTM

1. Purpose

  to use Skype with Sophos UTM Home Edition


2. Assumption

  The UTM has been configured and utilized for web surfing without issues

3. Configuration Procedure


3-1. Definitions & Users -> Network Definitions

  Define all IPs for Skype relay hosts.

ref. https://support.office.com/ja-jp/article/Office-365-URL-%E3%81%8A%E3%82%88%E3%81%B3-IP-%E3%82%A2%E3%83%89%E3%83%AC%E3%82%B9%E7%AF%84%E5%9B%B2-8548a211-3fe7-47cb-abb1-355ea5aa88a2#bkmk_lyo

3-2. Definitions & Users -> Service Definitions

  Define all ports for Skype relay hosts (except 443/tcp, which is already defined for web surfing)

ref. https://support.skype.com/ja/faq/FA148/skype-for-windows-desktopwoshi-yong-suruniha-donopotowokai-fang-surubi-yao-gaarimasuka


3-3. Network Protection -> Firewall

  allow outbound Service in [3-2] to the hosts in [3-1]
  for VPN users { not VPN Pool (L2TP, SSL),
  which didn't work in my environment }

3-4. Further Notes

  NO 45541 tcp/udp definition is necessary < -- verified on 30.Dec



Sophos UTM + squid + MS L2TP/IPsec

1. Purpose

To connect to the internal NIC for Web Admin of the UTM
under VPN (SSL and/or L2TP/IPsec) (through squid proxy)


2. Procedure 
2-1. The proxy config of MS L2TP/IPsec client didn't work

  Once configured as shown in the picture,
  it always goes thru proxy.

2-2. squid config


# vi /etc/squid/squid.conf
acl to_utm201712 dst a.b.c.d/32    # a.b.c.d = IP of Web Admin
    : ... snip ...
acl SSL_ports port 443
    : ... snip ...
acl CONNECT method CONNECT
    : ... snip ...
http_access allow CONNECT to_utm201712
http_access deny CONNECT !SSL_ports

# /etc/init.d/squid restart

2-3. Sophos UTM Home Edition

Management -> WebAdmin Settings
  Allowed Networks : hopefully limited to internal and VPN Pool IPs


Dec 5, 2017

さくらのVPSに私もSophos UTM Home Editionを導入してみた

漸くVPSでUTMが動くようになったので、メモ

1.目的

(1) 家のTVやraspiを保護すること
(2) 出先でもスマホを保護すること

2.実現手段

Sophos UTM Home Edition を選択
同ソフトのisoイメージを導入可能なクラウドを選択
同クラウド経由でデバイスを保護

出来れば青天井でなく、分かりやすい料金体系

で、AWSは諦めて、さくらのVPSにしました。
手元でVMまでは経験済みだったが、初めてのVPSで分かりやすい記事(*1)が有り、大変参考になりました。

3.導入と、ちょっとした路線変更

目的(1)を満たすには、自宅ルータでipsecのつもりだったが、
とりあえず L2TP over IPsec で始めることに。
 
この場合、インスタンス一個で実現可能。

NAT等のルールの書き方が独特で要注意{ 
  L2TPのIPアドレスプールではなく、
  L2TPユーザ( or グループ)を指定して定義
}

4.その他

一晩放っておくと、いろいろな protection結果が見れて興味深い。
視覚的にも見やすく分かりやすい。

23や2323は話題のMirai(亜種)か。
445は未だにWannaCry(亜種)か。
家のルータもだが、一分に一回は何かのスキャンが来るので油断できません。

そう言えば、OS導入時はコントロールパネルで、
ネットワーク切断しておいてもインストール出来たので
それが吉。

5.参考

*1) さくらのVPSに無料UTMのSophos UTM Home Editionを導入してみた。(2016/04/02)
https://serversmanvps.xn--ockc3f5a.com/2016/04/02/%E3%81%95%E3%81%8F%E3%82%89%E3%81%AEvps%E3%81%ABsophos-utm%E3%82%92%E5%B0%8E%E5%85%A5%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F%E3%80%82/


Mar 9, 2017

フォーティネット

・好調な2016年決算、日本法人はセキュリティファブリックの早期実現を目指す
 フォーティネット、2017年は本社に先駆けて「次世代」に着手 (03/09)

・どこのUTMが良いの?ベンダ比較の指標Gartners Magic Quadrant Report (2016/09/10)

Mar 3, 2017

ホームネットワークセキュリティー「Bitdefender BOX」

・ホームネットワークセキュリティー「Bitdefender BOX」の取り扱い開始 (03/02)

ソフトバンクグループのBBソフトサービス(())から、「希望小売価格:14,800円」

Bitdefender BOX 主な機能
1)ネットワーク上の全デバイスの検出と脆弱性診断
2)マルウェア、フィッシング詐欺、オンライン詐欺などをブロック
3)アクティブ脅威制御
4)モバイルによるネットワーク管理
5)パソコンやモバイル機器用のクライアントセキュリティ」

 「Bitdefender Box」国内発売、ホームネットワーク内のIoT機器やスマホ、PCを保護する箱 (03/02)

 Install BOX as a network companion, connected to an existing router
 図からすると、配線の変更は要らなさそう

 Smart security for all your connected devices.
Does Bitdefender BOX protect my mobile devices when I leave my home?

Yes. When you activate the Private Line feature, Bitdefender BOX will setup a secured VPN (Virtual Private Network) to protect your mobile devices outside your home network.

 1万円台の家庭用IPS「Bitdefender Box」、IoT機器の脆弱性を自動検出 (03/02)
  「同種の家庭用IPS製品にはトレンドマイクロの「ウイルスバスター for Home Network」が
   あるぐらいで、まだ大きな市場にはなっていない。

Mar 2, 2017

Sophos UTM Home Edition (03/02)

Blocking File Upload (2013/04/23)

 「I think the answer to your question is "No."

Sophos UTM。
一定バイト数以上のPOST methodをブロックする機能があれば、
ホームユーザ環境で見落としている? C&Cサーバとの通信をブロックできて、ユーザ層を拡大し、結果的に
企業ユーザ獲得につながる? 、、、と販売戦略的に良いと思ったのだが、
そうしたやりとりは相当数あったようで(下記参照)、
DLP(別の製品群)には実装されたが、UTMには未だ っぽい

Can i block file uploading... (2011/08/09)

As I posted above, there isn't a way to do this without blocking portions of the http specification itself and it would break the app.
...
This is a technology family generally known as DLP or Data Loss (or Leak) Prevention and doesn't currently exist in Astaro. 
There is already a feature request for this functionality if you want to add points or a comment to it:  Networking: Data Leak Prevention System (DLP).

Ref. Sophos UTM Home Edition (02/21)

Feb 23, 2017

How to Install Sophos UTM

Here is the DM I got after registering for its license. It also can be a good quick startup guide.

How Do I Install Sophos UTM?

You may install Sophos UTM as a software appliance, either on a dedicated Intel compatible PC or within any virtual environment. Your hardware/VM needs to comply with the following minimum hardware requirements:
  • Single-core Intel processor
  • Bootable CD-ROM
  • 1 GB RAM (2GB Recommended)
  • 40 GB hard disk
  • 2 or more network interfaces

Installing the Software Appliance

Please note: Sophos UTM contains its own operating system and will overwrite all data on the system during the installation process. Therefore a separate, dedicated computer/VM is needed.
  1. Download the latest ISO image found here:
    UTM Download
  2. Burn this image onto a CD or attach the ISO to a virtual CD ROM
  3. Boot the PC/VM you wish to dedicate to Sophos UTM from the ISO CD-ROM drive
  4. Follow the on-screen installation instructions. The WebAdmin URL will be shown in the final step of the installation.
  5. Point your browser to the web-based configuration tool (WebAdmin)
  6. Follow the wizard to setup a basic configuration

Further Questions & Support

We have a number of resources to help you get the most from your trial:
  1. Download the latest Getting Started Guides at: www.sophos.com/en-us/support/documentation.aspx
  2. Watch the video demos to see Sophos UTM in action: www.sophos.com/products/unified-threat-management/videos.aspx
  3. Explore the online demo at: www.sophos.com/utm
  4. Check out the User Bulletin Board: www.astaro.org
A local representative will be in contact with you shortly to ensure that you get the most out of your Sophos UTM trial.
We hope that you enjoy the Sophos UTM experience!

Kind regards,
Sophos


ref. Sophos UTM Home Edition (02/21)
  http://akasaka-taro.blogspot.jp/2017/02/sophos-utm-home-edition.html

Feb 21, 2017

Sophos UTM Home Edition

なんと自宅利用者には無料のUTM。
ダウンロードはこちらから
        ↓
・Sophos UTM Home Edition
 https://www.sophos.com/ja-jp/products/free-tools/sophos-utm-home-edition.aspx

クイックスタートアップガイド的な物。ベアボーンでの事例紹介も
   ↓
・家庭のセキュリティも アンチウイルスから UTMの時代へ - Sophos
 https://www.sophos.com/ja-jp/medialibrary/PDFs/other/SophosUTMHome.pdf

 こちらも参考にした。
   ↓
 自宅にUTMを設置 (2015/01/30)
 http://blog.livedoor.jp/oph_oph/archives/1890551.html
 ←「手順」が簡潔で分かりやすい。

ベアボーンキットを衝動買いしたくなったが、ひとまずVMで。
手元ではeth0を外側、デフォルトゲートウェイ有り、eth1を内側に意識しつつ準備しておけば、ここのリンク先を拾い読みする程度で、アンチウイルスゲートウェイとして直ぐ稼働した。インストーラーが良く出来ている(OSで ip_forward または sysctl.confを編集、、、とかは不要)。

図、テスト環境           

図、eicarテストウィルスで稼働を確認 

下図は、広告がブロックされたところ。けしからん系のサイト?では無用な広告がカットされて、良い感じにサクサク見れる(笑)

お子さんの居るご家庭では、アダルトコンテンツのブロック設定も簡単そう。

真面目な記事としては、こちらも参考になった。
  ↓
・さくらのVPSに無料UTMのSophos UTM Home Editionを導入してみた。 (2016/04/02)
 https://serversmanvps.ヒナギク.com/2016/04/02/%E3%81%95%E3%81%8F%E3%82%89%E3%81%AEvps%E3%81%ABsophos-utm%E3%82%92%E5%B0%8E%E5%85%A5%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F%E3%80%82/

なるほど、クラウドに導入しておけば、出先でもVPN接続して、ガードが活きる使い方ができますね。

費用をどう考えるか、ひとまずこのまま。もっと使い込んでみよう。。。
テレビ・スマホの保護は arp spoofing でこなそうか、思案中。

・関連、arp spoofingで配線変更要らずなトレンドマイクロ製品
 ウイルスバスター for Home Netweork
 http://akasaka-taro.blogspot.jp/2017/01/blog-post_26.html