A CI server needs read access to one private repo. Deploy key or machine user?
IntermediateScenarioSecrets, Signing and Security
Answer
Situation read → Pick the narrowest credential that fits.
What I'd do →
- Deploy key: an SSH key tied to a single repo, read-only by default. Best for one repo.
- Machine user: a separate account that can access many repos but consumes a seat and is a standing target.
- For many repos, prefer a GitHub App with an installation token.
- Rotate keys regularly and store them in the CI secret store.
Why → A deploy key cannot touch other repos, which limits damage.
Interview tip → A deploy key can only be used on one repository at a time.
More on Secrets, Signing and Security
A developer pushed an AWS access key to a public repo 10 minutes ago. What is your first move?BeginnerAfter rotating the leaked key, you must purge it from repository history. How?AdvancedA push is rejected: "GH013: Repository rule violations found ... Push cannot contain secrets". What do you do?IntermediateSecret scanning alerts have piled up, and many look like false positives or old test credentials.IntermediateYou must set up signed commits on your laptop. Which method do you pick?BeginnerYour GPG signing key expires next week. What is the correct way to handle it?Intermediate