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
210
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
AWSで動くプログラムをC#で書こう ~主にLambdaのお話~
kenichirokimura
1
44
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
240
Alternative GitHub Secret Manager
kenichirokimura
0
77
SORACOMで実現するIoTのマルチクラウド対応 - IoTでのクリーンアーキテクチャの実現 -
kenichirokimura
0
550
How to use Amazon Cognito user pools with custom UI and also OIDC
kenichirokimura
0
310
あなたも今日からIoTと握手! SORACOM/SORACOM UGの紹介
kenichirokimura
1
120
推し活の1つとしての株購入~みんなでソラコムの株主になろう~
kenichirokimura
0
230
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
1.4k
SORACOM UGとは? - 2023/11/04 JAWS-UG 佐賀 x SORACOM UG 九州 バルーンフェスタSP版
kenichirokimura
0
160
Other Decks in Technology
See All in Technology
目の前の仕事と向き合うことで成長できる - 仕事とスキルを広げる / Every little bit counts
soudai
22
5.8k
マルチモーダル理解と生成の統合 DeepSeek Janus, etc... / Multimodal Understanding and Generation Integration
hiroga
0
360
技術的負債解消の取り組みと専門チームのお話 #技術的負債_Findy
bengo4com
1
1.2k
ハッキングの世界に迫る~攻撃者の思考で考えるセキュリティ~
nomizone
12
4.5k
株式会社EventHub・エンジニア採用資料
eventhub
0
4.2k
Bounded Context: Problem or Solution?
ewolff
1
210
君も受託系GISエンジニアにならないか
sudataka
1
370
『AWS Distinguished Engineerに学ぶ リトライの技術』 #ARC403/Marc Brooker on Try again: The tools and techniques behind resilient systems
quiver
0
130
プロセス改善による品質向上事例
tomasagi
1
1.6k
室長と気ままに学ぶマイクロソフトのビジネスアプリケーションとビジネスプロセス
ryoheig0405
0
320
滅・サービスクラス🔥 / Destruction Service Class
sinsoku
6
1.5k
転生CISOサバイバル・ガイド / CISO Career Transition Survival Guide
kanny
2
390
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
A better future with KSS
kneath
238
17k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Documentation Writing (for coders)
carmenintech
67
4.6k
How GitHub (no longer) Works
holman
313
140k
A Philosophy of Restraint
colly
203
16k
Raft: Consensus for Rubyists
vanstee
137
6.8k
Code Reviewing Like a Champion
maltzj
521
39k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
8
270
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
540
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.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.