Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Rustで実装された AWS Nitro Enclaves CLIを読む
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Osuke
December 07, 2020
Programming
450
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rustで実装された AWS Nitro Enclaves CLIを読む
Osuke
December 07, 2020
More Decks by Osuke
See All by Osuke
特許データを使ったマルチモーダルAIの検証事例@LLMProd#4
osuke
0
350
dbtを中心に据えた データ分析とプロダクト開発
osuke
1
1.2k
LayerX Privacy Tech事業部紹介 Tech編
osuke
2
270
(SCIS2021) Anonify: プライバシーを保護した 検証可能な状態遷移モジュール
osuke
1
470
Rustのパフォーマンスに関するTips
osuke
4
5.1k
ARM TrustZone入門 / ARM TrustZone intro
osuke
29
11k
Anonify
osuke
3
1.2k
Rustのasync/awaitとスケジューラの話 / rust-async-await
osuke
9
4.2k
Privacy on Blockchain
osuke
1
1.3k
Other Decks in Programming
See All in Programming
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
150
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
180
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
210
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
240
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
130
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
160
What We Talk About When We Talk About XP
m_seki
2
590
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
200
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
Security issues being discussed on Web Platforms
petamoriken
0
840
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
660
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
230
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
280
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
480
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Music & Morning Musume
bryan
47
7.4k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
700
Joys of Absence: A Defence of Solitary Play
codingconduct
1
510
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
Transcript
1 Rustで実装された AWS Nitro Enclaves CLIを読む Osuke Sudo 2020/12/7 @Rust
LT Online #2
2 @zoom_zoomzo Osuke ソフトウェアエンジニア@LayerX • 暗号技術・TEEを用いたデータのプライバシー保護・改ざん 耐性手法の研究開発(Confidential Computing) • Anonifyの開発
◦ https://github.com/LayerXcom/anonify
3 アジェンダ • AWS Nitro Enclacvesとは • Enclave起動までの処理の流れ • EIFイメージ展開とメモリ割り当て
4 • 高度にセキュアな情報を扱うことを想定し、AWS Nitro Systemにより提供される隔離保護された実行環境 ◦ 軽量なkvmベースのハイパーバイザ + ネットワーク・ストレージのオフロード +
セキュリティチッ プなど • それぞれのEnclaveには、EC2のメモリやCPUリソースを割り当てることができ、独立したカーネルOS上 で動作 • Enclaveは親EC2とのvsockのみでやりとり可能(外部のネットワークやストレージに接続することはでき ず、admin IAM権限でもユーザーアクセスはできない) AWS Nitro Enclavesとは https://aws.amazon.com/jp/blogs/aws/aws-nitro-enclaves-isolated-ec2-environments-to-process-confidential-data/
5 Nitro Enclacve CLI • Nitro-cliでdocker imageからEIF(Enclave Image File)をビルド可能 •
EIFと割り当てるメモリ、vCPUを指定しenclaveを起動
6 enclave起動までの処理 1. 親プロセス:CLIコマンドでコミュニケーションするためのEnclave用デーモンの生成 2. デーモン:コマンドを受け取るためのevent loopを回す 3. 親プロセス:socketにrun-enclaveコマンドを送信 4.
デーモン:nitroデバイスファイルへVM生成コマンド送信 5. デーモン:メモリの割り当てとEIFをメモリに書き込み 6. デーモン:vCPUの割り当て 7. デーモン:nitroデバイスファイルを介しenclaveをスタート 8. 親プロセス:enclaveからのレスポンスを処理し表示 参考: Rustで実装されたAWS Nitro Enclaves CLIの実装を読む https://qiita.com/Osuke/items/81d928bd2a46fab46cbc
7 init_memory(): メモリ領域の確保 • Run-enclaveコマンドの引数として渡したメ モリサイズ分だけメモリ領域を確保 • それぞれのregionがhuge-pageに対応し、 libc::mmap()により割り当て
8 init_memory(): EIFイメージの展開 • NE_GET_IMAGE_LOAD_INFOコマンドでioctlを呼 び、EIFイメージを展開するメモリのオフセットを Nitro Systemから取得 • 確保したメモリ領域とイメージ展開オフセットから
実際にEIFを書き込む • ページごとにNE_SET_USER_MEMORY_REGIONコ マンドでioctlを呼び、デバイスドライバにセット ◦ (KVMでいうところの KVM_SET_USER_MEMORY_REGIONで実行 バイナリをVMにセットしているイメージ)
9 • Rustで実装されたAWS Nitro Enclaves CLIの実装を読む ◦ https://qiita.com/Osuke/items/81d928bd2a46fab46cbc • Nitro
Enclaves Command Line Interface (Nitro CLI) ◦ https://github.com/aws/aws-nitro-enclaves-cli • Deep Dive Into AWS Nitro Enclaves - AWS Online Tech Talks ◦ https://youtu.be/K5PRNHaEdOw • AWS re:Invent 2019: Powering next-gen Amazon EC2: Deep dive into the Nitro system (CMP303-R2) ◦ https://youtu.be/rUY-00yFlE4 References