Skip to content

Commit eafc6ee

Browse files
committed
OSDOCS#5384: Document the explicit list of required credential permissions for Azure
1 parent de8f332 commit eafc6ee

8 files changed

+633
-6
lines changed

installing/installing_azure/installing-azure-account.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ include::modules/installation-azure-increasing-limits.adoc[leveloffset=+1]
2626

2727
include::modules/installation-azure-permissions.adoc[leveloffset=+1]
2828

29+
include::modules/minimum-required-permissions-ipi-azure.adoc[leveloffset=+1]
30+
2931
include::modules/installation-azure-service-principal.adoc[leveloffset=+1]
3032

3133
[role="_additional-resources"]
@@ -42,5 +44,4 @@ include::modules/installation-azure-regions.adoc[leveloffset=+1]
4244
* Install an {product-title} cluster on Azure. You can
4345
xref:../../installing/installing_azure/installing-azure-customizations.adoc#installing-azure-customizations[install a customized cluster]
4446
or
45-
xref:../../installing/installing_azure/installing-azure-default.adoc#installing-azure-default[quickly install a cluster]
46-
with default options.
47+
xref:../../installing/installing_azure/installing-azure-default.adoc#installing-azure-default[quickly install a cluster] with default options.

installing/installing_azure/installing-azure-user-infra.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ include::modules/installation-azure-increasing-limits.adoc[leveloffset=+2]
5151
include::modules/csr-management.adoc[leveloffset=+2]
5252

5353
include::modules/installation-azure-permissions.adoc[leveloffset=+2]
54+
include::modules/minimum-required-permissions-upi-azure.adoc[leveloffset=+2]
5455
include::modules/installation-azure-service-principal.adoc[leveloffset=+2]
5556

5657
[role="_additional-resources"]

