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
SORACOMのスイッチユーザー機能を使ってみよう
Search
Ken'ichirou Kimura
August 23, 2023
Technology
0
250
SORACOMのスイッチユーザー機能を使ってみよう
2023/08/23に開催されたSORACOM UG Tokyo#16でのLT資料です
Ken'ichirou Kimura
August 23, 2023
Tweet
Share
More Decks by Ken'ichirou Kimura
See All by Ken'ichirou Kimura
マルチクラウド対応サービスでCloudflareを使った話
kenichirokimura
1
5
モック作りのお供にGitHub Coding Agent
kenichirokimura
1
90
モック作りのお供にGitHub Coding Agent
kenichirokimura
1
88
Serverlessだからこそコードと設計にはこだわろう
kenichirokimura
5
1.6k
LINE Notify互換のボットを作った話
kenichirokimura
0
250
自分がご機嫌になれる 素敵な場所を守るために
kenichirokimura
3
390
AWSで動くプログラムをC#で書こう ~主にLambdaのお話~
kenichirokimura
1
210
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
380
Alternative GitHub Secret Manager
kenichirokimura
0
120
Other Decks in Technology
See All in Technology
20250910_障害注入から効率的復旧へ_カオスエンジニアリング_生成AIで考えるAWS障害対応.pdf
sh_fk2
3
240
BPaaSにおける人と協働する前提のAIエージェント-AWS登壇資料
kentarofujii
0
140
ブロックテーマ時代における、テーマの CSS について考える Toro_Unit / 2025.09.13 @ Shinshu WordPress Meetup
torounit
0
120
Snowflake Intelligenceにはこうやって立ち向かう!クラシルが考えるAI Readyなデータ基盤と活用のためのDataOps
gappy50
0
180
共有と分離 - Compose Multiplatform "本番導入" の設計指針
error96num
2
400
今!ソフトウェアエンジニアがハードウェアに手を出すには
mackee
12
4.7k
機械学習を扱うプラットフォーム開発と運用事例
lycorptech_jp
PRO
0
230
Firestore → Spanner 移行 を成功させた段階的移行プロセス
athug
1
470
2025年夏 コーディングエージェントを統べる者
nwiizo
0
140
Rustから学ぶ 非同期処理の仕組み
skanehira
1
130
5分でカオスエンジニアリングを分かった気になろう
pandayumi
0
240
なぜテストマネージャの視点が 必要なのか? 〜 一歩先へ進むために 〜
moritamasami
0
220
Featured
See All Featured
The Language of Interfaces
destraynor
161
25k
It's Worth the Effort
3n
187
28k
GitHub's CSS Performance
jonrohan
1032
460k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
13k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Embracing the Ebb and Flow
colly
87
4.8k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.6k
Become a Pro
speakerdeck
PRO
29
5.5k
Transcript
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. SORACOMのスイッチユーザー機能を 使ってみよう
木村健一郎 2023年8月22日 SORACOM UG Tokyo #16
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. 名前:木村健一郎 所属:株式会社オルターブース
SORACOM UG九州 JAWS-UG福岡 娘ちゃんのパパ(6歳1ヶ月) お仕事:IoT番⾧ 受賞歴:AWS Samurai 2019 SORACOM MVC 2021 好きなSORACOMサービス :Arc、Beam、Funk、あのボタン
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. スイッチユーザーって知ってますか?
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. スイッチユーザー機能とは •
2023年7月6日、SORACOM Discovery2023で発表された新機 能 • ログインし直すことなく、別のSAMユーザーの権限で操作がで きる • 例:普段は読み込み権限のみのSAMユーザーで作業しておき、必要な ときだけ書き込み権限を持ったSAMユーザーで作業したい • ルートユーザーにはスイッチできない • スイッチ元のユーザーはルートユーザーでもSAMユーザーでもOK
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved.
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. スイッチ先のユーザーのオペレーターIDとSAMユーザー名を登録する
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. スイッチしたSAMユーザーの権限でコンソールが操作できるようになる
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. スイッチできる条件は2つ スイッチ先のSAMユーザーの「信頼ポリシー」に、スイッチ元
のユーザーを追加する
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. スイッチ元のユーザーに“Auth:switchUser”と “Operator:generateAuthToken”の2つの権限を付与する
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. 何が嬉しいのか? •WEBコンソールでログインしなおさないで別の権限が扱える
•権限が強いユーザーと弱いユーザーの使い分けが容易にな る •スイッチ先のSAMユーザーの認証情報を共有しないでよい •引き継ぎや外部委託が容易
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. CLIでもやってみた
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. まずはauth/switch-userコマンドでやってみる $
soracom --profile switchb auth switch-user --operator-id OPxxxxxxxxxx --user-name switch-a { "apiKey": "api-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "operatorId": "OPxxxxxxxxxx", "token": "eyXXX...", "userName": "switch-a" }
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. 取得したAPIKEYとTOKENでコマンドを実行する $
soracom sims list --api-key "api-xxxxxxxx-xxxx-xxxx-xxxx- xxxxxxxxxxx" --api-token "eyXX...“ [ { "activeProfileId": "xxxxxxxxxxxxxxxxxx", "arcSessionStatus": { "arcAllowedIPs": [ ... ]
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. 番⾧~、いちいち⾧い TOKENコピペするの
めんどいよ~
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. プロファイルセットアップ~ (大山のぶ代)
$ soracom configure
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. Configureコマンドでスイッチユーザーのプロファイ ルを設定する
$ soracom --profile switch-a configure --- SORACOM CLI セットアップ --- /home/xxxxx/.soracom ディレクトリがなければ作成し、そこ にファイル 'switch-a.json' を作成します。 カバレッジタイプを選択してください。 1. Global 2. Japan
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. 認証方法を選択してください。 1.
AuthKeyId と AuthKey を入力する(推奨) 2. オペレーターのメールアドレスとパスワードを入力する 3. SAM ユーザーの認証情報を入力する(オペレーターID、 ユーザー名、パスワード) 4. スイッチユーザー 選択してください (1-4) > 4
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. Switch destination
operator ID (OP00...): OPxxxxxxxxxx Switch destination user name: switch-a Source profile (switch origin) 1: default 2: switch-b [1-2]: 2
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. 作成したプロファイルで動かしてみる $
soracom –profile switch-a sims list [ { "activeProfileId": "xxxxxxxxxxxxxxxxxx", "arcSessionStatus": { "arcAllowedIPs": [ ... ]
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. 作成したプロファイルの中身はこんな感じ $
cat ~/.soracom/switchb.json | jq { "sandbox":false, "coverageType":"jp", "username":"switch-a", "operatorId":"OPxxxxxxxxxx", "registerPaymentMethod":false, "sourceProfile":"switch-b“ }
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved. まとめ ・スイッチユーザー超便利です
・スイッチ先の認証情報を作る必要すら無いのでセキュリティを 向上させられます ・WEBコンソールでもCLIでも使えます ・CLIはv1.0.0移行で対応してます ・CLIではプロファイルに設定して使いましょう ・詳しくはブログに書いてますので参考にしてください https://zenn.dev/showm001/articles/2023-08-08-01
Copyright © 2015-2023 ALTERBOOTH inc. All Rights Reserved.