Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SORACOM Arc Inside!! / SORACOM Meetup Arc tech overview

SORACOM Arc Inside!! / SORACOM Meetup Arc tech overview

2021年7月27日(火)SORACOM Meetup〜Wi-Fiからもソラコムを!はじめよう新サービスSORACOM Arcにて、ソラコム ソフトウェアエンジニア 川上 大喜が発表した資料です。

イベントページ:https://soracom.connpass.com/event/218134/

SORACOM

July 27, 2021
Tweet

More Decks by SORACOM

Other Decks in Technology

Transcript

  1. SORACOM Arc Technical Overview SORACOM Meetup 〜 Wi-Fiからもソラコムを! はじめよう新サービスSORACOM Arc

    Jul. 27th, 2021 株式会社ソラコム エンジニア 川上 大喜 (@moznion)
  2. なぜWireGuard? • 最新の暗号化手法を採用したVPNソリューション • 高速・好パフォーマンス • シンプル • 構成 •

    設定 • Linux Kernel 5.6+ からはカーネルに標準搭載 • Linux Kernel 以外にも動く実装が多数
  3. なぜWireGuard? • 最新の暗号化手法を採用したVPNソリューション • 高速・好パフォーマンス • シンプル • 構成 •

    設定 • Linux Kernel 5.6+ からはカーネルに標準搭載 • Linux Kernel 以外にも動く実装が多数
  4. なぜWireGuard? • 最新の暗号化手法を採用したVPNソリューション • 高速・好パフォーマンス • シンプル • 構成 •

    設定 • Linux Kernel 5.6+ からはカーネルに標準搭載 • Linux Kernel 以外にも動く実装が多数
  5. なぜWireGuard? – 多様な実装 • サポートしている (Appがある) OS • iOS •

    Android • macOS • Windows • FreeBSD • 様々な言語レベルでの対応 • Golang • https://github.com/WireGuard/wireguard-go • Rust • https://github.com/WireGuard/wireguard-rs • 組み込み向け • lwIP • https://github.com/smartalock/wireguard-lwip • Arduino on ESP32 • https://github.com/ciniml/WireGuard-ESP32-Arduino
  6. なぜWireGuard? – 多様な実装 • Soratun • SORACOM ArcのためのWireGuardクライアント • Soratunを動かしておけば別途WireGuardの

    デーモンを動作させる必要がない • 詳細はこの次の弊社CRE佐藤の発表で……
  7. SORACOM Arc はなぜつながるのか • Arcの利用に際してはVirtual SIMの作成が必要 • Virtual SIMのIMSIとIPアドレス/鍵情報が内部的に対応 •

    「VPN内のIPアドレス」と「鍵情報」がマッチしたときに WireGuardのトンネルが確立される • => トンネルが確立すると推移的にIMSIを特定できる • i.e. Virtual SIMの正体 • lMSI (トリビア: このIMSIは必ず `99999` からはじまる) • Device Peerの公開鍵
  8. SORACOM Arc はなぜつながるのか Device Private Key: XXX Device IP: 192.0.2.123

    Arc Server Public Key: YYY Arc Server Endpoint: example.arc.soracom.io 以下が全て満たされた時、トンネルを確立 • 送信されてきたArcサーバーの公開鍵と サーバーの秘密鍵が合致するかどうかを確認 • Device IPに関連するDeviceの公開鍵を探索 • その公開鍵と送信されてきたDevice秘密鍵 情報 (厳密には秘密鍵そのものではありません) が合致するかどうかを確認 リクエスト (トンネル確立ハンドシェーク) 送信 IMSI: 99999XXXXXXXXXX
  9. デバイスのブートストラップ - API Virtual SIM作成API API Server Arc Endpoint デバイスからVirtual

    Simを作成するシナリオ WireGuardセットアップ 作成したVirtual SIM情報 • IMSI • IP Address • Device Private Key • Device Public Key • Arc Server Endpoint • Arc Server Public Key
  10. デバイスのブートストラップ - API Virtual SIM作成API 作成したVirtual SIM情報 • IMSI •

    IP Address • Device Private Key • Device Public Key • Arc Server Endpoint • Arc Server Public Key API Server Arc Endpoint WireGuardトンネル確立リクエスト トンネル確立 デバイスからVirtual Simを作成するシナリオ
  11. デバイスのブートストラップ - API API Server Arc Endpoint 既存のVirtual Simをデバイスに当てて使うシナリオ Virtual

    SIMを再度作成する必要はない WireGuardトンネル確立リクエスト トンネル確立 作成したVirtual SIM情報 • IMSI • IP Address • Device Private Key • Device Public Key • Arc Server Endpoint • Arc Server Public Key
  12. デバイスのブートストラップ - Krypton 実SIMを介したブートストラップリクエスト Krypton Endpoint Arc Endpoint WireGuardセットアップ Virtual

    SIM情報 • IMSI • IP Address • Device Private Key • Device Public Key • Arc Server Endpoint • Arc Server Public Key
  13. デバイスのブートストラップ - Krypton 実SIMを介したブートストラップリクエスト Krypton Endpoint Arc Endpoint WireGuardセットアップ Virtual

    SIM情報 • IMSI • IP Address • Device Private Key • Device Public Key • Arc Server Endpoint • Arc Server Public Key WireGuardトンネル確立リクエスト トンネル確立
  14. デバイスのブートストラップ Pros Cons API • Virtual SIM単体で 利用可能 • デバイスからAPIを呼ぶ場合は

    デバイス上にAPIトークンを 保持する必要がある • 認証情報を端末で持つ必要が Krypton • 認証情報を端末で持つ必要が 無い (実 • 実SIMが必要となる
  15. SORACOM Gate D2D with Arc VPG (Type-E) Gate Device to

    Device 有効 Arcが有効なデバイス
  16. SORACOM Gate D2D with Arc VPG (Type-E) Gate Device to

    Device 有効 Arcが有効なデバイス ログイン
  17. SORACOM Gate D2D with Arc VPG (Type-E) Gate Device to

    Device 有効 Arcが有効なデバイス ログイン デバイス間通信
  18. SORACOM Gate D2D with Arc VPG (Type-E) Gate Device to

    Device 有効 Arcが有効なデバイス ログイン デバイス間通信 安価にVPN利用の プライベート網を 構築可能 リモートからの メンテナンスも 安全かつ容易に
  19. ルーティングについて Wire Guard デバイス Data: 100.127.0.0/16 or 10.0.0.0/8 インターネット イントラネット

    Data: NOT 100.127.0.0/16 and NOT 10.0.0.0/8 Allowed-IP === ["100.127.0.0/16", "10.0.0.0/8"]