Skip to content

Commit 5378355

Browse files
Update gh-bb-integration.md
1 parent f50e5c6 commit 5378355

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

jekyll/_cci2/gh-bb-integration.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ Integrated status also appears on the pull request screen, to show that all test
5454
5555
![Status Badge After PR]({{ site.baseurl }}/assets/img/docs/status_check.png)
5656
57+
## Best Practices for Keys
58+
59+
- Use Deploy Keys whenever possible.
60+
- When Deploy Keys cannot be used, Machine User Keys must be used, and have their access restricted to the most limited set of repos and permissions necessary.
61+
- Never use non-Machine user keys.
62+
- You must rotate the Deploy or User key as part of revoking user access to that repo.
63+
1. After revoking the user’s access in github, delete deployment key in GitHub.
64+
2. Delete the deployment key in the CircleCI project.
65+
3. Regenerate the deployment key in CircleCI project.
66+
- Ensure no developer has access to a build in a repo with a User Key that requires more access than they have.
67+
68+
5769
## Enable Your Project to Check Out Additional Private Repositories
5870
5971
If your testing process refers to multiple repositories, CircleCI will need a
@@ -92,7 +104,7 @@ Permission denied (publickey).
92104
## Controlling Access Via a Machine User
93105
94106
For fine-grained access to multiple repositories,
95-
consider creating a machine user
107+
it is best practice to create a machine user
96108
for your CircleCI projects.
97109
A [machine user](https://developer.github.com/v3/guides/managing-deploy-keys/#machine-users) is a GitHub user
98110
that you create for running automated tasks.
@@ -210,7 +222,7 @@ If you want to push to the repository from your builds, you will need a deployme
210222
211223
A user key is a user-specific SSH key. Your VCS has the public key, and CircleCI stores the private key. Possession of the private key gives the ability to act as that user, for purposes of 'git' access to projects.
212224
213-
### Creating a GitHub User Key
225+
### Creating a GitHub Deploy Key
214226
{:.no_toc}
215227
216228
In this example,
@@ -306,7 +318,7 @@ For this reason, a deploy key isn't sufficiently powerful for projects with addi
306318

307319
### What about security?
308320

309-
The private keys of the checkout keypairs CircleCI generates never leave the CircleCI systems (only the public key is transmitted to GitHub) and are safely encrypted in storage. However, since they are installed into your build containers, any code that you run in CircleCI can read them.
321+
The private keys of the checkout keypairs CircleCI generates never leave the CircleCI systems (only the public key is transmitted to GitHub) and are safely encrypted in storage. However, since they are installed into your build containers, any code that you run in CircleCI can read them and developers that can SSH in will have direct access to this key.
310322

311323
**Isn't there a difference between deploy keys and user keys?**
312324

0 commit comments

Comments
 (0)