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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
480
Rustのパフォーマンスに関するTips
osuke
4
5.1k
ARM TrustZone入門 / ARM TrustZone intro
osuke
30
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
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
120
Jetpack Compose メカニズム
skydoves
0
460
Heart of Swift Concurrency
koher
0
950
Workers Cache を知る
syumai
0
130
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
5
3.8k
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
290
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3.1k
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
180
WebAssembly in Android Apps 〜 WASMはJNIの夢を見るか
keiji
1
110
Verilogで学ぶCPU自作入門.pdf
uyuki234
1
340
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
250
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
8k
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3k
What's in a price? How to price your products and services
michaelherold
247
13k
The Curious Case for Waylosing
cassininazir
1
520
Designing for humans not robots
tammielis
254
26k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
900
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
My Coaching Mixtape
mlcsv
0
320
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
460
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
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