|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * rosa_cli/rosa-cli-permission-examples.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: REFERENCE |
| 6 | +[id="rosa-cli-classic-examples_{context}"] |
| 7 | += Least privilege permissions for common ROSA Classic CLI commands |
| 8 | + |
| 9 | +The following examples show the least privilege permissions needed for the most common ROSA CLI commands when building ROSA Classic clusters. |
| 10 | + |
| 11 | +[id="rosa-min-permissions-required-classic_{context}"] |
| 12 | +== Create a cluster |
| 13 | + |
| 14 | +Run the following command with the specified permissions to create a ROSA Classic cluster with least privilege permissions. |
| 15 | + |
| 16 | +.Input |
| 17 | +[source,terminal] |
| 18 | +---- |
| 19 | +$ rosa create cluster |
| 20 | +---- |
| 21 | +.Policy |
| 22 | +[source,json] |
| 23 | +---- |
| 24 | +
|
| 25 | +{ |
| 26 | + "Version": "2012-10-17", |
| 27 | + "Statement": [ |
| 28 | + { |
| 29 | + "Sid": "CreateCluster", |
| 30 | + "Effect": "Allow", |
| 31 | + "Action": [ |
| 32 | + "iam:GetRole", |
| 33 | + "iam:ListRoleTags", |
| 34 | + "iam:ListRoles" |
| 35 | + ], |
| 36 | + "Resource": "*" |
| 37 | + } |
| 38 | + ] |
| 39 | +} |
| 40 | +
|
| 41 | +---- |
| 42 | + |
| 43 | +[id="rosa-create-account-operator-roles-classic_{context}"] |
| 44 | +== Create account roles and Operator roles |
| 45 | + |
| 46 | +Run the following command with the specified permissions to create account and Operator roles in `auto' mode. |
| 47 | + |
| 48 | +.Input |
| 49 | +[source,terminal] |
| 50 | +---- |
| 51 | +$ rosa create account-roles --mode auto --classic |
| 52 | +---- |
| 53 | +.Policy |
| 54 | +[source,json] |
| 55 | +---- |
| 56 | +
|
| 57 | +{ |
| 58 | + "Version": "2012-10-17", |
| 59 | + "Statement": [ |
| 60 | + { |
| 61 | + "Sid": "CreateAccountOperatorRoles", |
| 62 | + "Effect": "Allow", |
| 63 | + "Action": [ |
| 64 | + "iam:GetRole", |
| 65 | + "iam:UpdateAssumeRolePolicy", |
| 66 | + "iam:ListRoleTags", |
| 67 | + "iam:GetPolicy", |
| 68 | + "iam:TagRole", |
| 69 | + "iam:ListRoles", |
| 70 | + "iam:CreateRole", |
| 71 | + "iam:AttachRolePolicy", |
| 72 | + "iam:TagPolicy", |
| 73 | + "iam:CreatePolicy", |
| 74 | + "iam:ListPolicyTags" |
| 75 | + ], |
| 76 | + "Resource": "*" |
| 77 | + } |
| 78 | + ] |
| 79 | +} |
| 80 | +
|
| 81 | +---- |
| 82 | +[id="rosa-delete-account-roles-classic_{context}"] |
| 83 | +== Delete your account roles |
| 84 | + |
| 85 | +Run the following command with the specified permissions to delete the account roles in `auto` mode. |
| 86 | + |
| 87 | +.Input |
| 88 | +[source,terminal] |
| 89 | +---- |
| 90 | +$ rosa delete account-roles -–mode auto |
| 91 | +---- |
| 92 | +.Policy |
| 93 | +[source,json] |
| 94 | +---- |
| 95 | +{ |
| 96 | + "Version": "2012-10-17", |
| 97 | + "Statement": [ |
| 98 | + { |
| 99 | + "Sid": "VisualEditor0", |
| 100 | + "Effect": "Allow", |
| 101 | + "Action": [ |
| 102 | + "iam:GetRole", |
| 103 | + "iam:ListInstanceProfilesForRole", |
| 104 | + "iam:DetachRolePolicy", |
| 105 | + "iam:ListAttachedRolePolicies", |
| 106 | + "iam:ListRoles", |
| 107 | + "iam:DeleteRole", |
| 108 | + "iam:ListRolePolicies", |
| 109 | + "iam:GetPolicy", |
| 110 | + "iam:ListPolicyVersions", |
| 111 | + "iam:DeletePolicy" |
| 112 | + ], |
| 113 | + "Resource": "*" |
| 114 | + } |
| 115 | + ] |
| 116 | +} |
| 117 | +---- |
| 118 | + |
| 119 | +[id="rosa-delete-operator-roles-classic_{context}"] |
| 120 | +== Delete your Operator roles |
| 121 | + |
| 122 | +Run the following command with the specified permissions to delete the Operator roles in `auto` mode. |
| 123 | + |
| 124 | +.Input |
| 125 | +[source,terminal] |
| 126 | +---- |
| 127 | +$ rosa delete operator-roles -–mode auto |
| 128 | +---- |
| 129 | +.Policy |
| 130 | +[source,json] |
| 131 | +---- |
| 132 | +{ |
| 133 | + "Version": "2012-10-17", |
| 134 | + "Statement": [ |
| 135 | + { |
| 136 | + "Sid": "VisualEditor0", |
| 137 | + "Effect": "Allow", |
| 138 | + "Action": [ |
| 139 | + "iam:GetRole", |
| 140 | + "iam:ListInstanceProfilesForRole", |
| 141 | + "iam:DetachRolePolicy", |
| 142 | + "iam:ListAttachedRolePolicies", |
| 143 | + "iam:ListRoles", |
| 144 | + "iam:DeleteRole", |
| 145 | + "iam:ListRolePolicies", |
| 146 | + "iam:GetPolicy", |
| 147 | + "iam:ListPolicyVersions", |
| 148 | + "iam:DeletePolicy" |
| 149 | + ], |
| 150 | + "Resource": "*" |
| 151 | + } |
| 152 | + ] |
| 153 | +} |
| 154 | +
|
| 155 | +---- |
0 commit comments