Onboard AWS
Let Ringleader run workstation EC2 instances in your own AWS account, with a Terraform module or a CloudFormation stack and no access key.
Let Ringleader run your developers’ workstations as EC2 instances in your own AWS account, on your bill and inside your VPC, with a Terraform module or a CloudFormation stack. Ringleader never holds a key to your account, and the role it signs in as never holds account admin.
Prerequisites
- Ringleader installed, for the check at the end.
- Two values from Ringleader, which you received when your organization was set up: the issuer URL, written with no trailing slash, and your organization’s id, a UUID and never its name. If you do not have them, ask Ringleader. Fix a sign-in that your cloud refuses says what to check if AWS rejects them.
- An AWS account to run the workstations in. Use an account that serves no other purpose. Workstations are billed to it, and everything Ringleader may do is limited to it. A dedicated account keeps the bill and the risk in one place.
- In that account, permission to create an IAM OIDC provider and an IAM role. You need it only for this setup, which you do once.
- The examples use the CloudAccount
my-aws-accountin the organizationacme. Replace them with yours.
Keyless cloud access explains why no key changes hands. AWS permissions and resources lists what the setup creates.
Set up keyless access
Two paths do the same thing, so use the one your team already runs. Both live in github.com/ringleader-dev/cloud-onboarding, and both create the network for the workstations unless you turn it off. Both finish by printing the values you send back.
An IAM OIDC provider requires a certificate thumbprint. Both paths fill it in from the live certificate, so you never compute it by hand.
CloudFormation
Clone the repository and go to the CloudFormation folder:
git clone https://github.com/ringleader-dev/cloud-onboarding cd cloud-onboarding/aws/cloudformationRun
deploy.shwith your two values, your region and the addresses your engineers connect from. It deploys the stack and prints the values to send back.ISSUER_URL=https://oidc-app.ringleader.dev \ ORG_UID=0192f5bf-af83-7178-8d0a-f1c7aea06bde \ REGION=us-east-1 \ CREATE_NETWORK=true \ SSH_SOURCE_CIDR=203.0.113.0/24 \ ./deploy.sh
SSH_SOURCE_CIDR adds an SSH rule of your own. Cloud accounts and reachability says who can connect without it.
Terraform
Clone the repository and go to the standalone example:
git clone https://github.com/ringleader-dev/cloud-onboarding cd cloud-onboarding/aws/terraform/examples/standaloneCopy the example variables file:
cp terraform.tfvars.example terraform.tfvarsIn
terraform.tfvars, set the two values above, your region andssh_source_ranges, the addresses your engineers connect from.Apply the module:
terraform init && terraform applyPrint the values to send back:
terraform output handoff
The module is reusable. You can reference it as a module source from your own configuration
instead of copying it. If you do, set allowed_regions to bound what Ringleader may do to
your regions. It is empty by default, so no region condition applies and the whole account is
the boundary.
Send the values to your organization administrator
Send the printed values to whoever administers Ringleader for your organization, which may be
you. terraform output handoff prints them together, and deploy.sh prints them when it
finishes. Values you hand back
says what each value is and where it lands.
Neither tool prints the IAM path for runtime identities, which let a workstation run as an IAM
role of its own. Runtime identities are on by default, and
Setup switches says how to
turn them off. If you keep them on, send the path too, with its slash at each end:
/ringleader-workstations/ with Terraform, or /ringleader/ with CloudFormation. If you set your
own path in workstation_identity_path or WORKSTATION_IDENTITY_PATH, send that one instead.
Create the CloudAccount
As the administrator, create the CloudAccount from the role ARN you were sent, and from the IAM path if you were sent one.
Save this as
my-aws-account.yaml, with your organization, your role ARN and your IAM path:apiVersion: core.ringleader.dev/v1 kind: CloudAccount metadata: name: my-aws-account spec: org: acme provider: aws aws: # The IAM role in YOUR account that Ringleader assumes via # AssumeRoleWithWebIdentity. Its trust policy admits only your organization's # subject and audience. This one value is all AWS needs to sign in. AWS finds the # OIDC provider and the audience from the signed token itself. targetRoleArn: arn:aws:iam::123456789012:role/ringleader-workstations # The IAM path for runtime identities, exactly as you were sent it. This is the # Terraform default. Leave the line out if runtime identities are off. workstationIdentityPath: /ringleader-workstations/Apply it:
rl apply -f my-aws-account.yaml
Signing in needs only aws.targetRoleArn. Ringleader also needs aws.workstationIdentityPath to
give a workstation a runtime identity,
which a CloudIdentity declares in spec.serviceAccount. The
CloudAccount reference lists every
field in a table.
Then create a CloudIdentity with the region,
subnet and security groups you were sent, and a cloudAccountRef that names this CloudAccount.
Choose the security group for workstations
If you created the network with egress control on, you have two security groups, and each
workstation gets one of them. As the administrator, name the group on the CloudIdentity, in
providerConfig.aws.securityGroupIds. Security groups for workstations
shows what each group lets in and out.
- For a workstation with no egress policy, name
security_group_id(Terraform) orSecurityGroupId(CloudFormation). - For a workstation with an egress policy, name
inbound_only_security_group_id(Terraform) orInboundOnlySecurityGroupId(CloudFormation). - Optional: to empty the VPC’s default security group, which compliance checks such as
AWS Security Hub’s EC2.2 expect, set
restrict_default_security_group = true(Terraform). With CloudFormation, runRESTRICT_DEFAULT_SECURITY_GROUP=true ./deploy.sh, which removes the rules after the stack deploys. Name one of the two groups on every workstation first, because a workstation that names none then has no outbound path.
Leave the inbound-only group without an outbound rule
127.0.0.1/32, which permits nothing. Leave it alone.AWS security groups says what the default group must allow, and Enforcement points says why a policy needs the second group.
Check the setup
Confirm that Ringleader can use the identity before anyone creates a workstation. The check starts once an administrator has created the CloudAccount and the CloudIdentity from the values you sent back.
Wait for the CloudIdentity to be ready. Replace
awsanddevwith the CloudIdentity’s name and namespace:rl cloudidentity wait aws -n dev --for Ready --timeout 2mRead its status:
rl cloudidentity get aws -n dev -o yaml # status.valid: true
status.valid: true means Ringleader can use the identity. false means it cannot, and
rl cloudidentity describe aws -n dev says why.
Optional: Revoke Ringleader’s access
Delete the OIDC provider or the role, and Ringleader can get no new credentials. There are no keys to hunt down. AWS keeps temporary credentials valid until they expire, so credentials Ringleader already holds can keep working for up to an hour. If you never revoke, Ringleader keeps the access you granted.
- In the AWS console, delete the OIDC provider or the role.
- With Terraform, run
terraform destroy. - With CloudFormation, delete the stack.
To also cut off the credentials Ringleader already holds, work in the IAM console before you run Terraform or delete the stack:
- Delete the OIDC provider, so Ringleader cannot sign in again.
- Open the role and choose Revoke active sessions on its Revoke sessions tab. Revoke IAM role temporary security credentials says what that does.
- Delete the role. Revoking added a policy to it that Terraform and CloudFormation do not know about, and deleting that policy on its own would let the old credentials work again.
Then run terraform destroy or delete the stack for the rest.
Troubleshoot
If status.valid is false or AWS turns Ringleader away, compare what your account checks
against what was created. Checks your account makes
lists the three values. A mismatch in one of them is the usual cause, and a trailing slash on
the issuer is the usual mismatch. A wrong role ARN is the other usual cause.
If a workstation refuses to start and the message names a security group, the workstation was given the first group but has an egress policy. Ringleader refuses to start a workstation it would have to report as restricted while it can reach the whole internet. Give it the inbound-only group instead.
If a workstation that names no security group refuses to start, your VPC’s default group has no outbound rule, or the workstation has an egress policy and the default group allows outbound traffic. Give the workstation one of the two groups.
If a workstation reports the SSHAdmissionMissing condition, Ringleader could not create
its SSH security group. That happens with egress control turned off, or for a workstation in a
VPC the grant does not cover. A workstation reports Ready whether or not anything can reach
it, so it cannot confirm this for you. Cloud accounts and reachability
explains the rule and your options.
If an instance does not match its image, check its instance type. The image aliases resolve to x86-64 images, so an arm64 (Graviton) instance type will not match. See Values you hand back.
Next steps
- Cloud accounts explains how the pieces fit, and the egress and storage switches that are on by default.
- Cloud accounts and reachability explains who can connect to your workstations, public addresses and the NAT gateway.
- Cloud runtime identities explains how to give a workstation an IAM role of its own.
- Storage buckets explains how to keep session transcripts and uploaded files in an S3 bucket in your account.
- AWS permissions and resources lists the resources, permissions and tables behind this setup.
- Provider images and keys lists the full
providerConfig.awsfield set.