Skip to content

Commit 0c170bb

Browse files
authored
Merge pull request #67001 from jneczypor/OSDOCS-8401
OSDOCS-8401: Migrate "ROSA with STS Explained"
2 parents 5a9de00 + ff2f942 commit 0c170bb

7 files changed

+154
-0
lines changed

_topic_maps/_topic_map_rosa.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ Topics:
126126
Topics:
127127
- Name: What is ROSA
128128
File: cloud-experts-getting-started-what-is-rosa
129+
- Name: ROSA with AWS STS explained
130+
File: cloud-experts-rosa-sts-explained
129131
- Name: Deploying a cluster
130132
Dir: cloud-experts-getting-started-deploying
131133
Topics:
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
:_content-type: ASSEMBLY
2+
[id="cloud-experts-rosa-sts-explained"]
3+
= Tutorial: ROSA with AWS STS explained
4+
include::_attributes/attributes-openshift-dedicated.adoc[]
5+
:context: cloud-experts-rosa-sts-explained
6+
7+
toc::[]
8+
9+
//rosaworkshop.io content metadata
10+
//Brought into ROSA product docs 2023-10-26
11+
12+
This tutorial outlines the two options for allowing {product-title} (ROSA) to interact with resources in a user's Amazon Web Service (AWS) account. It details the components and processes that ROSA with Security Token Service (STS) uses to obtain the necessary credentials. It also reviews why ROSA with STS is the more secure, preferred method.
13+
14+
[NOTE]
15+
====
16+
This content currently covers ROSA Classic with AWS STS and not does yet account for ROSA with hosted control planes (HCP) with AWS STS.
17+
====
18+
19+
This tutorial will:
20+
21+
* Enumerate two of the deployment options:
22+
** ROSA with IAM Users
23+
** ROSA with STS
24+
* Explain the differences between the two options
25+
* Explain why ROSA with STS is more secure and the preferred option
26+
* Explain how ROSA with STS works
27+
28+
[id="different-credential-methods-rosa"]
29+
== Different credential methods to deploy ROSA
30+
As part of ROSA, Red Hat manages infrastructure resources in your AWS account and must be granted the necessary permissions. There are currently two supported methods for granting those permissions:
31+
32+
* Using static IAM user credentials with an `AdministratorAccess` policy
33+
+
34+
This is referred to as "ROSA with IAM Users" in this tutorial. It is not the preferred credential method.
35+
+
36+
* Using AWS STS with short-lived, dynamic tokens
37+
+
38+
This is referred to as “ROSA with STS” in this tutorial. It is the preferred credential method.
39+
40+
[id="different-credential-methods-rosa-iam-users"]
41+
=== Rosa with IAM Users
42+
When ROSA was first released, the only credential method was ROSA with IAM Users. This method grants IAM users with an `AdministratorAccess` policy full access to create the necessary resources in the AWS account that uses ROSA. The cluster can then create and expand its credentials as needed.
43+
44+
[id="different-credential-methods-rosa-sts"]
45+
=== ROSA with STS
46+
ROSA with STS grants users limited, short-term access to resources in your AWS account. The STS method uses predefined roles and policies to grant temporary, least-privilege permissions to IAM users or authenticated federated users. The credentials typically expire an hour after being requested. Once expired, they are no longer recognized by AWS and no longer have account access from API requests made with them. For more information, see the link:https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html[AWS documentation]. While both ROSA with IAM Users and ROSA with STS are currently enabled, ROSA with STS is the preferred and recommended option.
47+
48+
[id="sts-security"]
49+
== ROSA with STS security
50+
Several crucial components make ROSA with STS more secure than ROSA with IAM Users:
51+
52+
* An explicit and limited set of roles and policies that the user creates ahead of time. The user knows every requested permission and every role used.
53+
* The service cannot do anything outside of those permissions.
54+
* Whenever the service needs to perform an action, it obtains credentials that expire in one hour or less. This means that there is no need to rotate or revoke credentials. Additionally, credential expiration reduces the risks of credentials leaking and being reused.
55+
56+
[id="sts-explained"]
57+
== AWS STS explained
58+
ROSA uses AWS STS to grant least-privilege permissions with short-term security credentials to specific and segregated IAM roles. The credentials are associated with IAM roles specific to each component and cluster that makes AWS API calls. This method aligns with principles of least-privilege and secure practices in cloud service resource management. The ROSA command line interface (CLI) tool manages the STS roles and policies that are assigned for unique tasks and takes action upon AWS resources as part of OpenShift functionality.
59+
60+
STS roles and policies must be created for each ROSA cluster. To make this easier, the installation tools provide all the commands and files needed to create the roles as policies and an option to allow the CLI to automatically create the roles and policies. See xref:../../rosa_install_access_delete_clusters/rosa-sts-creating-a-cluster-with-customizations.adoc#rosa-sts-creating-cluster-customizations_rosa-sts-creating-a-cluster-with-customizations[Creating a ROSA cluster with STS using customizations] for more information about the different `--mode` options.
61+
62+
[id="components-specific-to-rosa-with-sts"]
63+
== Components specific to ROSA with STS
64+
* *AWS infrastructure* - This provides the infrastructure required for the cluster. It contains the actual EC2 instances, storage, and networking components. See xref:../../rosa_architecture/rosa_policy_service_definition/rosa-service-definition.adoc#rosa-sdpolicy-aws-compute-types_rosa-service-definition[AWS compute types] to see supported instance types for compute nodes and xref:../../rosa_planning/rosa-sts-aws-prereqs.adoc#rosa-ec2-instances_rosa-sts-aws-prereqs[provisioned AWS infrastructure] for control plane and infrastructure node configuration.
65+
* *AWS STS* - See the credential method section above.
66+
* *OpenID Connect (OIDC)* - This provides a mechanism for cluster Operators to authenticate with AWS, assume the cluster roles through a trust policy, and obtain temporary credentials from STS to make the required API calls.
67+
* *Roles and policies* - The roles and policies are one of the main differences between ROSA with STS and ROSA with IAM Users. For ROSA with STS, the roles and policies used by ROSA are broken into account-wide roles and policies and Operator roles and policies.
68+
+
69+
The policies determine the allowed actions for each of the roles. See xref:../../rosa_architecture/rosa-sts-about-iam-resources.adoc#rosa-sts-about-iam-resources[About IAM resources for ROSA clusters that use STS] for more details about the individual roles and policies.
70+
+
71+
** The account-wide roles are:
72+
+
73+
*** ManagedOpenShift-Installer-Role
74+
*** ManagedOpenShift-ControlPlane-Role
75+
*** ManagedOpenShift-Worker-Role
76+
*** ManagedOpenShift-Support-Role
77+
+
78+
** The account-wide policies are:
79+
+
80+
*** ManagedOpenShift-Installer-Role-Policy
81+
*** ManagedOpenShift-ControlPlane-Role-Policy
82+
*** ManagedOpenShift-Worker-Role-Policy
83+
*** ManagedOpenShift-Support-Role-Policy
84+
*** ManagedOpenShift-openshift-ingress-operator-cloud-credentials ^[1]^
85+
*** ManagedOpenShift-openshift-cluster-csi-drivers-ebs-cloud-credent ^[1]^
86+
*** ManagedOpenShift-openshift-cloud-network-config-controller-cloud ^[1]^
87+
*** ManagedOpenShift-openshift-machine-api-aws-cloud-credentials ^[1]^
88+
*** ManagedOpenShift-openshift-cloud-credential-operator-cloud-crede ^[1]^
89+
*** ManagedOpenShift-openshift-image-registry-installer-cloud-creden ^[1]^
90+
+
91+
[.small]
92+
--
93+
1. This policy is used by the cluster Operator roles, listed below. The Operator roles are created in a second step because they are dependent on an existing cluster name and cannot be created at the same time as the account-wide roles.
94+
--
95+
+
96+
** The Operator roles are:
97+
+
98+
*** <cluster-name\>-xxxx-openshift-cluster-csi-drivers-ebs-cloud-credent
99+
*** <cluster-name\>-xxxx-openshift-cloud-network-config-controller-cloud
100+
*** <cluster-name\>-xxxx-openshift-machine-api-aws-cloud-credentials
101+
*** <cluster-name\>-xxxx-openshift-cloud-credential-operator-cloud-crede
102+
*** <cluster-name\>-xxxx-openshift-image-registry-installer-cloud-creden
103+
*** <cluster-name\>-xxxx-openshift-ingress-operator-cloud-credentials
104+
+
105+
** Trust policies are created for each account-wide and Operator role.
106+
107+
[id="deploying-rosa-with-sts-cluster"]
108+
== Deploying a ROSA STS cluster
109+
You are not expected to create the resources listed in the below steps from scratch. The ROSA CLI creates the required JSON files for you and outputs the commands you need. The ROSA CLI can also take this a step further and run the commands for you, if desired.
110+
111+
.Steps to deploy a ROSA with STS cluster
112+
. Create the account-wide roles and policies.
113+
. Assign the permissions policy to the corresponding account-wide role.
114+
. Create the cluster.
115+
. Create the Operator roles and policies.
116+
. Assign the permission policy to the corresponding Operator role.
117+
. Create the OIDC provider.
118+
119+
The roles and policies can be created automatically by the ROSA CLI, or they can be manually created by utilizing the `--mode manual` or `--mode auto` flags in the ROSA CLI. For further details about deployment, see xref:../../rosa_install_access_delete_clusters/rosa-sts-creating-a-cluster-with-customizations.adoc#rosa-sts-creating-cluster-customizations_rosa-sts-creating-a-cluster-with-customizations[Creating a cluster with customizations] or the link:https://www.rosaworkshop.io/rosa/2-deploy/[Deploying the cluster tutorial].
120+
121+
[id="sts-process"]
122+
== ROSA with STS workflow
123+
The user creates the required account-wide roles and account-wide policies. For more information, see the components section in this tutorial. During role creation, a trust policy, known as a cross-account trust policy, is created which allows a Red Hat-owned role to assume the roles. Trust policies are also created for the EC2 service, which allows workloads on EC2 instances to assume roles and obtain credentials. The user can then assign a corresponding permissions policy to each role.
124+
125+
After the account-wide roles and policies are created, the user can create a cluster. Once cluster creation is initiated, the Operator roles are created so that cluster Operators can make AWS API calls. These roles are then assigned to the corresponding permission policies that were created earlier and a trust policy with an OIDC provider. The Operator roles differ from the account-wide roles in that they ultimately represent the pods that need access to AWS resources. Because a user cannot attach IAM roles to pods, they must create a trust policy with an OIDC provider so that the Operator, and therefore the pods, can access the roles they need.
126+
127+
Once the user assigns the roles to the corresponding policy permissions, the final step is creating the OIDC provider.
128+
129+
image::cloud-experts-sts-explained_creation_flow.png[]
130+
131+
When a new role is needed, the workload currently using the Red Hat role will assume the role in the AWS account, obtain temporary credentials from AWS STS, and begin performing the actions using API calls within the customer's AWS account as permitted by the assumed role's permissions policy. The credentials are temporary and have a maximum duration of one hour.
132+
133+
image::cloud-experts-sts-explained_highlevel.png[]
134+
135+
The entire workflow is depicted in the following graphic:
136+
137+
image::cloud-experts-sts-explained_entire_flow.png[]
138+
139+
Operators use the following process to obtain the requisite credentials to perform their tasks. Each Operator is assigned an Operator role, a permissions policy, and a trust policy with an OIDC provider. The Operator will assume the role by passing a JSON web token that contains the role and a token file (`web_identity_token_file`) to the OIDC provider, which then authenticates the signed key with a public key. The public key is created during cluster creation and stored in an S3 bucket. The Operator then confirms that the subject in the signed token file matches the role in the role trust policy which ensures that the OIDC provider can only obtain the allowed role. The OIDC provider then returns the temporary credentials to the Operator so that the Operator can make AWS API calls. For a visual representation, see below:
140+
141+
image::cloud-experts-sts-explained_oidc_op_roles.png[]
142+
143+
[id="sts-use-cases"]
144+
== ROSA with STS use cases
145+
146+
.Creating nodes at cluster install
147+
The Red Hat installation program uses the `RH-Managed-OpenShift-Installer` role and a trust policy to assume the `Managed-OpenShift-Installer-Role` role in the customer's account. This process returns temporary credentials from AWS STS. The installation program begins making the required API calls with the temporary credentials just received from STS. The installation program creates the required infrastructure in AWS. The credentials expire within an hour and the installation program no longer has access to the customer's account.
148+
149+
The same process also applies for support cases. In support cases, a Red Hat site reliability engineer (SRE) replaces the installation program.
150+
151+
.Scaling the cluster
152+
The `machine-api-operator` uses link:https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html[AssumeRoleWithWebIdentity] to assume the `machine-api-aws-cloud-credentials` role. This launches the sequence for the cluster Operators to receive the credentials. The `machine-api-operator` role can now make the relevant API calls to add more EC2 instances to the cluster.
190 KB
Loading
Loading
Loading
38.3 KB
Loading
Loading

0 commit comments

Comments
 (0)