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.6k
カンムでの React Native の 歴史と現在 / React Native in Kanmu
mururu
1
500
Building FIDO2 server in Go
mururu
2
6.9k
「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
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
330
Benchmark
sysong
0
270
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
400
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
100
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
120
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
110
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.4k
A2A プロトコルを試してみる
azukiazusa1
2
1.1k
VS Code Update for GitHub Copilot
74th
1
360
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
240
エラーって何種類あるの?
kajitack
5
310
Deep Dive into ~/.claude/projects
hiragram
8
1.4k
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
Speed Design
sergeychernyshev
32
1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
930
Practical Orchestrator
shlominoach
188
11k
Rails Girls Zürich Keynote
gr2m
94
14k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Automating Front-end Workflow
addyosmani
1370
200k
Writing Fast Ruby
sferik
628
61k
Unsuck your backbone
ammeep
671
58k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
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