Share
Embed
Transcript
33 slides
-
.debの野良ビルド .debの野良ビルド 〜squid + ssl-bumpを例に〜 佐々木 洋平/Youhei SASAKI [email protected] Debian
JP Project/関西Debian勉強会 関西Debian + LILO + 東海道らぐ + openSUSE 合同 LT 大会 2020年1月27日(日) -
About me https://about.me/uwabami Name&Contact: 佐々木洋平/Youhei SASAKI ✓ twitter: uwabami, mastodon:
[email protected] ✓ FLOSS and Debian lover Debian Project, Debian JP Project, 関西Debian勉強 会 Scientific Computing, Ruby, TeX, Emacs, ... ✓ -
squid の SSL Bump? 語弊がありそうですが, ざっくりと言えば 「SSLを処理するため」のモードのこと 動作はほぼ MTM Squid
が一旦 SSL の暗号をほどき, a. 検証等の処理をした後に, b. Squid が SSL の暗号処理をしてクライアントに渡す c. 詳細は後述or割愛 -
ラズパイの Squid で SSL bump Raspbian(およびDebian)の Squid SSL Bump を無効化してある
ビルド仕直すと使える Raspbian = Debian ベース ビルド仕直せば良いじゃん. 簡単だよ パッケージの(野良)ビルドについて そういや最近やってないな -
Squid の SSL Bump (再掲) 動作はほぼ MTM Squid が一旦 SSL
の暗号をほどき, a. 検証等の処理をした後に, b. Squid が SSL の暗号処理をしてクライアントに渡す c. 3つの stepと 5つのmode mode: splice, bump, peek, stare, terminate -
Squid の SSL Bump: 3つのStep Step: どのタイミングで bump するか At
each SslBump step, Squid evaluates ssl_bump directives to find the next bumping action (e.g., peek or splice). Valid SslBump step values and the corresponding ssl_bump evaluation moments are: SslBump1: After getting TCP-level and HTTP CONNECT info. SslBump2: After getting SSL Client Hello info. SslBump3: After getting SSL Server Hello info. -
Squid の SSL Bump: 5つのモード(1) モード: どの様に処理するか? splice(default): Become a
TCP tunnel without decrypting proxied traffic. ✓ terminate: Close client and server connections. ✓ -
Squid の SSL Bump: 5つのモード(2) bump: When used on step
SslBump1, establishes a secure connection with the client first, then connect to the server. ✓ When used on step SslBump2 or SslBump3, establishes a secure connection with the server and, using a mimicked server certificate, with the client. ✓ -
Squid の SSL Bump: 5つのモード(3) peek: Receive client (step SslBump1)
or server (step SslBump2) certificate while preserving the possibility of splicing the connection. ✓ Peeking at the server certificate (during step 2) usually precludes bumping of the connection at step 3. ✓ -
Squid の SSL Bump: 5つのモード(4) stare: Receive client (step SslBump1)
or server (step SslBump2) certificate while preserving the possibility of bumping the connection. ✓ Staring at the server certificate (during step 2) usually precludes splicing of the connection at step 3. ✓ -
Squid の SSL Bump: 設定例 # Example: Bump all TLS
connections except those # originating from localhost or those going to example.com. acl broken_sites ssl::server_name .example.com ssl_bump splice localhost ssl_bump splice broken_sites ssl_bump bump all モード: splice: 素通し, bump: 剥いて再SSL化 -
Squid の SSL Bump: 5つのモードと3つのstep SSL検証と再署名・暗号化のためのツール 今回は触れていません(内蔵されてます) うまく使うとイロイロ捗る ペアレンタルコントロール, エルサゲート対応
まだ SSLv3 なアレコレへの対処, ...etc. -
野良パッケージのビルド 一般的な例 % sudo vim /etc/apt/sources.list # <-- deb-src の追加
... % sudo apt-get update # <-- DB の更新 % apt-get source squid # <-- ソースの取得 % apt-get build-dep squid # <-- 依存パッケージの取得 ... ソースの修正 % apt-get install \ # <-- 野良ビルド用の build-essential fakeroot... # パッケージの取得 % debuild -rfakeroot -uc -us # <-- ビルド build-dep 知らない人が多いよね -
野良パッケージのビルド (1)deb-srcの追加 「まっとうなリポジトリ」ならソースパッケージも公 開してます. deb http://raspbian. ... deb-src http://raspbian. ...
DB を更新するとソースパッケージが取得できます. % sudo apt-get update % apt-get source squid -
野良パッケージのビルド (3)ssl-bumpの有効化 debian/rules にconfigure optionを追加 diff --combined debian/rules index e0952f62,ba9104f3..00000000
--- a/debian/rules +++ b/debian/rules @@@ -62,8 -62,6 +62,8 @@@ DEB_CONFIGURE_EXTRA_FLAGS := BUILDCXXFL --with-filedescriptors=65536 \ --with-large-files \ --with-default-user=proxy \ + --enable-ssl-crtd \ + --with-openssl \ --with-gnutls ifeq ($(DEB_HOST_ARCH_OS), kfreebsd) -
野良パッケージのビルド (4)ssl-bumpの有効化 debian/control に SSL 関連の依存を追加 diff --combined debian/control index
d10052dc,8d23f69e..00000000 --- a/debian/control +++ b/debian/control @@@ -26,7 -26,6 +26,7 @@@ Build-Depends: ed, libltdl-dev, pkg-con , libsasl2-dev , libxml2-dev , nettle-dev + , libssl-dev Package: squid3 Architecture: all -
野良パッケージのビルド (6)バージョン番号を更新 順番が前後しますが,ビルド用パッケージ一式を導入. % sudo apt-get install devscripts debhelper build-essential
debian/changelog の更新 % dch --nmu