4 ms·
>And that's why entrusting a third party with managing something as critical as your source code is unwise. Yes, but signing your code strongly reduces the nee
by wongarsu 8y ago
>And that's why entrusting a third party with managing something as critical as your source code is unwise.
Yes, but signing your code strongly reduces the need for trust. If every commit is signed, and every checkout and clone checks that commits are signed by one of the trusted parties, Github has no chance to insert or modify code.
- Leace 8y ago> (...) Github has no chance to insert or modify code. Yes, exactly! The only slim window is refs. All-signed-commits still does not protect against someone pushing signed commit from branch "testing" to branch "master". But `git push --signed` [0] makes it possible to have an audit log of all ref modifications. [0]: https://github.com/git/git/commit/a85b377d0419a9dfaca8af2320cc33b051cbed04 https://github.com/git/git/commit/a85b377d0419a9dfaca8af2320...
- ElBarto 8y agoIf you do not trust Github then signed commits will not help since Github physically controls the repository.
- patmorgan23 8y agoGithub can't fake the sigs
- ElBarto 8y agoSigs are not important if they hold the repository to start with. If the premise is "I don't trust Github" then the only option is not to use Github. And, in any case, sigs do not prevent malicious code changes.
- simias 8y agoI don't understand what you mean exactly. What attack vector are you considering? If I sign a commit and push it on github anybody else can pull it from github and if they have my key than can validate that it is indeed me who made it. The only thing GH can do is modify it and strip the signature, modify it and replace the signature with a "fake" one that may fool people who don't have my public key or simply drop my commit altogether if for instance it contains a security fix (but then they also have to drop all future commits referencing this one since the hashes won't match).
- ElBarto 8y agoYou cannot guarantee the integrity of a repository that is controlled by a third party. You have to trust them.
- danieldk 8y agoYou can. Git's DAG is a Merkle tree. If we compare the hashes of the latest commit two git repositories and they are identical, then they have exactly the same history up to and including that commit [1]. If GitHub modified a commit, the hashes of all commits starting at that commit would change. This is why commit signing is important, it makes it impossible to change commits up to the signed commit, since it would change the hash of the signed commit and signature verification will fail. [1] Or you found a way to modify the repository that leads to a hash collision. Which is unlikely.
- ElBarto 8y ago@danieldk: "If we compare the hashes of the latest commit two git repositories" Which implies that you hold a copy of the repository, which is therefore the master copy, as opposed to trusting a third party to do that.
- danieldk 8y agoWhich implies that you hold a copy of the repository, which is therefore the master copy, as opposed to trusting a third party to do that. No, you do not need to hold a copy of the repository. You only need a known-good hash. Commit signing is a way to vouch that a hash is good. Similarly, when downloading a distribution ISO, you do not have to trust the mirror, you only need someone trusted (e.g. the distribution maintainer) to vouch the correct hash of an ISO. In both cases, you can hash the data that you retrieved and compare to a hash that is known to be good.
- ElBarto 8y ago@danieldk: "No, you do not need to hold a copy of the repository. You only need a known-good hash. Commit signing is a way to vouch that a hash is good." The overhead is such that you are better off holding the repo yourself a la linux kernel. Note also that SHA1 collisions are a practical attack these days: https://shattered.io/ https://shattered.io/ . So if you rely on SHA1 hashes you have no guarantee...
- danieldk 8y agoSigs are not important if they hold the repository to start with. Why not? Someone can clone the repository and verify using my public key that I signed a commit. If GitHub modifies the repository, the chain of hashes changes, and the signature would be incorrect. And, in any case, sigs do not prevent malicious code changes. That is true. But if every commit was signed using a known signature, then you know who injected the malicious code. For a third party to inject malicious code, they would have to compromise the one committer's machine and/or key, rather than GitHub or a specific GitHub account. Also, once the attack is detected, you know which commits are potentially bad, namely those signed using the compromised key.
- kccqzy 8y agoI don't trust my ISP (that much), yet I feel fine to use my ISP to access my bank. That's because TLS protects me from malicious modifications by a middle man whose job is just to pipe my data. Suppose I don't trust GitHub. What makes you think I can't use signatures properly so that I can still trust the code hosted on GitHub, safe from malicious modifications by GitHub whose job is just to host my code?
- deleted 8y ago[deleted]