modules/installation-azure-create-resource-group-and-identity.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ $ export RESOURCE_GROUP_ID=`az group show -g ${RESOURCE_GROUP} --query id --out
7373
----
7474
$ az role assignment create --assignee "${PRINCIPAL_ID}" --role 'Contributor' --scope "${RESOURCE_GROUP_ID}"
7575
----
76+
+
77+
[NOTE]
78+
====
79+
If you want to assign a custom role with all the required permissions to the identity, run the following command:
80+
[source,terminal]
81+
----
82+
$ az role assignment create --assignee "${PRINCIPAL_ID}" --role <custom_role> \ <1>
83+
--scope "${RESOURCE_GROUP_ID}"
84+
----
85+
<1> Specifies the custom role name.
86+
====
7687
endif::azure[]
7788

7889
ifeval::["{context}" == "installing-azure-user-infra"]

modules/installation-azure-finalizing-encryption.adoc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,30 @@
66
// * installing/installing_azure/installing-azure-private.adoc
77
// * installing/installing_azure/installing-azure-vnet.adoc
88

9+
10+
ifeval::["{context}" == "installing-azure-customizations"]
11+
:azure-public:
12+
endif::[]
13+
ifeval::["{context}" == "installing-azure-government-region"]
14+
:azure-gov:
15+
endif::[]
16+
ifeval::["{context}" == "installing-azure-network-customizations"]
17+
:azure-public:
18+
endif::[]
19+
ifeval::["{context}" == "installing-azure-private"]
20+
:azure-public:
21+
endif::[]
22+
ifeval::["{context}" == "installing-azure-vnet"]
23+
:azure-public:
24+
endif::[]
25+
926
:_content-type: PROCEDURE
1027
[id="finalizing-encryption_{context}"]
1128
= Finalizing user-managed encryption after installation
1229
If you installed {product-title} using a user-managed encryption key, you can complete the installation by creating a new storage class and granting write permissions to the Azure cluster resource group.
1330

1431
.Procedure
32+
1533
. Obtain the identity of the cluster resource group used by the installer:
1634
.. If you specified an existing resource group in `install-config.yaml`, obtain its Azure identity by running the following command:
1735
+
@@ -63,6 +81,7 @@ $ az identity show -g <cluster_resource_group> \// <1>
6381
<1> Specifies the name of the cluster resource group created by the installation program.
6482
<2> Specifies the name of the cluster service principal created by the installation program.
6583
The identity is in the format of `12345678-1234-1234-1234-1234567890`.
84+
ifdef::azure-gov[]
6685
. Create a role assignment that grants the cluster service principal `Contributor` privileges to the disk encryption set by running the following command:
6786
+
6887
[source,terminal]
@@ -73,6 +92,20 @@ $ az role assignment create --assignee <cluster_service_principal_id> \// <1>
7392
----
7493
<1> Specifies the ID of the cluster service principal obtained in the previous step.
7594
<2> Specifies the ID of the disk encryption set.
95+
endif::azure-gov[]
96+
ifdef::azure-public[]
97+
. Create a role assignment that grants the cluster service principal necessary privileges to the disk encryption set by running the following command:
98+
+
99+
[source,terminal]
100+
----
101+
$ az role assignment create --assignee <cluster_service_principal_id> \// <1>
102+
--role <privileged_role> \// <2>
103+
--scope <disk_encryption_set_id> \// <3>
104+
----
105+
<1> Specifies the ID of the cluster service principal obtained in the previous step.
106+
<2> Specifies the Azure role name. You can use the `Contributor` role or a custom role with the necessary permissions.
107+
<3> Specifies the ID of the disk encryption set.
108+
endif::azure-public[]
76109
+
77110
. Create a storage class that uses the user-managed disk encryption set:
78111
.. Save the following storage class definition to a file, for example `storage-class-definition.yaml`:
@@ -102,3 +135,21 @@ volumeBindingMode: WaitForFirstConsumer
102135
$ oc create -f storage-class-definition.yaml
103136
----
104137
. Select the `managed-premium` storage class when you create persistent volumes to use encrypted storage.
138+
139+
140+
141+
ifeval::["{context}" == "installing-azure-customizations"]
142+
:!azure-public:
143+
endif::[]
144+
ifeval::["{context}" == "installing-azure-government-region"]
145+
:!azure-gov:
146+
endif::[]
147+
ifeval::["{context}" == "installing-azure-network-customizations"]
148+
:!azure-public:
149+
endif::[]
150+
ifeval::["{context}" == "installing-azure-private"]
151+
:!azure-public:
152+
endif::[]
153+
ifeval::["{context}" == "installing-azure-vnet"]
154+
:!azure-public:
155+
endif::[]

modules/installation-azure-permissions.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@
1111
* `User Access Administrator`
1212
* `Owner`
1313

14-
To set roles on the Azure portal, see the
15-
link:https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal[Manage access to Azure resources using RBAC and the Azure portal]
16-
in the Azure documentation.
14+
To set roles on the Azure portal, see the link:https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal[Manage access to Azure resources using RBAC and the Azure portal] in the Azure documentation.

modules/installation-azure-service-principal.adoc

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ endif::[]
1111
ifeval::["{context}" == "installing-azure-stack-hub-account"]
1212
:ash:
1313
endif::[]
14+
ifeval::["{context}" == "installing-azure-account"]
15+
:ipi:
16+
endif::[]
17+
ifeval::["{context}" == "installing-azure-user-infra"]
18+
:upi:
19+
endif::[]
1420

1521
:_content-type: PROCEDURE
1622
[id="installation-azure-service-principal_{context}"]
@@ -22,6 +28,12 @@ Because {product-title} and its installation program create Microsoft Azure reso
2228

2329
* Install or update the link:https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-yum?view=azure-cli-latest[Azure CLI].
2430
* Your Azure account has the required roles for the subscription that you use.
31+
ifdef::ipi[]
32+
* If you want to use a custom role, you have created a link:https://learn.microsoft.com/en-us/azure/role-based-access-control/custom-roles[custom role] with the required permissions listed in the _Required Azure permissions for installer-provisioned infrastructure_ section.
33+
endif::ipi[]
34+
ifdef::upi[]
35+
* If you want to use a custom role, you have created a link:https://learn.microsoft.com/en-us/azure/role-based-access-control/custom-roles[custom role] with the required permissions listed in the _Required Azure permissions for user-provisioned infrastructure_ section.
36+
endif::upi[]
2537
2638
.Procedure
2739

@@ -167,6 +179,7 @@ endif::[]
167179

168180
. Record the `tenantId` and `id` parameter values from the output. You need these values during the {product-title} installation.
169181

182+
ifdef::ash[]
170183
. Create the service principal for your account:
171184
+
172185
[source,terminal]
@@ -181,6 +194,35 @@ $ az ad sp create-for-rbac --role Contributor --name <service_principal> \ <1>
181194
[source,terminal]
182195
----
183196
Creating 'Contributor' role assignment under scope '/subscriptions/<subscription_id>'
197+
The output includes credentials that you must protect. Be sure that you do not
198+
include these credentials in your code or check the credentials into your source
199+
control. For more information, see https://aka.ms/azadsp-cli
200+
{
201+
"appId": "ac461d78-bf4b-4387-ad16-7e32e328aec6",
202+
"displayName": <service_principal>",
203+
"password": "00000000-0000-0000-0000-000000000000",
204+
"tenantId": "8049c7e9-c3de-762d-a54e-dc3f6be6a7ee"
205+
}
206+
----
207+
endif::ash[]
208+
209+
ifndef::ash[]
210+
. Create the service principal for your account:
211+
+
212+
[source,terminal]
213+
----
214+
$ az ad sp create-for-rbac --role <role_name> \// <1>
215+
--name <service_principal> \// <2>
216+
--scopes /subscriptions/<subscription_id> <3>
217+
----
218+
<1> Defines the role name. You can use the `Contributor` role, or you can specify a custom role which contains the necessary permissions.
219+
<2> Defines the service principal name.
220+
<3> Specifies the subscription ID.
221+
+
222+
.Example output
223+
[source,terminal]
224+
----
225+
Creating 'Contributor' role assignment under scope '/subscriptions/<subscription_id>'
184226
The output includes credentials that you must protect. Be sure that you do not
185227
include these credentials in your code or check the credentials into your source
186228
control. For more information, see https://aka.ms/azadsp-cli
@@ -191,12 +233,13 @@ control. For more information, see https://aka.ms/azadsp-cli
191233
"tenantId": "8049c7e9-c3de-762d-a54e-dc3f6be6a7ee"
192234
}
193235
----
236+
endif::ash[]
194237

195238
. Record the values of the `appId` and `password` parameters from the previous
196239
output. You need these values during {product-title} installation.
197240

198241
ifndef::ash[]
199-
. Assign the `User Access Administrator` role by running the following command:
242+
. If you applied the `Contributor` role to your service principal, assign the `User Administrator Access` role by running the following command:
200243
+
201244
[source,terminal]
202245
----
@@ -212,3 +255,9 @@ endif::[]
212255
ifeval::["{context}" == "installing-azure-stack-hub-account"]
213256
:!ash:
214257
endif::[]
258+
ifeval::["{context}" == "installing-azure-account"]
259+
:!ipi:
260+
endif::[]
261+
ifeval::["{context}" == "installing-azure-user-infra"]
262+
:!upi:
263+
endif::[]

0 commit comments

Comments
 (0)