Skip to content

Commit cf5d433

Browse files
committed
infra: update documentation about whitelisted bastion IPs
1 parent 9289c09 commit cf5d433

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

src/infra/docs/bastion.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,54 @@ users. Please leave a comment clarifying which servers the user will have
4848
access to.
4949

5050
Once that's done [apply the playbook][ansible-apply] and [add a new whitelisted
51-
IP address](#updating-the-whitelisted-ips).
51+
IP address](#adding-a-whitelisted-ip).
5252

53-
### Updating the whitelisted IPs
53+
### Adding a whitelisted IP
5454

5555
Due to privacy reasons, all the static IP addresses of team members with access
5656
to the bastion are stored on [AWS SSM Parameter Store][ssm] instead of public
57-
git repositories. To add or update an IP address you can run this command
58-
(taking care of replacing `USERNAME` and `IP_ADDRESS` with the proper values):
57+
git repositories. To add an IP address you can run this command (taking care of
58+
replacing `USERNAME` and `IP_ADDRESS` with the proper values):
5959

6060
```
6161
aws ssm put-parameter --type String --name "/prod/bastion/allowed-ips/USERNAME" --value "IP_ADDRESS/32"
6262
```
6363

64-
If you're adding an IP address instead of updating it, you'll also need to add
65-
the username to the list in [`terraform/services.tf`][allowed-ips] (key
66-
`allowed_users` in the `service_bastion` module).
64+
You'll also need to add the username to the list in
65+
[`terraform/services.tf`][allowed-ips] (key `allowed_users` in the
66+
`service_bastion` module). Once you made all the needed changes you wanted you
67+
need to [apply the Terraform configuration][terraform-apply].
68+
69+
### Updating a whitelisted IP
70+
71+
Due to privacy reasons, all the static IP addresses of team members with access
72+
to the bastion are stored on [AWS SSM Parameter Store][ssm] instead of public
73+
git repositories. To update an IP address you can run this command (taking care
74+
of replacing `USERNAME` and `IP_ADDRESS` with the proper values):
75+
76+
```
77+
aws ssm put-parameter --overwrite --type String --name "/prod/bastion/allowed-ips/USERNAME" --value "IP_ADDRESS/32"
78+
```
6779

6880
Once you made all the needed changes you wanted you need to [apply the
6981
Terraform configuration][terraform-apply].
7082

83+
### Removing a whitelisted IP
84+
85+
Due to privacy reasons, all the static IP addresses of team members with access
86+
to the bastion are stored on [AWS SSM Parameter Store][ssm] instead of public
87+
git repositories. To remove an IP address you can run this command (taking care
88+
of replacing `USERNAME` with the proper value):
89+
90+
```
91+
aws ssm delete-parameter --name "/prod/bastion/allowed-ips/USERNAME"
92+
```
93+
94+
You'll also need to remove the username from the list in
95+
[`terraform/services.tf`][allowed-ips] (key `allowed_users` in the
96+
`service_bastion` module). Once you made all the needed changes you wanted you
97+
need to [apply the Terraform configuration][terraform-apply].
98+
7199
[ansible]: https://github.com/rust-lang/simpleinfra/blob/master/ansible/playbooks/bastion.yml
72100
[terraform]: https://github.com/rust-lang/simpleinfra/tree/master/terraform/services/bastion
73101
[grafana]: https://grafana.rust-lang.org/d/rpXrFfKWz/instance-metrics?orgId=1&var-instance=bastion.infra.rust-lang.org:9100

0 commit comments

Comments
 (0)