| ▲ | simonw 3 hours ago | |
> an attacker gained access to an employee’s corporate GitHub account. The actor used the account to access source code and push malicious code to backend services, which downloaded administrative data pertaining to our customers. What are best practices for protecting against this kind of risk? I don't mean account security / require 2FA etc - I mean once an account like this with push access to repos has been compromised. | ||
| ▲ | 6thbit 3 hours ago | parent | next [-] | |
Physical second factor on pushes would be a good place to begin with. Perhaps also GPG signing the commits with yubikey. On-demand requests to elevate the required permissions for any higher risk actions, some of which require multiple humans physically intervening. | ||
| ▲ | eddythompson80 39 minutes ago | parent | prev | next [-] | |
Prevent push to main or release branches or tags, require >0 non-author approvals (or >1 for bot PRs) for main or release merges. Breakglass scenarios become the main issue. You could Limit accounts with breakglass permissions to 2 non-personal account that ideally require some form of JIT to gain access to. But JIT controls are difficult in non-enterprise environments. It's easy to lock yourself out and require support intervention and it becomes a verification nightmare. | ||
| ▲ | madeofpalk an hour ago | parent | prev [-] | |
Assume you have a malicious employee. Use protected branches, which prevent direct pushes to main. Require only main has ability to deploy to production. OIDC and Github Environments can help you make these assertions. Don't use static credentials. | ||