5 ms·
Code reviews don't do anything to solve issues where an attacker manipulates the repository after the commits are already there. To solve that, you'd have to do
by kevingadd 12y ago
Code reviews don't do anything to solve issues where an attacker manipulates the repository after the commits are already there. To solve that, you'd have to do reviews of existing commits well after they go in, I think?
I don't see how test cases would fix this either. The attacker can break the test case just as easily as they can insert a backdoor.
- ASneakyFox 12y agoIf the attacker has access to your remote repo then isnt that the problem? You can sign your commits all day but you have more serious issues to attend to.
- berdario 12y agoAt least if things go horribly wrong, by having all your commits signed you can instantly point out where the illicit tampering happened and have some proof that the illicit change wasn't willingly added by you I started to sign all my commits in bzr, hg and git since more than 1 year, and it's very easy to do it: you should try to do it as well (I disagree with Linus and other people who argue that you should just sign the merge commits, since otherwise you'd be "inflationing"/reducing the value of signatures if you'd sign everything: it would be like only signing the very important messages with gpg, and not doing it for the remaining majority: it's fine if you want to have deniability for your unsigned messages, but that's not what I want for my commits: ideally I'd want all of the changes to be auditable)
- oneandoneis2 12y agoYou can't rewrite history in git, that's what the shas are there for. An attacker who gains access to a repo can add new commits, but not tamper with the existing ones.
- LoganCale 12y agoYes you absolutely can rewrite history.
- oneandoneis2 12y agoNo, you can't. You can create a new history, you can't edit an existing one. To clarify: You can, e.g., use interactive rebase to remove a commit from a branch. But that creates a new HEAD with a different SHA - this is why rebasing published branches is such a bad thing. The parent was implying you could change history without anyone noticing. This implies modifying a previous commit whilst keeping the current HEAD the same, which can't be done.
- sanderjd 12y agoWhile it's definitely possible to re-write commits, a reasonably strong protection against this is to treat a force-pull of master as a stop-the-world-and-figure-out-what-the-hell-happened type of catastrophe.