diff --git a/README.md b/README.md index 663b32c..5d81743 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ account**. That is why the GCP module's base grant includes `roles/iam.serviceAccountUser`, and why it asks for a project dedicated to Ringleader workstations. Check what your default compute service account holds (older projects give it `roles/editor`), or give workstations a role-less service account of their own — see -[`gcp/README.md`](gcp/README.md#every-workstation-runs-as-a-service-account). +[`gcp/README.md`](gcp/README.md#every-vm-ringleader-creates-runs-as-a-service-account). Letting Ringleader **create** those per-user identities and **bind roles** to them is a separate switch, `enable_workstation_identities`, and it costs real permissions: on GCP the @@ -370,11 +370,17 @@ Each cloud's README lists the exact values. In short: created) subnet id. - **AWS** — role ARN, region, and (if created) subnet id and security group id. -Each module also prints a **governed subnet id** where it created one. That is the subnet you -name on a workstation that carries an **egress policy**. Placing a box in it is what puts it -behind the proxy. On AWS and Azure, a box with no egress policy loses its egress if it shares a -subnet the proxy steers. On those two clouds, each Ringleader namespace that runs its own proxy also -needs a governed subnet of its own. Set `additional_governed_subnets` (`ADDITIONAL_GOVERNED_SUBNETS` +The subnet, region, zone, network tags and security groups go on a CloudIdentity. That is the +Ringleader object a namespace admin writes to say how the namespace's workstations run in your +account. By default a namespace member cannot set these values on a workstation. Each cloud's README +shows a CloudIdentity. + +Each module also prints a **governed subnet id** where it created one. In a namespace that runs a +proxy, a namespace admin names it in the CloudIdentity for the workstations that carry an **egress +policy**. Placing a workstation in it is what puts it behind the proxy. On AWS and Azure, a +workstation with no egress policy loses its egress if it shares a subnet the proxy steers. On those +two clouds, each Ringleader namespace that runs its own proxy also needs a governed subnet of its +own. Set `additional_governed_subnets` (`ADDITIONAL_GOVERNED_SUBNETS` for `deploy.sh`) to create one for each further namespace. Terraform keys those ids by the labels you gave them, the Azure `deploy.sh` prints them, and CloudFormation outputs them by slot number. diff --git a/aws/README.md b/aws/README.md index bb5f61b..5562a6f 100644 --- a/aws/README.md +++ b/aws/README.md @@ -87,8 +87,7 @@ Everything else derives from those two: ## Pick a path Use whichever your team already runs. They create the same OIDC provider, role, and -optional network, with one difference: the per-workstation instance-profile option -(`enable_workstation_identities`, below) exists only on the Terraform path. +optional network. ### CloudFormation (`aws` CLI) @@ -144,6 +143,73 @@ pad's range, and the plan fails rather than guessing if they disagree. See becomes the `Storage` object's `spec.grant`, and on the named width **`artifact_storage_bucket`**, which becomes its `spec.bucket` +### Setting these values on a CloudIdentity + +A CloudIdentity is the Ringleader object a namespace admin writes to say how that namespace's +workstations run in your account. Its `spec.defaultProviderConfig` fills in a value a workstation +leaves out, and its `spec.overrideProviderConfig` sets a value that wins over the workstation's own. +By default a namespace member cannot set the region, subnet or security groups on a workstation, so +they go here. With no `selector`, a CloudIdentity applies to every AWS workstation in its namespace: + +```yaml +apiVersion: core.ringleader.dev/v1 +kind: CloudIdentity +metadata: + name: aws + namespace: team-a +spec: + provider: aws + cloudAccountRef: + defaultProviderConfig: + aws: + region: us-east-1 + subnetId: + securityGroupIds: [] +``` + +`cloudAccountRef` names the CloudAccount, the Ringleader object that holds the `target_role_arn` +above. + +Each workstation takes its settings from one CloudIdentity: the one with the highest `priority` +among those that select it. A workstation that carries an egress policy needs the group with no +egress rules (`inbound_only_security_group_id`). Where its namespace runs a proxy, it needs the +governed subnet too. For those workstations, write a second CloudIdentity with a higher `priority` +that selects them by a label you choose. Repeat in it every value the first one sets apart from the +subnet and the security group, because only one CloudIdentity applies: + +```yaml +apiVersion: core.ringleader.dev/v1 +kind: CloudIdentity +metadata: + name: aws-governed + namespace: team-a +spec: + provider: aws + cloudAccountRef: + priority: 10 + selector: + matchLabels: + egress: governed + subnet: + defaultProviderConfig: + aws: + region: us-east-1 + securityGroupIds: [] +``` + +`spec.subnet` puts every workstation this CloudIdentity selects in that subnet. It also claims the +subnet for the namespace, so Ringleader refuses another namespace's workstation there. Name the +subnet in `spec.subnet` only, because Ringleader refuses a CloudIdentity that also names one in +`defaultProviderConfig` or `overrideProviderConfig`. Never name the shared `subnet_id` in +`spec.subnet`, since the claim would refuse any workstation another namespace places in it. In a +namespace that runs no proxy, set `subnetId: ` under `defaultProviderConfig.aws` in place +of `spec.subnet`. + +A workstation labeled `egress: governed` then takes these values. One that carries an egress policy +without the label takes the first CloudIdentity's group, which permits egress. Ringleader therefore +refuses to create such a workstation, as +[Which security group a workstation gets](#which-security-group-a-workstation-gets) describes. + ## Reaching your workstations | | needs | provided by | @@ -391,9 +457,10 @@ ADDITIONAL_GOVERNED_SUBNETS=team-a=10.60.208.0/20,team-b=10.60.192.0/20 ./deploy Each entry becomes a subnet named `ringleader-governed-