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.6k
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.7k
カンム と React Native / Kanmu React Native
mururu
0
3.5k
カンムでの React Native の 歴史と現在 / React Native in Kanmu
mururu
1
460
Building FIDO2 server in Go
mururu
2
6.7k
「ElixirがリアルタイムWebに強い」 というのは本当か?
mururu
13
6.5k
Erlang: Improve the performance of cryptographic functions by AES-NI
mururu
1
220
Treasure Data Summer Intern 2015 Final Report
mururu
0
3.1k
Elixir 1.0
mururu
3
820
Why Elixir
mururu
9
2k
Other Decks in Programming
See All in Programming
CloudNativePGを布教したい
nnaka2992
0
110
Honoとフロントエンドの 型安全性について
yodaka
7
1.4k
Introduction to kotlinx.rpc
arawn
0
760
ファインディLT_ポケモン対戦の定量的分析
fufufukakaka
0
920
複数のAWSアカウントから横断で 利用する Lambda Authorizer の作り方
tc3jp
0
110
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
190
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
170
2025.2.14_Developers Summit 2025_登壇資料
0101unite
0
180
Jasprが凄い話
hyshu
0
150
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
7
4.2k
生成AIで加速するテスト実装 - ロリポップ for Gamersの事例と 生成AIエディタの活用
kinosuke01
0
110
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
230
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
How to Ace a Technical Interview
jacobian
276
23k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
133
33k
The Language of Interfaces
destraynor
156
24k
Visualization
eitanlees
146
15k
For a Future-Friendly Web
brad_frost
176
9.6k
We Have a Design System, Now What?
morganepeng
51
7.4k
Designing for Performance
lara
604
68k
Being A Developer After 40
akosma
89
590k
How to train your dragon (web standard)
notwaldorf
91
5.9k
Raft: Consensus for Rubyists
vanstee
137
6.8k
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