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
モック作りのお供にGitHub Coding Agent
kenichirokimura
1
80
モック作りのお供にGitHub Coding Agent
kenichirokimura
1
85
Serverlessだからこそコードと設計にはこだわろう
kenichirokimura
5
1.5k
LINE Notify互換のボットを作った話
kenichirokimura
0
240
自分がご機嫌になれる 素敵な場所を守るために
kenichirokimura
2
130
AWSで動くプログラムをC#で書こう ~主にLambdaのお話~
kenichirokimura
1
190
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
350
Alternative GitHub Secret Manager
kenichirokimura
0
120
SORACOMで実現するIoTのマルチクラウド対応 - IoTでのクリーンアーキテクチャの実現 -
kenichirokimura
0
690
Other Decks in Technology
See All in Technology
【新卒研修資料】数理最適化 / Mathematical Optimization
brainpadpr
27
13k
「Roblox」の開発環境とその効率化 ~DAU9700万人超の巨大プラットフォームの開発 事始め~
keitatanji
0
120
はじめての転職講座/The Guide of First Career Change
kwappa
0
190
Amazon GuardDuty での脅威検出:脅威検出の実例から学ぶ
kintotechdev
0
110
마라톤 끝의 단거리 스퍼트: 2025년의 AI
inureyes
PRO
1
740
リリース2ヶ月で収益化した話
kent_code3
1
260
Google Agentspaceを実際に導入した効果と今後の展望
mixi_engineers
PRO
3
700
Amazon Qで2Dゲームを作成してみた
siromi
0
140
AIに頼りすぎない新人育成術
cuebic9bic
3
300
オブザーバビリティプラットフォーム開発におけるオブザーバビリティとの向き合い / Hatena Engineer Seminar #34 オブザーバビリティの実現と運用編
arthur1
0
380
Serverless Meetup #21
yoshidashingo
1
120
Backlog AI アシスタントが切り開く未来
vvatanabe
1
130
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
A designer walks into a library…
pauljervisheath
207
24k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Gamification - CAS2011
davidbonilla
81
5.4k
The Pragmatic Product Professional
lauravandoore
36
6.8k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
How STYLIGHT went responsive
nonsquared
100
5.7k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Mobile First: as difficult as doing things right
swwweet
223
9.9k
Facilitating Awesome Meetings
lara
54
6.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.