Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
情シスの味方、Azure のカスタムロール
Search
Tetsuya Odashima
September 22, 2018
Technology
51
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
情シスの味方、Azure のカスタムロール
Japan Azure User Group 8 周年 LT - 2018/09/22
Tetsuya Odashima
September 22, 2018
More Decks by Tetsuya Odashima
See All by Tetsuya Odashima
Azure Cost Management の FOCUS コストデータを迷わず読むための“3つの軸”
tetsuyaooooo
0
160
お仕事図鑑pitchトーク
tetsuyaooooo
0
2.4k
軽いノリで"自動化"に取り組んではいけないという話
tetsuyaooooo
1
1.4k
どうするコスト最適化のトレードオフ
tetsuyaooooo
1
1.6k
自動化で、マネージド ID と Connect-AzAccount と azcopy login を使用する際に気をつけること
tetsuyaooooo
0
740
キャリア教育ミニ講演会 - システムエンジニア編
tetsuyaooooo
0
2.2k
私のMCP試験の挑み方
tetsuyaooooo
0
93
ETロボコン2020 競技会場システムのおはなし
tetsuyaooooo
0
45
Microsoft MVP を受賞するために取り組んだこと
tetsuyaooooo
0
110
Other Decks in Technology
See All in Technology
V8コントリビュート超入門
riyaamemiya
0
160
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
180
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
830
Adaptive Warehouse を今すぐ導入すべき理由と迷ったときの判断基準
__allllllllez__
0
150
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
3
870
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
120
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
4
940
2026/09/10 Spring_Bootから_Jakarta_EE_MicroProfileへの移行
megascus
0
290
振り返りこそエンジニアの本領
negima
0
360
「図書館」という名前のままでいいのか -Code4Lib JAPANカンファレンス2026 アンカンファレンス報告- / Code4Lib JAPAN Conference 2026: Unconference Report
ykiyota
0
140
AIで仕事のやり方を変える
matsu7874
3
1k
module Synths; end
asonas
1
130
Featured
See All Featured
Design in an AI World
tapps
1
310
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
590
Raft: Consensus for Rubyists
vanstee
141
7.7k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
Making Projects Easy
brettharned
120
6.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Balancing Empowerment & Direction
lara
6
1.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
340
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
730
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Transcript
情シスの味方、 Azure のカスタムロール Japan Azure User Group 8 周年 LT
2018/09/22 パーソル プロセス&テクノロジー株式会社 Microsoft MVP for Microsoft Azure 小田島 哲也
自己紹介 • 小田島 哲也 (おだしま てつや) • パーソルプロセス&テクノロジー – Azure
導入コンサル、技術支援、最近は開発も – Office 365 もやるよ – そもそも .NET (主に C#) デベロッパー • Microsoft MVP for Microsoft Azure (2018~) • Qiita:https://qiita.com/tetsuya-ooooo • ET ソフトウェア デザイン ロボット コンテスト 実行委員会 (2011~) http://www.etrobo.jp/ – 本部技術委員 兼 東京地区技術委員長 (組み込めないけど) • 地区:競技全般の統括 • 本部:IT インフラ (Azure Platform を積極的に採用) の開発・運用保守 – むかしむかし「あずまひろしはじめました」というチームで参加していた (2007~2008) 2
お世話になってます、Azure サポート様のブログ ユーザーへ Azure VM の起動および停止のみを許可する方法 - Japan Azure IaaS
Support Blog https://blogs.technet.microsoft.com/jpaztech/2018/08/15/vm_start_stop_user/ 3
記事で書かれていること 4 アクセスできるリソース を限定 リソースへの操作を限定 ロールベースのアクセス 制御 (RBAC) この仮想マシンの 起動と停止の操作のみ
仮想マシンの起動と停止の操作のみ許可 • 以下の操作が Action プロパティに含むロールを割り当てる – Microsoft.Compute/virtualMachines/read 仮想マシンのプロパティの読み取り – Microsoft.Compute/virtualMachines/deallocate/action
仮想マシンの割り当て解除の操作 – Microsoft.Compute/virtualMachines/start/action 仮想マシンの開始の操作 • これらのプロパティが含む組み込みロールは – 所有者 (Owner) – 共同作成者 (Contributor) – 仮想マシン共同作成者 (Virtual Machine Contributor) – DevTest Labs ユーザー (DevTest Labs User) • ユーザーに組み込みロールを割り当てるなら 限定的な「DevTest Labs ユーザー」が最適♡ – しかし、他の操作 (LB や NIC にして等) もできてしまう • 許可する操作のみを明示的に限定したいなら、 「カスタムロール」を作成 → ユーザーにそれを割り当てる 5
私がやりたかったこと 6 カスタムロール定義 を作成 サブスクリプション に登録 あるリソースのアク セス制御 (IAM) にて
ユーザーにカスタム ロールを割り当てて 登録 この仮想マシンの 起動と停止と接続の操作のみ ※ARM VM だけでなく、 Classic VM も制御
1.カスタムロール定義 (json) を作成 { “Name”: “カスタムロールの名前", "IsCustom": true, “Description”: “カスタムロールの説明",
"Actions": [ このロールで実行できる操作を指定 ], "NotActions": [ 実行できる操作の中 (Actions) から除外する操作を指定 ], "DataActions": [ 対象のオブジェクト内のデータに対して、このロールで実行できるデータ操作を指定 ※プレビュー ], "NotDataActions": [ 実行できるデータ操作の中 (DataActions) から除外するデータ操作を指定 ※プレビュー ], "AssignableScopes": [ このロールを割り当て可能なスコープ (サブスクリプション, リソースグループ, リソース) を指定 ] } 7
リソースに対する操作を探し出す Azure Resource Manager のリソース プロバイダー操作 https://docs.microsoft.com/ja-jp/azure/role-based-access-control/resource-provider-operations 巨大なページなので、 ページ内検索を駆使して やりたいことを探し出す
ピンとこない説明に苦戦、 負けそう...(@_@) 8
(例) Azure VM の起動/停止/接続のみを許可したロール { "Name": "Azure VM Start/Stop/Connect", "IsCustom":
true, "Description": "Azure 仮想マシンの起動、停止、接続のみを許可するロール", "Actions": [ "Microsoft.Compute/virtualMachines/read" ,"Microsoft.Compute/virtualMachines/deallocate/action" ,"Microsoft.Compute/virtualMachines/restart/action" ,"Microsoft.Compute/virtualMachines/start/action" ,"Microsoft.Network/networkInterfaces/*/read" ,"Microsoft.Network/networkInterfaces/read" ,"Microsoft.Resources/subscriptions/resourceGroups/read" ,"Microsoft.Resources/subscriptions/resourceGroups/resources/read" ,"Microsoft.ClassicCompute/virtualMachines/read" ,"Microsoft.ClassicCompute/VirtualMachines/start/action" ,"Microsoft.ClassicCompute/virtualMachines/shutdown/action" ,"Microsoft.ClassicCompute/virtualMachines/restart/action" ,"Microsoft.ClassicCompute/virtualMachines/downloadRemoteDesktopConnectionFile/action" ,"Microsoft.ClassicCompute/virtualMachines/operationStatuses/read" ], "AssignableScopes": [ “/subscriptions/<サブスクリプション ID>" ] } 9 ARM VM のプロパティの読み取り ARM VM の開始/再起動/割り当て解除 NIC のプロパティの読み取り RG や RG 内のリソースの読み取り Classic VM のプロパティの読み取り Classic VM の開始/再起動/割り当て解除 Classic VM の RDP ファイルのダウンロード Classic VMの操作状態の読み込み ※あくまで一例です
2.サブスクリプションに登録 PowerShell で行う # ログイン PS C:¥> Login-AzureRmAccount # サブスクリプションを選択
PS C:¥> Select-AzureRmSubscription -Subscription <サブスクリプション ID> # カスタムロールを登録 PS C:¥> New-AzureRmRoleDefinition -InputFile <カスタムロール定義ファイルパス> 10
3~4.リソースの IAM でユーザーにロールを割り当てる 11
ここで学んだこと カスタムロールを書き換えたい!! • このようにやってはダメ – カスタムロールを Remove → New –
ユーザーにロールを再割り当て • こんなふうにやろう – Get-AzureRmRoleDefinition →プロパティを編集 →Set-AzureRmRoleDefinition – Actions や NotActions などの データ型は List<string> – New-Object でオブジェクトを 作って、中身入れて、 該当プロパティに上書き 12 反映がとても遅い!! ※経験談
まとめ • Azure 使いたいという社内からの要望はいっぱいある • だけど、自由に使わせるわけにはいかない • 「カスタムロール」と「Azure ポリシー」は、情シスには強力な武器 •
ちょっと面倒くさいけど、カスタムロールの取り扱いは 思ってたよりカンタンだった 13
参考文献 • ユーザーへ Azure VM の起動および停止のみを許可する方法 - Japan Azure IaaS
Support Blog https://blogs.technet.microsoft.com/jpaztech/2018/08/15/vm_start_stop_user/ • ロールベースのアクセス制御 (RBAC) の設定 – カスタムロールの使用 - Japan Azure IaaS Support Blog https://blogs.technet.microsoft.com/jpaztech/2016/10/12/rbac-custom-role/ • Azure の組み込みロール https://docs.microsoft.com/ja-jp/azure/role-based-access-control/built-in-roles • Azure のカスタム ロール https://docs.microsoft.com/ja-jp/azure/role-based-access-control/custom-roles • ロール定義について https://docs.microsoft.com/ja-jp/azure/role-based-access-control/role-definitions • Azure Resource Manager のリソース プロバイダー操作 https://docs.microsoft.com/ja-jp/azure/role-based-access-control/resource-provider-operations 14