New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable easy ssh key revocation #694
Merged
bors-servo
merged 2 commits into
servo:master
from
aneeshusa:enable-easy-ssh-key-revocation
Jun 14, 2017
+95
−12
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Loading status checks…
Fully manage SSH keys
Fully manage the `.ssh/authorized_keys` file for root, so that keys removed from Salt are also removed from the file. Note that the AWS (Linux) machines are configured to have two additional keys in the root `authorized_keys` file, namely `servo-aws` and `servo-aws-reserved-instances`, but when used these keys will tell the user to log in as ubuntu, so they don't provide real access. Remove these keys as they are not useful. Add documentation about gaining SSH access and revoking/rotating keys.
- Loading branch information
commit 45195917595c6068434a832b296d87f085789dbe
| @@ -0,0 +1,53 @@ | ||
| # Admin Tasks | ||
|
|
||
| ## SSH | ||
|
|
||
| ### Gaining SSH Access | ||
|
|
||
| If you need access, create a PR against https://github.com/servo/saltfs/, | ||
| including your account in the `admin/map.jinja` file | ||
| and SSH pubkey in the `admin/ssh` folder. | ||
|
|
||
| To access the machines, log in as root on Linux or macOS; | ||
| there are not yet individual accounts on slaves. | ||
|
|
||
| If you need to test something (e.g., a reftest failure), | ||
| make sure to su - servo to simulate the space, | ||
| and check the Buildbot config for any required environment variables. | ||
|
|
||
| ### SSH key revocation and rotation | ||
|
||
|
|
||
| SSH key rotation can be performed via Salt; | ||
| our Salt configs will both rotate in new keys | ||
| and automatically remove old keys. | ||
|
|
||
| However, waiting for a full review cycle and full highstate | ||
| on all machines can take quite a while. | ||
| This should be preferred if possible (when optimistically rotating keys), | ||
| but in the event of key leakage, | ||
| the old key must be revoked as quickly as possible. | ||
| Hence, the following steps should be used: | ||
|
|
||
| - Make a PR to saltfs as normal with the new key, | ||
| and wait for a reviewer to r+ as usual. | ||
| - Using the `/tmp/salt-testing-root` on the Salt master, | ||
| have someone deploy the changed keys without needing to wait for Homu. | ||
| Instructions are in [our Salt docs](./salt.md#discouraged-testing-in-production). | ||
| - Run just the `sshkeys` state instead of a full highstate: | ||
| ``` | ||
| root@servo-master1$ salt -C 'not G@os:Windows' state.sls_id sshkeys admin | ||
| ``` | ||
| Note that Windows machines aren't targeted, as SSH keys aren't used there, | ||
| and the state will fail to run there. | ||
| Additionally, make sure to use `test=True` first, and `tee` to a log file. | ||
|
|
||
| :warning: Make sure to wait for the command to return and check that it runs | ||
| successfully on all machines! In case of a timeout, you can re-run the command | ||
| targeting just a specific builder: | ||
|
|
||
| ``` | ||
| root@servo-master1$ salt 'servo-mac3' state.sls_id sshkeys admin | ||
| ``` | ||
|
|
||
| - Make sure to clean up the `/tmp/salt-testing-root` after you're done, | ||
| and remove the `S-needs-deploy` label on the PR after it merges. | ||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Please take a look at these instructions in particular and let me know if they seem reasonable!