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
230
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
LINE Notify互換のボットを作った話
kenichirokimura
0
200
自分がご機嫌になれる 素敵な場所を守るために
kenichirokimura
2
88
AWSで動くプログラムをC#で書こう ~主にLambdaのお話~
kenichirokimura
1
78
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
300
Alternative GitHub Secret Manager
kenichirokimura
0
85
SORACOMで実現するIoTのマルチクラウド対応 - IoTでのクリーンアーキテクチャの実現 -
kenichirokimura
0
610
How to use Amazon Cognito user pools with custom UI and also OIDC
kenichirokimura
0
420
あなたも今日からIoTと握手! SORACOM/SORACOM UGの紹介
kenichirokimura
1
140
推し活の1つとしての株購入~みんなでソラコムの株主になろう~
kenichirokimura
0
250
Other Decks in Technology
See All in Technology
勝手に!深堀り!Cloud Run worker pools / Deep dive Cloud Run worker pools
iselegant
4
620
Oracle Cloud Infrastructure:2025年4月度サービス・アップデート
oracle4engineer
PRO
0
300
Compose におけるパスワード自動入力とパスワード保存
tonionagauzzi
0
180
Асинхронная коммуникация в Go: от понятного к душному. Дима Некрасов, Otello, 2ГИС
lamodatech
0
1.5k
10ヶ月かけてstyled-components v4からv5にアップデートした話
uhyo
5
450
Cross Data Platforms Meetup LT 20250422
tarotaro0129
1
910
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
7
63k
QA/SDETの現在と、これからの挑戦
imtnd
0
210
Simplify! 10 ways to reduce complexity in software development
ufried
1
180
GraphQLを活用したリアーキテクチャに対応するSLI/Oの再設計
coconala_engineer
0
190
意思決定を支える検索体験を目指してやってきたこと
hinatades
PRO
0
380
Winning at PHP in Production in 2025
beberlei
1
270
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.4k
Typedesign – Prime Four
hannesfritz
41
2.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
550
Mobile First: as difficult as doing things right
swwweet
223
9.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Fontdeck: Realign not Redesign
paulrobertlloyd
84
5.5k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
820
A Tale of Four Properties
chriscoyier
158
23k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
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.