Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Go製のネットワーククライアントに対する継続的 / Fuzzing for network c...
Search
mururu
April 24, 2021
Programming
4
2.7k
Go製のネットワーククライアントに対する継続的 / Fuzzing for network client in Go
Go Conference 2021 Spring
mururu
April 24, 2021
Tweet
Share
More Decks by mururu
See All by mururu
Go で始める将棋 AI
mururu
1
2.9k
カンム と React Native / Kanmu React Native
mururu
0
3.7k
カンムでの React Native の 歴史と現在 / React Native in Kanmu
mururu
1
500
Building FIDO2 server in Go
mururu
2
7k
「ElixirがリアルタイムWebに強い」 というのは本当か?
mururu
13
6.5k
Erlang: Improve the performance of cryptographic functions by AES-NI
mururu
1
240
Treasure Data Summer Intern 2015 Final Report
mururu
0
3.1k
Elixir 1.0
mururu
3
850
Why Elixir
mururu
9
2k
Other Decks in Programming
See All in Programming
TypeScriptでDXを上げろ! Hono編
yusukebe
3
720
NEWT Backend Evolution
xpromx
1
120
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
16
12k
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
290
VS Code Update for GitHub Copilot
74th
2
670
20250708_JAWS_opscdk
takuyay0ne
2
120
フロントエンドのパフォーマンスチューニング
koukimiura
5
1.9k
型で語るカタ
irof
0
640
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
2
650
Claude Code派?Gemini CLI派? みんなで比較LT会!_20250716
junholee
1
210
Git Sync を超える!OSS で実現する CDK Pull 型デプロイ / Deploying CDK with PipeCD in Pull-style
tkikuc
4
310
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
830
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Navigating Team Friction
lara
187
15k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Practical Orchestrator
shlominoach
189
11k
Embracing the Ebb and Flow
colly
86
4.8k
How GitHub (no longer) Works
holman
314
140k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
4 Signs Your Business is Dying
shpigford
184
22k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
47
9.6k
Transcript
Go 製のネットワーククライアントに対 する継続的 Fuzzing 伊藤 友気 2021.4.24 Go Conference 2021
Spring
Copyright Kanmu, Inc. All right reserved. 2 伊藤 友気 CTO
at Kanmu, Inc. @mururu @mururururu 自己紹介
Copyright Kanmu, Inc. All right reserved. 3 バンドルカードつくってます
Copyright Kanmu, Inc. All right reserved. 4 Fuzzing とは Go
と Fuzzing 継続的な Fuzzing の実例と課題 1 2 3 アジェンダ
Fuzzing とは 1
Copyright Kanmu, Inc. All right reserved. Fuzzing とは 6 1
テキストを入れたり。テキストを入れたり。テキストを入れた り。テキストを入れたり。テキストを入れたり。テキストを入 れたり。テキストを入れたり。テキストを入れたり。 予測不可能なデータをインプットとして与えることによりその不具合 を発見するテスト手法
Copyright Kanmu, Inc. All right reserved. Fuzzing とは 7 1
テキストを入れたり。テキストを入れたり。テキストを入れた り。テキストを入れたり。テキストを入れたり。テキストを入 れたり。テキストを入れたり。テキストを入れたり。 • ブラックボックステスト • 予測不可能な大量のデータ(fuzz)を自動で生成してシステムに 入力しその挙動を監視することで、不具合、脆弱性を発見する ファジングツール (fuzzer) fuzz
Copyright Kanmu, Inc. All right reserved. Fuzzing とは - なぜ
8 1 テキストを入れたり。テキストを入れたり。テキストを入れた り。テキストを入れたり。テキストを入れたり。テキストを入 れたり。テキストを入れたり。テキストを入れたり。 • あらゆる入力を事前に予測したり、静的に検証したりすることは 多くの場合容易ではない ◦ それは思いつかないみたいなコーナーケース • ならば自動で大量にデータを生成して入力してみようという手法 のテスト手法の一つ ファジングツール (fuzzer) fuzz
Copyright Kanmu, Inc. All right reserved. Fuzzing とは - バリエーション
9 1 テキストを入れたり。テキストを入れたり。テキストを入れた り。テキストを入れたり。テキストを入れたり。テキストを入 れたり。テキストを入れたり。テキストを入れたり。 • fuzz の生成方法 • テスト対象やそれに応じた fuzz の与え方 • 商用 / OSS • 有名どころ ◦ AFL ◦ libfuzzer
Go と Fuzzing 2
Copyright Kanmu, Inc. All right reserved. Go と Fuzzing 11
2 テキストを入れたり。テキストを入れたり。テキストを入れた り。テキストを入れたり。テキストを入れたり。テキストを入 れたり。テキストを入れたり。テキストを入れたり。 こんなコード書いてしまったことないですか?
Copyright Kanmu, Inc. All right reserved. Go と Fuzzing -
dvyukov/go-fuzz 12 2 テキストを入れたり。テキストを入れたり。テキストを入れた り。テキストを入れたり。テキストを入れたり。テキストを入 れたり。テキストを入れたり。テキストを入れたり。 • dvyukov/go-fuzz ◦ Go のファジングツールのデファクト ◦ Go 本体のバグも多く検出している
Copyright Kanmu, Inc. All right reserved. Go と Fuzzing -
dvyukov/go-fuzz 13 2 テキストを入れたり。テキストを入れたり。テキストを入れた り。テキストを入れたり。テキストを入れたり。テキストを入 れたり。テキストを入れたり。テキストを入れたり。 • Fuzz 関数を定義して対象の関数を呼びだす • go-fuzz-build でビルドして go-fuzz で実行するだけ
Copyright Kanmu, Inc. All right reserved. Go と Fuzzing -
余談 14 2 テキストを入れたり。テキストを入れたり。テキストを入れた り。テキストを入れたり。テキストを入れたり。テキストを入 れたり。テキストを入れたり。テキストを入れたり。 • Design Draft: First Class Fuzzing : golang.org/s/draft-fuzzing-design • dev branch: https://github.com/golang/go/tree/dev.fuzz
継続的な Fuzzing の実例と課題 3
Copyright Kanmu, Inc. All right reserved. 継続的 Fuzzing - テスト対象
16 3 • カード決済に関するメッセージのやりとりをするクライアント • サーバーとは TCP のコネクション張りっぱなしで管理下の カードを用いた決済が行われた際にサーバーから ISO8583 という規格のフォーマットでメッセージが発行され る • この ISO8583 のメッセージのパースを対象としている • 初期値として用いる corpus (fuzz) はもともとのテストデータ など
Copyright Kanmu, Inc. All right reserved. 継続的 Fuzzing - テスト対象
17 3
Copyright Kanmu, Inc. All right reserved. 継続的 Fuzzing - テスト対象
18 3
Copyright Kanmu, Inc. All right reserved. 継続的 Fuzzing - テスト対象
19 3
Copyright Kanmu, Inc. All right reserved. 継続的 Fuzzing - テスト方法
20 3 • テスト対象とする Fuzz 関数を用意 • GitHub Actions 上で go-fuzz-build でビルドし libfuzzer で Fuzzing、を毎日定時実行 • crash する fuzz が見つかれば自動で corpus に追加する PR を作成する
Copyright Kanmu, Inc. All right reserved. 継続的 Fuzzing - テスト方法
1 21 3
Copyright Kanmu, Inc. All right reserved. 継続的 Fuzzing - テスト方法
2 22 3
Copyright Kanmu, Inc. All right reserved. 継続的 Fuzzing - テスト方法
3 23 3 • crash したらその corpus の追加の PR が自動で作成される • crash した corpus は リグレッションテストのテストケースとしても使 われ、次回以降通常のCI上でのテストでも使われる
Copyright Kanmu, Inc. All right reserved. 継続的 Fuzzing - 課題
24 3 • go-fuzz / libfuzzer が macOS 未サポートのため mac で開発していると素直にローカルで実行できない • 初期値として用いる corpus の管理、更新、最適化を いい感じにやりたい
Copyright Kanmu, Inc. All right reserved. 25 • Fuzzing は大量のデータを自動生成してシステムに入
力することにより不具合を検出するテスト手法 • Go で Fuzzing をするのは現状でも結構簡単 まとめ
Go製のネットワーククライアントに対 する継続的Fuzzing 伊藤 友気 2021.4.24 Go Conference 2021 Spring