Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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.8k
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
3k
カンム と React Native / Kanmu React Native
mururu
0
3.8k
カンムでの React Native の 歴史と現在 / React Native in Kanmu
mururu
1
540
Building FIDO2 server in Go
mururu
2
7.2k
「ElixirがリアルタイムWebに強い」 というのは本当か?
mururu
13
6.6k
Erlang: Improve the performance of cryptographic functions by AES-NI
mururu
1
260
Treasure Data Summer Intern 2015 Final Report
mururu
0
3.2k
Elixir 1.0
mururu
3
880
Why Elixir
mururu
9
2k
Other Decks in Programming
See All in Programming
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
160
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
190
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
120
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
190
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
140
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
210
マスタデータ問題、マイクロサービスでどう解くか
kts
0
120
gunshi
kazupon
1
110
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
590
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
630
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
160
AIエージェントの設計で注意するべきポイント6選
har1101
5
2.2k
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.4k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
0
63
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
120
エンジニアに許された特別な時間の終わり
watany
105
220k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
60
37k
Balancing Empowerment & Direction
lara
5
820
Paper Plane (Part 1)
katiecoart
PRO
0
1.9k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
210
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
47k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
97
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