IAM path requirements for cluster entities
Cloudera Cloud Factory creates the IAM roles, instance profiles, and managed policy for each cluster under a dedicated IAM path, so that you can scope the provisioning policy to those entities only.
Cluster IAM entities
When Cloudera Cloud Factory provisions a cluster on AWS, it creates the following IAM entities under the /cloudera/ccf/clusters/[***CLUSTER NAME***]/ path, where [***CLUSTER NAME***] is the name of the cluster:
| IAM entity | Generated name prefix |
|---|---|
| Control plane role | k8s-cp-[***CLUSTER NAME***]- |
| Control plane instance profile | k8s-cp-profile-[***CLUSTER NAME***]- |
| Worker node role | k8s-node-[***CLUSTER NAME***]- |
| Worker node instance profile | k8s-node-profile-[***CLUSTER NAME***]- |
| Amazon EBS CSI driver managed policy | k8s-ebs-csi-[***CLUSTER NAME***]- |
- Cloudera Cloud Factory appends a unique suffix to each prefix. The cluster name in the prefix is truncated to 28 characters so that the generated name stays within the IAM 64-character name limit.
- The inline role policies are named
kubernetes-control-planeandkubernetes-node. Inline policies do not have an IAM path because they are scoped to the role that contains them.
Scoping the IAM permissions to the Cloudera Cloud Factory path
Because Cloudera Cloud Factory creates every cluster IAM entity under the /cloudera/ccf/ path, you can restrict the iam: actions in the IAM policy to that path instead of granting them on all resources. To do this, move the iam: actions into a separate statement that uses the following Resource list:
{
"Effect": "Allow",
"Action": [
"iam:CreateRole",
"iam:DeleteRole",
"iam:GetRole",
"iam:TagRole",
"iam:UpdateAssumeRolePolicy",
"iam:PutRolePolicy",
"iam:GetRolePolicy",
"iam:DeleteRolePolicy",
"iam:ListRolePolicies",
"iam:AttachRolePolicy",
"iam:DetachRolePolicy",
"iam:ListAttachedRolePolicies",
"iam:ListInstanceProfilesForRole",
"iam:PassRole",
"iam:CreateInstanceProfile",
"iam:DeleteInstanceProfile",
"iam:GetInstanceProfile",
"iam:TagInstanceProfile",
"iam:AddRoleToInstanceProfile",
"iam:RemoveRoleFromInstanceProfile",
"iam:CreatePolicy",
"iam:DeletePolicy",
"iam:GetPolicy",
"iam:GetPolicyVersion",
"iam:CreatePolicyVersion",
"iam:ListPolicyVersions",
"iam:TagPolicy",
"iam:ListEntitiesForPolicy"
],
"Resource": [
"arn:aws:iam::*:role/cloudera/ccf/*",
"arn:aws:iam::*:instance-profile/cloudera/ccf/*",
"arn:aws:iam::*:policy/cloudera/ccf/*"
]
}
The following actions must remain on "Resource": "*", because they do not act on entities under the cluster path:
iam:ListPolicies: IAM does not support resource-level permissions for this action, and Cloudera Cloud Factory uses it to look up theCCFPermissionsBoundarypolicy.iam:CreateServiceLinkedRole: Cloudera Cloud Factory does not create service-linked roles under its own path.iam:CreateUser,iam:TagUser,iam:GetUser,iam:DeleteUser,iam:ListGroupsForUser,iam:AttachUserPolicy,iam:ListAttachedUserPolicies, andiam:ListAttachedGroupPolicies: These actions apply to IAM users and groups, which are outside the cluster path.
If you scoped an IAM policy, a permissions boundary, or a trust policy to the earlier entity names, for example [***CLUSTER NAME***]-kubernetes-control_plane, update those references to the path-based ARN, because the ARN of each entity changes.
